< 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<? extends Operator>);
+ * public JAXBElement<? extends Operator> 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<Task> tasks;
+ * List<Task> tasks;
* }
*
* abstract class Task {
* }
*
@@ -120,20 +120,20 @@
* @XmlRootElement(name="javac")
* class JavacTask extends Task {
* ...
* }
*
- * <!-- XML Schema fragment -->
- * <xs:element name="target" type="Target">
- * <xs:complexType name="Target">
- * <xs:sequence>
- * <xs:choice maxOccurs="unbounded">
- * <xs:element ref="jar">
- * <xs:element ref="javac">
- * </xs:choice>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:element name="target" type="Target">
+ * <xs:complexType name="Target">
+ * <xs:sequence>
+ * <xs:choice maxOccurs="unbounded">
+ * <xs:element ref="jar">
+ * <xs:element ref="javac">
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
*
* </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>
- * <target>
- * <jar>
+ * <target>
+ * <jar>
* ....
- * </jar>
- * <javac>
+ * </jar>
+ * <javac>
* ....
- * </javac>
- * </target>
+ * </javac>
+ * </target>
* </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<? extends Operator> term;
+ * JAXBElement<? extends Operator> term;
* }
*
* @XmlRegistry
* class ObjectFactory {
* @XmlElementDecl(name="operator")
- * JAXBElement<Operator> createOperator(Operator o) {...}
+ * JAXBElement<Operator> createOperator(Operator o) {...}
* @XmlElementDecl(name="add",substitutionHeadName="operator")
- * JAXBElement<Operator> createAdd(Operator o) {...}
+ * JAXBElement<Operator> createAdd(Operator o) {...}
* @XmlElementDecl(name="sub",substitutionHeadName="operator")
- * JAXBElement<Operator> createSub(Operator o) {...}
+ * JAXBElement<Operator> 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>
- * <math>
- * <add>...</add>
- * </math>
+ * <math>
+ * <add>...</add>
+ * </math>
* </pre>
*
*
* @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems,Inc. </li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
* @see XmlElementRefs
< prev index next >