< prev index next >
src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 81,105 ****
* }
* public List items;
* }
*
* <!-- XML Representation for a List of {1,2.5}
! * XML output is not wrapped using another element -->
* ...
! * <A> 1 </A>
! * <B> 2.5 </B>
* ...
*
! * <!-- XML Schema fragment -->
! * <xs:complexType name="Foo">
! * <xs:sequence>
! * <xs:choice minOccurs="0" maxOccurs="unbounded">
! * <xs:element name="A" type="xs:int"/>
! * <xs:element name="B" type="xs:float"/>
! * <xs:choice>
! * </xs:sequence>
! * </xs:complexType>
*
* </pre>
*
* <p><b>Example 2:</b> Map to a list of elements wrapped with another element
* </p>
--- 81,105 ----
* }
* public List items;
* }
*
* <!-- XML Representation for a List of {1,2.5}
! * XML output is not wrapped using another element -->
* ...
! * <A> 1 </A>
! * <B> 2.5 </B>
* ...
*
! * <!-- XML Schema fragment -->
! * <xs:complexType name="Foo">
! * <xs:sequence>
! * <xs:choice minOccurs="0" maxOccurs="unbounded">
! * <xs:element name="A" type="xs:int"/>
! * <xs:element name="B" type="xs:float"/>
! * <xs:choice>
! * </xs:sequence>
! * </xs:complexType>
*
* </pre>
*
* <p><b>Example 2:</b> Map to a list of elements wrapped with another element
* </p>
*** 113,135 ****
* @XmlElement(name="B", type=Float.class)
* }
* public List items;
* }
*
! * <!-- XML Schema fragment -->
! * <xs:complexType name="Foo">
! * <xs:sequence>
! * <xs:element name="bar">
! * <xs:complexType>
! * <xs:choice minOccurs="0" maxOccurs="unbounded">
! * <xs:element name="A" type="xs:int"/>
! * <xs:element name="B" type="xs:float"/>
! * </xs:choice>
! * </xs:complexType>
! * </xs:element>
! * </xs:sequence>
! * </xs:complexType>
* </pre>
*
* <p><b>Example 3:</b> Change element name based on type using an adapter.
* </p>
* <pre>
--- 113,135 ----
* @XmlElement(name="B", type=Float.class)
* }
* public List items;
* }
*
! * <!-- XML Schema fragment -->
! * <xs:complexType name="Foo">
! * <xs:sequence>
! * <xs:element name="bar">
! * <xs:complexType>
! * <xs:choice minOccurs="0" maxOccurs="unbounded">
! * <xs:element name="A" type="xs:int"/>
! * <xs:element name="B" type="xs:float"/>
! * </xs:choice>
! * </xs:complexType>
! * </xs:element>
! * </xs:sequence>
! * </xs:complexType>
* </pre>
*
* <p><b>Example 3:</b> Change element name based on type using an adapter.
* </p>
* <pre>
*** 144,166 ****
*
* @XmlType abstract class P {...}
* @XmlType(name="PX") class PX extends P {...}
* @XmlType(name="PY") class PY extends P {...}
*
! * <!-- XML Schema fragment -->
! * <xs:complexType name="Foo">
! * <xs:sequence>
! * <xs:element name="bar">
! * <xs:complexType>
! * <xs:choice minOccurs="0" maxOccurs="unbounded">
! * <xs:element name="A" type="PX"/>
! * <xs:element name="B" type="PY"/>
! * </xs:choice>
! * </xs:complexType>
! * </xs:element>
! * </xs:sequence>
! * </xs:complexType>
* </pre>
*
* @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
* @see XmlElement
* @see XmlElementRef
--- 144,166 ----
*
* @XmlType abstract class P {...}
* @XmlType(name="PX") class PX extends P {...}
* @XmlType(name="PY") class PY extends P {...}
*
! * <!-- XML Schema fragment -->
! * <xs:complexType name="Foo">
! * <xs:sequence>
! * <xs:element name="bar">
! * <xs:complexType>
! * <xs:choice minOccurs="0" maxOccurs="unbounded">
! * <xs:element name="A" type="PX"/>
! * <xs:element name="B" type="PY"/>
! * </xs:choice>
! * </xs:complexType>
! * </xs:element>
! * </xs:sequence>
! * </xs:complexType>
* </pre>
*
* @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
* @see XmlElement
* @see XmlElementRef
< prev index next >