|
| 1 | +<!-- |
| 2 | + |
| 3 | + Copyright 2005-2017 Dozer Project |
| 4 | + |
| 5 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + you may not use this file except in compliance with the License. |
| 7 | + You may obtain a copy of the License at |
| 8 | + |
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + |
| 11 | + Unless required by applicable law or agreed to in writing, software |
| 12 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + See the License for the specific language governing permissions and |
| 15 | + limitations under the License. |
| 16 | + |
| 17 | +--> |
| 18 | +<!-- |
| 19 | + The document root |
| 20 | +--> |
| 21 | +<!ELEMENT mappings ( configuration?, mapping* ) > |
| 22 | + |
| 23 | +<!-- |
| 24 | + Default values that are applied to all mappings. Global Configuration. |
| 25 | + |
| 26 | + Required Attributes: |
| 27 | + |
| 28 | + Optional Attributes: |
| 29 | + |
| 30 | + stop-on-errors Indicates whether Dozer should stop mapping fields and throw the Exception if an error is encountered while performing a field mapping. |
| 31 | + It is recommended that this is set to "true". |
| 32 | + If set to "false", Dozer will trap the exception, log the error, and then continue mapping subsequent fields |
| 33 | + The default value is "true". |
| 34 | + date-format The string format of Date fields. This is used for field mapping between Strings and Dates |
| 35 | + wildcard Inicates whether Dozer automatically map fields that have the same name. |
| 36 | + This will typically be set to "true". The default value is "true" |
| 37 | + trim-strings Inicates whether Dozer automatically trims String values prior to setting the destination value. |
| 38 | + The default value is "false" |
| 39 | + bean-factory The factory class to create data objects. This typically will not be specified. |
| 40 | + By default Dozer constructs new instances of data objects by invoking the no-arg constructor |
| 41 | + relationship-type Indications whether collections are mapped cumulative or non-cumulative. cumulative indicates the element is added to the collection. |
| 42 | + non-cumulative indicates the element will be added or an existing entry will be updated. |
| 43 | + custom-converters The custom converters to be registered with Dozer. |
| 44 | + copy-by-references Indicates which class types should always be copied by reference |
| 45 | +--> |
| 46 | +<!ELEMENT configuration ( stop-on-errors?, date-format?, wildcard?, trim-strings?, map-null?, map-empty-string?, bean-factory?, relationship-type?, custom-converters*, copy-by-references*, allowed-exceptions* ) > |
| 47 | + |
| 48 | + |
| 49 | +<!-- |
| 50 | + Specifies a custom mapping definition between two classes(data types). All Mapping definitions are bi-directional by default. |
| 51 | + Global configuration element values are inherited |
| 52 | + |
| 53 | + Required Attributes: |
| 54 | + |
| 55 | + Optional Attributes: |
| 56 | + |
| 57 | + date-format The string format of Date fields. This is used for field mapping between Strings and Dates |
| 58 | + stop-on-errors Indicates whether Dozer should stop mapping fields and throw the Exception if an error is encountered while performing a field mapping. |
| 59 | + It is recommended that this is set to "true". |
| 60 | + If set to "false", Dozer will trap the exception, log the error, and then continue mapping subsequent fields |
| 61 | + The default value is "true" |
| 62 | + wildcard Inicates whether Dozer automatically map fields that have the same name. The default value is "true" |
| 63 | + trim-strings Inicates whether Dozer automatically trims String values prior to setting the destination value. |
| 64 | + The default value is "false" |
| 65 | + map-null Indicates whether null values are mapped. The default value is "true" |
| 66 | + map-empty-string Indicates whether empty string values are mapped. The default value is "true" |
| 67 | + bean-factory The factory class to create data objects. This typically will not be specified. |
| 68 | + By default Dozer constructs new instances of data objects by invoking the no-arg constructor |
| 69 | + type Indicates whether this mapping is bi-directional or only one-way. Typically this will be set to bi-directional. |
| 70 | + The default is "bi-directional". |
| 71 | + map-id The id that uniquely identifies this mapping definition. This typically will not be specified. |
| 72 | + You would only need to specify this for only need this for special context based mapping |
| 73 | + and when mapping between Map objects and Custom Data Objects. |
| 74 | + relationship-type Indications whether collections are mapped cumulative or non-cumulative. cumulative indicates the element is added to the collection. |
| 75 | + non-cumulative indicates the element will be added or an existing entry will be updated. |
| 76 | +--> |
| 77 | + |
| 78 | +<!ELEMENT mapping ( class-a | class-b | field | field-exclude )* > |
| 79 | +<!ATTLIST mapping date-format CDATA #IMPLIED > |
| 80 | +<!ATTLIST mapping stop-on-errors CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 81 | +<!ATTLIST mapping wildcard CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 82 | +<!ATTLIST mapping trim-strings CDATA #IMPLIED> <!-- (true | false ) "false" : if we don't make this CDATA the overidden flag is always true --> |
| 83 | +<!ATTLIST mapping map-null CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 84 | +<!ATTLIST mapping map-empty-string CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 85 | +<!ATTLIST mapping bean-factory CDATA #IMPLIED> |
| 86 | +<!ATTLIST mapping type (one-way | bi-directional) "bi-directional" > |
| 87 | +<!ATTLIST mapping relationship-type CDATA #IMPLIED > |
| 88 | +<!ATTLIST mapping map-id CDATA #IMPLIED> |
| 89 | + |
| 90 | +<!-- |
| 91 | + Specifies one of the classes in the mapping definition. All Mapping definitions are bi-directional by default. |
| 92 | + Global configuration and Mapping element values are inherited |
| 93 | + |
| 94 | + Required Attributes: |
| 95 | + |
| 96 | + Optional Attributes: |
| 97 | + |
| 98 | + bean-factory The factory class to create data objects. This typically will not be specified. |
| 99 | + By default Dozer constructs new instances of data objects by invoking the no-arg constructor |
| 100 | + factory-bean-id The id passed to the specified bean factory |
| 101 | + map-set-method For Map backed objects, this indicates which setter method should be used to retrieve field values. |
| 102 | + This should only be used of Map backed objects. |
| 103 | + map-get-method For Map backed objects, this indicates which getter method should be used to retrieve field values. |
| 104 | + This should only be used of Map backed objects. |
| 105 | + create-method Which method to invoke to create a new instance of the class. This is typically not specified. |
| 106 | + By default, the no arg constructor(public or private) is used |
| 107 | + map-null Indicates whether null values are mapped. The default value is "true" |
| 108 | + map-empty-string Indicates whether empty string values are mapped. The default value is "true" |
| 109 | +--> |
| 110 | +<!ELEMENT class-a ( #PCDATA ) > |
| 111 | +<!ATTLIST class-a bean-factory CDATA #IMPLIED > |
| 112 | +<!ATTLIST class-a factory-bean-id CDATA #IMPLIED > |
| 113 | +<!ATTLIST class-a map-set-method CDATA #IMPLIED > |
| 114 | +<!ATTLIST class-a map-get-method CDATA #IMPLIED > |
| 115 | +<!ATTLIST class-a create-method CDATA #IMPLIED > |
| 116 | +<!ATTLIST class-a map-null CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 117 | +<!ATTLIST class-a map-empty-string CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 118 | + |
| 119 | + |
| 120 | +<!-- |
| 121 | + Specifies the other class in the mapping definition |
| 122 | +--> |
| 123 | +<!ELEMENT class-b ( #PCDATA ) > |
| 124 | +<!ATTLIST class-b bean-factory CDATA #IMPLIED > |
| 125 | +<!ATTLIST class-b factory-bean-id CDATA #IMPLIED > |
| 126 | +<!ATTLIST class-b map-set-method CDATA #IMPLIED > |
| 127 | +<!ATTLIST class-b map-get-method CDATA #IMPLIED > |
| 128 | +<!ATTLIST class-b create-method CDATA #IMPLIED > |
| 129 | +<!ATTLIST class-b map-null CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 130 | +<!ATTLIST class-b map-empty-string CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true --> |
| 131 | + |
| 132 | +<!-- |
| 133 | + Specifies a custom field mapping. Fields that share the same attribute name do not need to be defined. |
| 134 | + Dozer automatically maps fields that match on attribute name. All Field Mapping definitions are bi-directional by default. |
| 135 | + Global configuration, Mapping, and Class element values are inherited. |
| 136 | + |
| 137 | + Hints are used for mapping Collection types. A hint indicates which type of destination object should be created and added to the |
| 138 | + destination Collection. |
| 139 | + |
| 140 | + Required Attributes: |
| 141 | + |
| 142 | + Optional Attributes: |
| 143 | + |
| 144 | + relationship-type For collections, indicates whether to add to existing values or to always replace any existing entries |
| 145 | + remove-orphans For collections, indicates whether items that did not exist in the source collection should be removed from the destination collection. |
| 146 | + type Indicates whether this mapping is bi-directional or only one-way. Typically this will be set to bi-directional. |
| 147 | + The default is "bi-directional". |
| 148 | + map-id The id that uniquely identifies this mapping definition. This typically will not be specified. |
| 149 | + You would only need to specify this for only need this for special context based mapping |
| 150 | + and when mapping between Map objects and Custom Data Objects. |
| 151 | + copy-by-reference Indicates whether the source field value is copied by reference or by value when populating the destination field. |
| 152 | + The default value is "false" |
| 153 | + custom-converter Indicates that a specific custom converter should be used for mapping this field. Typically this will not be specified. |
| 154 | +--> |
| 155 | +<!ELEMENT field ( a, b ,a-hint?, b-hint?, a-deep-index-hint?, b-deep-index-hint? ) > |
| 156 | +<!ATTLIST field relationship-type CDATA #IMPLIED > |
| 157 | +<!ATTLIST field remove-orphans CDATA #IMPLIED> |
| 158 | +<!ATTLIST field type (one-way | bi-directional) "bi-directional" > |
| 159 | +<!ATTLIST field map-id CDATA #IMPLIED> |
| 160 | +<!ATTLIST field copy-by-reference CDATA #IMPLIED> <!-- (true | false ) "false" : if we don't make this CDATA the overidden flag is always true --> |
| 161 | +<!ATTLIST field custom-converter CDATA #IMPLIED> |
| 162 | +<!ATTLIST field custom-converter-id CDATA #IMPLIED> |
| 163 | +<!ATTLIST field custom-converter-param CDATA #IMPLIED> |
| 164 | + |
| 165 | +<!-- |
| 166 | + Exclude a particular field from being mapped |
| 167 | +--> |
| 168 | +<!ELEMENT field-exclude ( a, b ) > |
| 169 | +<!ATTLIST field-exclude type (one-way | bi-directional) "bi-directional" > |
| 170 | + |
| 171 | + |
| 172 | +<!-- |
| 173 | + Specifies one of the fields in the field mapping definition. Global configuration, mapping, class, and field element values are inherited |
| 174 | + |
| 175 | + Required Attributes: |
| 176 | + |
| 177 | + Optional Attributes: |
| 178 | + |
| 179 | + date-format The string format of Date fields. This is used for field mapping between Strings and Dates |
| 180 | + set-method Indicates which set method to invoke when setting the destination value. Typically this will not be specified. |
| 181 | + By default, the beans attribute setter is used. |
| 182 | + get-method Indicates which get method to invoke on the src object to get the field value Typically this will not be specified. |
| 183 | + By default, the beans attribute getter is used. |
| 184 | + is-accessible Indicates whether Dozer bypasses getter/setter methods and accesses the field directly. |
| 185 | + This will typically be set to "false". The default value is "false". If set to "true", the |
| 186 | + getter/setter methods will NOT be invoked. You would want to set this to "true" if |
| 187 | + the field is lacking a getter or setter method. |
| 188 | +--> |
| 189 | +<!ELEMENT a ( #PCDATA ) > |
| 190 | +<!ATTLIST a date-format CDATA #IMPLIED > |
| 191 | +<!ATTLIST a type (iterate | generic ) "generic" > |
| 192 | +<!ATTLIST a set-method CDATA #IMPLIED > |
| 193 | +<!ATTLIST a get-method CDATA #IMPLIED > |
| 194 | +<!ATTLIST a key CDATA #IMPLIED > |
| 195 | +<!ATTLIST a map-set-method CDATA #IMPLIED > |
| 196 | +<!ATTLIST a map-get-method CDATA #IMPLIED > |
| 197 | +<!ATTLIST a is-accessible CDATA #IMPLIED > |
| 198 | +<!ATTLIST a create-method CDATA #IMPLIED> |
| 199 | + |
| 200 | +<!-- |
| 201 | + Specifies the other field in the field mapping definition. |
| 202 | +--> |
| 203 | +<!ELEMENT b ( #PCDATA ) > |
| 204 | +<!ATTLIST b date-format CDATA #IMPLIED > |
| 205 | +<!ATTLIST b type (iterate | generic ) "generic" > |
| 206 | +<!ATTLIST b set-method CDATA #IMPLIED > |
| 207 | +<!ATTLIST b get-method CDATA #IMPLIED > |
| 208 | +<!ATTLIST b key CDATA #IMPLIED > |
| 209 | +<!ATTLIST b map-set-method CDATA #IMPLIED > |
| 210 | +<!ATTLIST b map-get-method CDATA #IMPLIED > |
| 211 | +<!ATTLIST b is-accessible CDATA #IMPLIED > |
| 212 | +<!ATTLIST b create-method CDATA #IMPLIED> |
| 213 | + |
| 214 | +<!-- |
| 215 | + DTD element declarations |
| 216 | +--> |
| 217 | +<!ELEMENT a-hint ( #PCDATA ) > |
| 218 | +<!ELEMENT b-hint ( #PCDATA ) > |
| 219 | +<!ELEMENT a-deep-index-hint ( #PCDATA ) > |
| 220 | +<!ELEMENT b-deep-index-hint ( #PCDATA ) > |
| 221 | +<!ELEMENT stop-on-errors ( #PCDATA ) > |
| 222 | +<!ELEMENT date-format ( #PCDATA ) > |
| 223 | +<!ELEMENT map-null ( #PCDATA ) > |
| 224 | +<!ELEMENT map-empty-string ( #PCDATA ) > |
| 225 | +<!ELEMENT wildcard ( #PCDATA ) > |
| 226 | +<!ELEMENT trim-strings ( #PCDATA ) > |
| 227 | +<!ELEMENT bean-factory ( #PCDATA ) > |
| 228 | +<!ELEMENT relationship-type ( #PCDATA ) > |
| 229 | +<!ELEMENT custom-converters ( converter+ ) > |
| 230 | +<!ELEMENT copy-by-references ( copy-by-reference+ ) > |
| 231 | +<!ELEMENT copy-by-reference ( #PCDATA ) > |
| 232 | +<!ELEMENT is-accessible ( #PCDATA ) > |
| 233 | +<!ELEMENT allowed-exceptions ( exception+ ) > |
| 234 | +<!ELEMENT exception ( #PCDATA ) > |
| 235 | + |
| 236 | +<!ELEMENT converter ( class-a, class-b ) > |
| 237 | +<!ATTLIST converter type CDATA #REQUIRED > |
| 238 | + |
0 commit comments