110 * see @{@link XmlValue} annotation type. |
110 * see @{@link XmlValue} annotation type. |
111 * <p> |
111 * <p> |
112 * The following table shows the mapping of the class to a XML Schema |
112 * The following table shows the mapping of the class to a XML Schema |
113 * complex type or simple type. The notational symbols used in the table are: |
113 * complex type or simple type. The notational symbols used in the table are: |
114 * <ul> |
114 * <ul> |
115 * <li> -> : represents a mapping </li> |
115 * <li> {@literal ->} : represents a mapping </li> |
116 * <li> [x]+ : one or more occurances of x </li> |
116 * <li> [x]+ : one or more occurances of x </li> |
117 * <li> [ <tt>@XmlValue</tt> property ]: JavaBean property annotated with |
117 * <li> [ <tt>@XmlValue</tt> property ]: JavaBean property annotated with |
118 * <tt>@XmlValue</tt></li> |
118 * <tt>@XmlValue</tt></li> |
119 * <li> X : don't care |
119 * <li> X : don't care |
120 * </ul> |
120 * </ul> |
130 * </tr> |
130 * </tr> |
131 * |
131 * |
132 * <tr valign="top"> |
132 * <tr valign="top"> |
133 * <td>Class</td> |
133 * <td>Class</td> |
134 * <td>{}</td> |
134 * <td>{}</td> |
135 * <td>[property]+ -> elements</td> |
135 * <td>[property]+ {@literal ->} elements</td> |
136 * <td>complexcontent<br>xs:all</td> |
136 * <td>complexcontent<br>xs:all</td> |
137 * <td> </td> |
137 * <td> </td> |
138 * </tr> |
138 * </tr> |
139 * |
139 * |
140 * <tr valign="top"> |
140 * <tr valign="top"> |
141 * <td>Class</td> |
141 * <td>Class</td> |
142 * <td>non empty</td> |
142 * <td>non empty</td> |
143 * <td>[property]+ -> elements</td> |
143 * <td>[property]+ {@literal ->} elements</td> |
144 * <td>complexcontent<br>xs:sequence</td> |
144 * <td>complexcontent<br>xs:sequence</td> |
145 * <td> </td> |
145 * <td> </td> |
146 * </tr> |
146 * </tr> |
147 * |
147 * |
148 * <tr valign="top"> |
148 * <tr valign="top"> |
149 * <td>Class</td> |
149 * <td>Class</td> |
150 * <td>X</td> |
150 * <td>X</td> |
151 * <td>no property -> element</td> |
151 * <td>no property {@literal ->} element</td> |
152 * <td>complexcontent<br>empty sequence</td> |
152 * <td>complexcontent<br>empty sequence</td> |
153 * <td> </td> |
153 * <td> </td> |
154 * </tr> |
154 * </tr> |
155 * |
155 * |
156 * <tr valign="top"> |
156 * <tr valign="top"> |
157 * <td>Class</td> |
157 * <td>Class</td> |
158 * <td>X</td> |
158 * <td>X</td> |
159 * <td>1 [<tt>@XmlValue</tt> property] {@literal &&} <br> [property]+ -> attributes</td> |
159 * <td>1 [<tt>@XmlValue</tt> property] {@literal &&} <br> [property]+ {@literal ->} attributes</td> |
160 * <td>simplecontent</td> |
160 * <td>simplecontent</td> |
161 * <td> </td> |
161 * <td> </td> |
162 * </tr> |
162 * </tr> |
163 * |
163 * |
164 * <tr valign="top"> |
164 * <tr valign="top"> |
165 * <td>Class</td> |
165 * <td>Class</td> |
166 * <td>X</td> |
166 * <td>X</td> |
167 * <td>1 [<tt>@XmlValue</tt> property] {@literal &&} <br> no properties -> attribute</td> |
167 * <td>1 [<tt>@XmlValue</tt> property] {@literal &&} <br> no properties {@literal ->} attribute</td> |
168 * <td> </td> |
168 * <td> </td> |
169 * <td>simpletype</td> |
169 * <td>simpletype</td> |
170 * </tr> |
170 * </tr> |
171 * </tbody> |
171 * </tbody> |
172 * </table> |
172 * </table> |
206 * void setState(String) {..}; |
206 * void setState(String) {..}; |
207 * |
207 * |
208 * java.math.BigDecimal getZip() {..}; |
208 * java.math.BigDecimal getZip() {..}; |
209 * void setZip(java.math.BigDecimal) {..}; |
209 * void setZip(java.math.BigDecimal) {..}; |
210 * } |
210 * } |
211 * |
211 * {@code |
212 * <!-- XML Schema mapping for USAddress --> |
212 * |
213 * <xs:complexType name="USAddress"> |
213 * <!-- XML Schema mapping for USAddress --> |
214 * <xs:sequence> |
214 * <xs:complexType name="USAddress"> |
215 * <xs:element name="street" type="xs:string"/> |
215 * <xs:sequence> |
216 * <xs:element name="city" type="xs:string"/> |
216 * <xs:element name="street" type="xs:string"/> |
217 * <xs:element name="state" type="xs:string"/> |
217 * <xs:element name="city" type="xs:string"/> |
218 * <xs:element name="zip" type="xs:decimal"/> |
218 * <xs:element name="state" type="xs:string"/> |
219 * <xs:element name="name" type="xs:string"/> |
219 * <xs:element name="zip" type="xs:decimal"/> |
220 * </xs:all> |
220 * <xs:element name="name" type="xs:string"/> |
221 * </xs:complexType> |
221 * </xs:all> |
222 * </pre> |
222 * </xs:complexType> |
|
223 * }</pre> |
223 * <p> <b> Example 2: </b> Map a class to a complex type with |
224 * <p> <b> Example 2: </b> Map a class to a complex type with |
224 * xs:all </p> |
225 * xs:all </p> |
225 * <pre> |
226 * <pre> |
226 * @XmlType(propOrder={}) |
227 * @XmlType(propOrder={}) |
227 * public class USAddress { ...} |
228 * public class USAddress { ...} |
228 * |
229 * {@code |
229 * <!-- XML Schema mapping for USAddress --> |
230 * |
230 * <xs:complexType name="USAddress"> |
231 * <!-- XML Schema mapping for USAddress --> |
231 * <xs:all> |
232 * <xs:complexType name="USAddress"> |
232 * <xs:element name="name" type="xs:string"/> |
233 * <xs:all> |
233 * <xs:element name="street" type="xs:string"/> |
234 * <xs:element name="name" type="xs:string"/> |
234 * <xs:element name="city" type="xs:string"/> |
235 * <xs:element name="street" type="xs:string"/> |
235 * <xs:element name="state" type="xs:string"/> |
236 * <xs:element name="city" type="xs:string"/> |
236 * <xs:element name="zip" type="xs:decimal"/> |
237 * <xs:element name="state" type="xs:string"/> |
237 * </xs:sequence> |
238 * <xs:element name="zip" type="xs:decimal"/> |
238 * </xs:complexType> |
239 * </xs:sequence> |
239 *</pre> |
240 * </xs:complexType> |
|
241 *}</pre> |
240 * <p> <b> Example 3: </b> Map a class to a global element with an |
242 * <p> <b> Example 3: </b> Map a class to a global element with an |
241 * anonymous type. |
243 * anonymous type. |
242 * </p> |
244 * </p> |
243 * <pre> |
245 * <pre> |
244 * @XmlRootElement |
246 * @XmlRootElement |
245 * @XmlType(name="") |
247 * @XmlType(name="") |
246 * public class USAddress { ...} |
248 * public class USAddress { ...} |
247 * |
249 * {@code |
248 * <!-- XML Schema mapping for USAddress --> |
250 * |
249 * <xs:element name="USAddress"> |
251 * <!-- XML Schema mapping for USAddress --> |
250 * <xs:complexType> |
252 * <xs:element name="USAddress"> |
251 * <xs:sequence> |
253 * <xs:complexType> |
252 * <xs:element name="name" type="xs:string"/> |
254 * <xs:sequence> |
253 * <xs:element name="street" type="xs:string"/> |
255 * <xs:element name="name" type="xs:string"/> |
254 * <xs:element name="city" type="xs:string"/> |
256 * <xs:element name="street" type="xs:string"/> |
255 * <xs:element name="state" type="xs:string"/> |
257 * <xs:element name="city" type="xs:string"/> |
256 * <xs:element name="zip" type="xs:decimal"/> |
258 * <xs:element name="state" type="xs:string"/> |
257 * </xs:sequence> |
259 * <xs:element name="zip" type="xs:decimal"/> |
258 * </xs:complexType> |
260 * </xs:sequence> |
259 * </xs:element> |
261 * </xs:complexType> |
260 * </pre> |
262 * </xs:element> |
|
263 * }</pre> |
261 * |
264 * |
262 * <p> <b> Example 4: </b> Map a property to a local element with |
265 * <p> <b> Example 4: </b> Map a property to a local element with |
263 * anonymous type. |
266 * anonymous type. |
264 * <pre> |
267 * <pre> |
265 * //Example: Code fragment |
268 * //Example: Code fragment |
269 * } |
272 * } |
270 * |
273 * |
271 * @XmlType(name="") |
274 * @XmlType(name="") |
272 * public class USAddress { ... } |
275 * public class USAddress { ... } |
273 * } |
276 * } |
274 * |
277 * {@code |
275 * <!-- XML Schema mapping for USAddress --> |
278 * |
276 * <xs:complexType name="Invoice"> |
279 * <!-- XML Schema mapping for USAddress --> |
277 * <xs:sequence> |
280 * <xs:complexType name="Invoice"> |
278 * <xs:element name="addr"> |
281 * <xs:sequence> |
279 * <xs:complexType> |
282 * <xs:element name="addr"> |
280 * <xs:element name="name", type="xs:string"/> |
283 * <xs:complexType> |
281 * <xs:element name="city", type="xs:string"/> |
284 * <xs:element name="name", type="xs:string"/> |
282 * <xs:element name="city" type="xs:string"/> |
285 * <xs:element name="city", type="xs:string"/> |
283 * <xs:element name="state" type="xs:string"/> |
286 * <xs:element name="city" type="xs:string"/> |
284 * <xs:element name="zip" type="xs:decimal"/> |
287 * <xs:element name="state" type="xs:string"/> |
285 * </xs:complexType> |
288 * <xs:element name="zip" type="xs:decimal"/> |
|
289 * </xs:complexType> |
286 * ... |
290 * ... |
287 * </xs:sequence> |
291 * </xs:sequence> |
288 * </xs:complexType> |
292 * </xs:complexType> |
289 * </pre> |
293 * }</pre> |
290 * |
294 * |
291 * <p> <b> Example 5: </b> Map a property to an attribute with |
295 * <p> <b> Example 5: </b> Map a property to an attribute with |
292 * anonymous type. |
296 * anonymous type. |
293 * |
297 * |
294 * <pre> |
298 * <pre> |
304 * @XmlType(name="") |
308 * @XmlType(name="") |
305 * public class USPrice { |
309 * public class USPrice { |
306 * @XmlValue |
310 * @XmlValue |
307 * public java.math.BigDecimal price; |
311 * public java.math.BigDecimal price; |
308 * } |
312 * } |
309 * |
313 * {@code |
310 * <!-- Example: XML Schema fragment --> |
314 * |
311 * <xs:complexType name="Item"> |
315 * <!-- Example: XML Schema fragment --> |
312 * <xs:sequence> |
316 * <xs:complexType name="Item"> |
313 * <xs:element name="name" type="xs:string"/> |
317 * <xs:sequence> |
314 * <xs:attribute name="price"> |
318 * <xs:element name="name" type="xs:string"/> |
315 * <xs:simpleType> |
319 * <xs:attribute name="price"> |
316 * <xs:restriction base="xs:decimal"/> |
320 * <xs:simpleType> |
317 * </xs:simpleType> |
321 * <xs:restriction base="xs:decimal"/> |
318 * </xs:attribute> |
322 * </xs:simpleType> |
319 * </xs:sequence> |
323 * </xs:attribute> |
320 * </xs:complexType> |
324 * </xs:sequence> |
321 * </pre> |
325 * </xs:complexType> |
|
326 * }</pre> |
322 * |
327 * |
323 * <p> <b> Example 6: </b> Define a factoryClass and factoryMethod |
328 * <p> <b> Example 6: </b> Define a factoryClass and factoryMethod |
324 * |
329 * |
325 * <pre> |
330 * <pre> |
326 * @XmlType(name="USAddressType", factoryClass=USAddressFactory.class, |
331 * @XmlType(name="USAddressType", factoryClass=USAddressFactory.class, |