< prev index next >

src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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

@@ -55,12 +55,12 @@
  * schema using substitution groups. Schema derived code provides
  * support for substitution groups using an <i>element property</i>,
  * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
  * element property method signature is of the form:
  * <pre>
- *     public void setTerm(JAXBElement<? extends Operator>);
- *     public JAXBElement<? extends Operator> getTerm();
+ *     public void setTerm(JAXBElement&lt;? extends Operator&gt;);
+ *     public JAXBElement&lt;? extends Operator&gt; getTerm();
  * </pre>
  * <p>
  * An element factory method annotated with  {@link XmlElementDecl} is
  * used to create a <tt>JAXBElement</tt> instance, containing an XML
  * element name. The presence of @XmlElementRef annotation on an

@@ -104,11 +104,11 @@
  *     class Target {
  *         // The presence of @XmlElementRef indicates that the XML
  *         // element name will be derived from the @XmlRootElement
  *         // annotation on the type (for e.g. "jar" for JarTask).
  *         @XmlElementRef
- *         List&lt;Task> tasks;
+ *         List&lt;Task&gt; tasks;
  *     }
  *
  *     abstract class Task {
  *     }
  *

@@ -120,20 +120,20 @@
  *     @XmlRootElement(name="javac")
  *     class JavacTask extends Task {
  *         ...
  *     }
  *
- *     &lt;!-- XML Schema fragment -->
- *     &lt;xs:element name="target" type="Target">
- *     &lt;xs:complexType name="Target">
- *       &lt;xs:sequence>
- *         &lt;xs:choice maxOccurs="unbounded">
- *           &lt;xs:element ref="jar">
- *           &lt;xs:element ref="javac">
- *         &lt;/xs:choice>
- *       &lt;/xs:sequence>
- *     &lt;/xs:complexType>
+ *     &lt;!-- XML Schema fragment --&gt;
+ *     &lt;xs:element name="target" type="Target"&gt;
+ *     &lt;xs:complexType name="Target"&gt;
+ *       &lt;xs:sequence&gt;
+ *         &lt;xs:choice maxOccurs="unbounded"&gt;
+ *           &lt;xs:element ref="jar"&gt;
+ *           &lt;xs:element ref="javac"&gt;
+ *         &lt;/xs:choice&gt;
+ *       &lt;/xs:sequence&gt;
+ *     &lt;/xs:complexType&gt;
  *
  * </pre>
  * <p>
  * Thus the following code fragment:
  * <pre>

@@ -142,18 +142,18 @@
  *     target.tasks.add(new JavacTask());
  *     marshal(target);
  * </pre>
  * will produce the following XML output:
  * <pre>
- *     &lt;target>
- *       &lt;jar>
+ *     &lt;target&gt;
+ *       &lt;jar&gt;
  *         ....
- *       &lt;/jar>
- *       &lt;javac>
+ *       &lt;/jar&gt;
+ *       &lt;javac&gt;
  *         ....
- *       &lt;/javac>
- *     &lt;/target>
+ *       &lt;/javac&gt;
+ *     &lt;/target&gt;
  * </pre>
  * <p>
  * It is not an error to have a class that extends <tt>Task</tt>
  * that doesn't have {@link XmlRootElement}. But they can't show up in an
  * XML instance (because they don't have XML element names).

@@ -180,21 +180,21 @@
  *         //  elements "add" or "sub". At runtime, JAXBElement
  *         //  instance contains the element name that has been
  *         //  substituted in the XML document.
  *         //
  *         @XmlElementRef(type=JAXBElement.class,name="operator")
- *         JAXBElement&lt;? extends Operator> term;
+ *         JAXBElement&lt;? extends Operator&gt; term;
  *     }
  *
  *     @XmlRegistry
  *     class ObjectFactory {
  *         @XmlElementDecl(name="operator")
- *         JAXBElement&lt;Operator> createOperator(Operator o) {...}
+ *         JAXBElement&lt;Operator&gt; createOperator(Operator o) {...}
  *         @XmlElementDecl(name="add",substitutionHeadName="operator")
- *         JAXBElement&lt;Operator> createAdd(Operator o) {...}
+ *         JAXBElement&lt;Operator&gt; createAdd(Operator o) {...}
  *         @XmlElementDecl(name="sub",substitutionHeadName="operator")
- *         JAXBElement&lt;Operator> createSub(Operator o) {...}
+ *         JAXBElement&lt;Operator&gt; createSub(Operator o) {...}
  *     }
  *
  *     class Operator {
  *         ...
  *     }

@@ -206,13 +206,13 @@
  *     m.term = new ObjectFactory().createAdd(new Operator());
  *     marshal(m);
  * </pre>
  * will produce the following XML output:
  * <pre>
- *     &lt;math>
- *       &lt;add>...&lt;/add>
- *     &lt;/math>
+ *     &lt;math&gt;
+ *       &lt;add&gt;...&lt;/add&gt;
+ *     &lt;/math&gt;
  * </pre>
  *
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems,Inc. </li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
  * @see XmlElementRefs
< prev index next >