Skip to content

Commit de7031a

Browse files
authored
Updated docs for 6.2.0 (#9)
1 parent 08bcd64 commit de7031a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3351
-4403
lines changed

dtd/bean-mapping-6.0.0.dtd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22

3-
Copyright 2005-2017 Dozer Project
3+
Copyright 2005-2018 Dozer Project
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

dtd/bean-mapping-6.2.0.dtd

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
<!--
2+
3+
Copyright 2005-2018 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+
skip-constructor Used for mapping to immutable types. Object is created with no-arg constructor.
108+
map-null Indicates whether null values are mapped. The default value is "true"
109+
map-empty-string Indicates whether empty string values are mapped. The default value is "true"
110+
-->
111+
<!ELEMENT class-a ( #PCDATA ) >
112+
<!ATTLIST class-a bean-factory CDATA #IMPLIED >
113+
<!ATTLIST class-a factory-bean-id CDATA #IMPLIED >
114+
<!ATTLIST class-a map-set-method CDATA #IMPLIED >
115+
<!ATTLIST class-a map-get-method CDATA #IMPLIED >
116+
<!ATTLIST class-a create-method CDATA #IMPLIED >
117+
<!ATTLIST class-a skip-constructor CDATA #IMPLIED >
118+
<!ATTLIST class-a map-null CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
119+
<!ATTLIST class-a map-empty-string CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
120+
121+
122+
<!--
123+
Specifies the other class in the mapping definition
124+
-->
125+
<!ELEMENT class-b ( #PCDATA ) >
126+
<!ATTLIST class-b bean-factory CDATA #IMPLIED >
127+
<!ATTLIST class-b factory-bean-id CDATA #IMPLIED >
128+
<!ATTLIST class-b map-set-method CDATA #IMPLIED >
129+
<!ATTLIST class-b map-get-method CDATA #IMPLIED >
130+
<!ATTLIST class-b create-method CDATA #IMPLIED >
131+
<!ATTLIST class-b skip-constructor CDATA #IMPLIED >
132+
<!ATTLIST class-b map-null CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
133+
<!ATTLIST class-b map-empty-string CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
134+
135+
<!--
136+
Specifies a custom field mapping. Fields that share the same attribute name do not need to be defined.
137+
Dozer automatically maps fields that match on attribute name. All Field Mapping definitions are bi-directional by default.
138+
Global configuration, Mapping, and Class element values are inherited.
139+
140+
Hints are used for mapping Collection types. A hint indicates which type of destination object should be created and added to the
141+
destination Collection.
142+
143+
Required Attributes:
144+
145+
Optional Attributes:
146+
147+
relationship-type For collections, indicates whether to add to existing values or to always replace any existing entries
148+
remove-orphans For collections, indicates whether items that did not exist in the source collection should be removed from the destination collection.
149+
type Indicates whether this mapping is bi-directional or only one-way. Typically this will be set to bi-directional.
150+
The default is "bi-directional".
151+
map-id The id that uniquely identifies this mapping definition. This typically will not be specified.
152+
You would only need to specify this for only need this for special context based mapping
153+
and when mapping between Map objects and Custom Data Objects.
154+
copy-by-reference Indicates whether the source field value is copied by reference or by value when populating the destination field.
155+
The default value is "false"
156+
custom-converter Indicates that a specific custom converter should be used for mapping this field. Typically this will not be specified.
157+
-->
158+
<!ELEMENT field ( a, b ,a-hint?, b-hint?, a-deep-index-hint?, b-deep-index-hint? ) >
159+
<!ATTLIST field relationship-type CDATA #IMPLIED >
160+
<!ATTLIST field remove-orphans CDATA #IMPLIED>
161+
<!ATTLIST field type (one-way | bi-directional) "bi-directional" >
162+
<!ATTLIST field map-id CDATA #IMPLIED>
163+
<!ATTLIST field copy-by-reference CDATA #IMPLIED> <!-- (true | false ) "false" : if we don't make this CDATA the overidden flag is always true -->
164+
<!ATTLIST field custom-converter CDATA #IMPLIED>
165+
<!ATTLIST field custom-converter-id CDATA #IMPLIED>
166+
<!ATTLIST field custom-converter-param CDATA #IMPLIED>
167+
168+
<!--
169+
Exclude a particular field from being mapped
170+
-->
171+
<!ELEMENT field-exclude ( a, b ) >
172+
<!ATTLIST field-exclude type (one-way | bi-directional) "bi-directional" >
173+
174+
175+
<!--
176+
Specifies one of the fields in the field mapping definition. Global configuration, mapping, class, and field element values are inherited
177+
178+
Required Attributes:
179+
180+
Optional Attributes:
181+
182+
date-format The string format of Date fields. This is used for field mapping between Strings and Dates
183+
set-method Indicates which set method to invoke when setting the destination value. Typically this will not be specified.
184+
By default, the beans attribute setter is used.
185+
get-method Indicates which get method to invoke on the src object to get the field value Typically this will not be specified.
186+
By default, the beans attribute getter is used.
187+
is-accessible Indicates whether Dozer bypasses getter/setter methods and accesses the field directly.
188+
This will typically be set to "false". The default value is "false". If set to "true", the
189+
getter/setter methods will NOT be invoked. You would want to set this to "true" if
190+
the field is lacking a getter or setter method.
191+
-->
192+
<!ELEMENT a ( #PCDATA ) >
193+
<!ATTLIST a date-format CDATA #IMPLIED >
194+
<!ATTLIST a type (iterate | generic ) "generic" >
195+
<!ATTLIST a set-method CDATA #IMPLIED >
196+
<!ATTLIST a get-method CDATA #IMPLIED >
197+
<!ATTLIST a key CDATA #IMPLIED >
198+
<!ATTLIST a map-set-method CDATA #IMPLIED >
199+
<!ATTLIST a map-get-method CDATA #IMPLIED >
200+
<!ATTLIST a is-accessible CDATA #IMPLIED >
201+
<!ATTLIST a create-method CDATA #IMPLIED>
202+
203+
<!--
204+
Specifies the other field in the field mapping definition.
205+
-->
206+
<!ELEMENT b ( #PCDATA ) >
207+
<!ATTLIST b date-format CDATA #IMPLIED >
208+
<!ATTLIST b type (iterate | generic ) "generic" >
209+
<!ATTLIST b set-method CDATA #IMPLIED >
210+
<!ATTLIST b get-method CDATA #IMPLIED >
211+
<!ATTLIST b key CDATA #IMPLIED >
212+
<!ATTLIST b map-set-method CDATA #IMPLIED >
213+
<!ATTLIST b map-get-method CDATA #IMPLIED >
214+
<!ATTLIST b is-accessible CDATA #IMPLIED >
215+
<!ATTLIST b create-method CDATA #IMPLIED>
216+
217+
<!--
218+
DTD element declarations
219+
-->
220+
<!ELEMENT a-hint ( #PCDATA ) >
221+
<!ELEMENT b-hint ( #PCDATA ) >
222+
<!ELEMENT a-deep-index-hint ( #PCDATA ) >
223+
<!ELEMENT b-deep-index-hint ( #PCDATA ) >
224+
<!ELEMENT stop-on-errors ( #PCDATA ) >
225+
<!ELEMENT date-format ( #PCDATA ) >
226+
<!ELEMENT map-null ( #PCDATA ) >
227+
<!ELEMENT map-empty-string ( #PCDATA ) >
228+
<!ELEMENT wildcard ( #PCDATA ) >
229+
<!ELEMENT trim-strings ( #PCDATA ) >
230+
<!ELEMENT bean-factory ( #PCDATA ) >
231+
<!ELEMENT relationship-type ( #PCDATA ) >
232+
<!ELEMENT custom-converters ( converter+ ) >
233+
<!ELEMENT copy-by-references ( copy-by-reference+ ) >
234+
<!ELEMENT copy-by-reference ( #PCDATA ) >
235+
<!ELEMENT is-accessible ( #PCDATA ) >
236+
<!ELEMENT allowed-exceptions ( exception+ ) >
237+
<!ELEMENT exception ( #PCDATA ) >
238+
239+
<!ELEMENT converter ( class-a, class-b ) >
240+
<!ATTLIST converter type CDATA #REQUIRED >
241+

dtd/bean-mapping.dtd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22

3-
Copyright 2005-2017 Dozer Project
3+
Copyright 2005-2018 Dozer Project
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -104,6 +104,7 @@
104104
This should only be used of Map backed objects.
105105
create-method Which method to invoke to create a new instance of the class. This is typically not specified.
106106
By default, the no arg constructor(public or private) is used
107+
skip-constructor Used for mapping to immutable types. Object is created with no-arg constructor.
107108
map-null Indicates whether null values are mapped. The default value is "true"
108109
map-empty-string Indicates whether empty string values are mapped. The default value is "true"
109110
-->
@@ -113,6 +114,7 @@
113114
<!ATTLIST class-a map-set-method CDATA #IMPLIED >
114115
<!ATTLIST class-a map-get-method CDATA #IMPLIED >
115116
<!ATTLIST class-a create-method CDATA #IMPLIED >
117+
<!ATTLIST class-a skip-constructor CDATA #IMPLIED >
116118
<!ATTLIST class-a map-null CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
117119
<!ATTLIST class-a map-empty-string CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
118120

@@ -126,6 +128,7 @@
126128
<!ATTLIST class-b map-set-method CDATA #IMPLIED >
127129
<!ATTLIST class-b map-get-method CDATA #IMPLIED >
128130
<!ATTLIST class-b create-method CDATA #IMPLIED >
131+
<!ATTLIST class-b skip-constructor CDATA #IMPLIED >
129132
<!ATTLIST class-b map-null CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
130133
<!ATTLIST class-b map-empty-string CDATA #IMPLIED> <!-- (true | false ) "true" : if we don't make this CDATA the overidden flag is always true -->
131134

0 commit comments

Comments
 (0)