diff --git a/src/main/java/javax/xml/bind/JAXBContext.java b/src/main/java/javax/xml/bind/JAXBContext.java index c0cfda9b..4e011eaf 100644 --- a/src/main/java/javax/xml/bind/JAXBContext.java +++ b/src/main/java/javax/xml/bind/JAXBContext.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2003-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -78,10 +78,10 @@ * SPEC REQUIREMENT: the provider must supply an implementation * class containing the following method signatures: * - *
- * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map<String,Object> properties ) throws JAXBException
- * public static JAXBContext createContext( Class[] classes, Map<String,Object> properties ) throws JAXBException
- * 
+ *
{@code
+ * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException
+ * public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException
+ * }
* *

* The following JAXB 1.0 requirement is only required for schema to @@ -367,7 +367,7 @@ public static JAXBContext newInstance( String contextPath ) *

* To maintain compatibility with JAXB 1.0 schema to java * interface/implementation binding, enabled by schema customization - * <jaxb:globalBindings valueClass="false">, + * {@literal }, * the JAXB provider will ensure that each package on the context path * has a jaxb.properties file which contains a value for the * javax.xml.bind.context.factory property and that all values @@ -541,7 +541,7 @@ public static JAXBContext newInstance( String contextPath, ClassLoader classLoad * Not only the new context will recognize all the classes specified, * but it will also recognize any classes that are directly/indirectly * referenced statically from the specified classes. Subclasses of - * referenced classes nor @XmlTransient referenced classes + * referenced classes nor @XmlTransient referenced classes * are not registered with JAXBContext. * * For example, in the following Java code, if you do diff --git a/src/main/java/javax/xml/bind/JAXBIntrospector.java b/src/main/java/javax/xml/bind/JAXBIntrospector.java index 7a425240..75106fd4 100644 --- a/src/main/java/javax/xml/bind/JAXBIntrospector.java +++ b/src/main/java/javax/xml/bind/JAXBIntrospector.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -89,7 +89,7 @@ public abstract class JAXBIntrospector { * *

Convenience method to abstract whether working with either * a javax.xml.bind.JAXBElement instance or an instance of - * @XmlRootElement annotated Java class.

+ * @XmlRootElement annotated Java class.

* * @param jaxbElement object that #isElement(Object) returns true. * diff --git a/src/main/java/javax/xml/bind/SchemaOutputResolver.java b/src/main/java/javax/xml/bind/SchemaOutputResolver.java index e2501287..5b998202 100644 --- a/src/main/java/javax/xml/bind/SchemaOutputResolver.java +++ b/src/main/java/javax/xml/bind/SchemaOutputResolver.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -85,11 +85,11 @@ public abstract class SchemaOutputResolver { * * If the {@link Result} object has a system ID, it must be an * absolute system ID. Those system IDs are relativized by the caller and used - * for <xs:import> statements. + * for {@literal } statements. * * If the {@link Result} object does not have a system ID, a schema * for the namespace URI is generated but it won't be explicitly - * <xs:import>ed from other schemas. + * {@literal }ed from other schemas. * * If {@code null} is returned, the schema generation for this * namespace URI will be skipped. diff --git a/src/main/java/javax/xml/bind/Unmarshaller.java b/src/main/java/javax/xml/bind/Unmarshaller.java index 5d3cc7ec..be911646 100644 --- a/src/main/java/javax/xml/bind/Unmarshaller.java +++ b/src/main/java/javax/xml/bind/Unmarshaller.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2003-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -88,12 +88,12 @@ * Unmarshalling from a StringBuffer using a * javax.xml.transform.stream.StreamSource: *
- *
+ *    
{@code
  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
  *       Unmarshaller u = jc.createUnmarshaller();
- *       StringBuffer xmlStr = new StringBuffer( "<?xml version="1.0"?>..." );
+ *       StringBuffer xmlStr = new StringBuffer( "..." );
  *       Object o = u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) );
- *    
+ * }
*
* *

@@ -253,7 +253,7 @@ * to a JAXB mapped class by {@link JAXBContext}, that the root * element's xsi:type attribute takes * precedence over the unmarshal methods declaredType parameter. - * These methods always return a JAXBElement<declaredType> + * These methods always return a {@literal JAXBElement} * instance. The table below shows how the properties of the returned JAXBElement * instance are set. * @@ -296,21 +296,21 @@ *

* Unmarshal by declaredType from a org.w3c.dom.Node: *

- *
+ *    
{@code 
  *       Schema fragment for example
- *       <xs:schema>
- *          <xs:complexType name="FooType">...<\xs:complexType>
- *          <!-- global element declaration "PurchaseOrder" -->
- *          <xs:element name="PurchaseOrder">
- *              <xs:complexType>
- *                 <xs:sequence>
- *                    <!-- local element declaration "foo" -->
- *                    <xs:element name="foo" type="FooType"/>
+ *       
+ *          ...<\xs:complexType>
+ *          
+ *          
+ *              
+ *                 
+ *                    
+ *                    
  *                    ...
- *                 </xs:sequence>
- *              </xs:complexType>
- *          </xs:element>
- *       </xs:schema>
+ *                 
+ *              
+ *          
+ *       
  *
  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
  *       Unmarshaller u = jc.createUnmarshaller();
@@ -323,8 +323,8 @@
  *                                  // local element declaration in schema.
  * 
  *       // FooType is the JAXB mapping of the type of local element declaration foo.
- *       JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
- *    
+ * JAXBElement foo = u.unmarshal( fooSubtree, FooType.class); + * }
*
* *

diff --git a/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java b/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java index 5c965534..f115639e 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -109,15 +109,15 @@ *

Schema To Java example

* * The following schema would produce the following Java class: - *
- * <xs:complexType name="foo">
- *   <xs:sequence>
- *     <xs:element name="a" type="xs:int" />
- *     <xs:element name="b" type="xs:int" />
- *     <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
- *   </xs:sequence>
- * </xs:complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *     
+ *     
+ *   
+ * 
+ * }
* *
  * class Foo {
@@ -130,30 +130,30 @@
  *
  * It can unmarshal instances like
  *
- * 
- * <foo xmlns:e="extra">
- *   <a>1</a>
- *   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
- *   <b>3</b>
- *   <e:other />
- *   <c>5</c>     // this will be bound to DOM, because the annotation doesn't remember namespaces.
- * </foo>
- * 
+ *
{@code
+ * 
+ *   1
+ *     // this will be bound to DOM, because unmarshalling is orderless
+ *   3
+ *   
+ *   5     // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * 
+ * }
* * * * The following schema would produce the following Java class: - *
- * <xs:complexType name="bar">
- *   <xs:complexContent>
- *   <xs:extension base="foo">
- *     <xs:sequence>
- *       <xs:element name="c" type="xs:int" />
- *       <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
- *     </xs:sequence>
- *   </xs:extension>
- * </xs:complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *   
+ *     
+ *       
+ *       
+ *     
+ *   
+ * 
+ * }
* *
  * class Bar extends Foo {
@@ -165,16 +165,16 @@
  *
  * It can unmarshal instances like
  *
- * 
- * <bar xmlns:e="extra">
- *   <a>1</a>
- *   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
- *   <b>3</b>
- *   <e:other />
- *   <c>5</c>     // this now goes to Bar.c
- *   <e:other />  // this will go to Foo.any
- * </bar>
- * 
+ *
{@code
+ * 
+ *   1
+ *     // this will be bound to DOM, because unmarshalling is orderless
+ *   3
+ *   
+ *   5     // this now goes to Bar.c
+ *     // this will go to Foo.any
+ * 
+ * }
* * * @@ -186,15 +186,15 @@ * *

* The following schema would produce the following Java class: - *

- * <xs:complexType name="foo">
- *   <xs:choice maxOccurs="unbounded" minOccurs="0">
- *     <xs:element name="a" type="xs:int" />
- *     <xs:element name="b" type="xs:int" />
- *     <xs:any namespace="##other" processContents="lax" />
- *   </xs:choice>
- * </xs:complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *     
+ *     
+ *   
+ * 
+ * }
* *
  * class Foo {
@@ -219,11 +219,11 @@
  * It can unmarshal instances like
  *
  * 
- * <foo xmlns:e="extra">
- *   <a>1</a>     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- *   <e:other />  // this will unmarshal to a DOM {@link Element}.
- *   <b>3</b>     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- * </foo>
+ *{@code }
+ *{@code   1}     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ *{@code   }  // this will unmarshal to a DOM {@link Element}.
+ *{@code   3}     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ *{@code }
  * 
* * @@ -240,11 +240,11 @@ * } *
* then the following document will unmarshal like this: - *
- * <foo>
- *   <unknown />
- *   <foo />
- * </foo>
+ * 
{@code
+ * 
+ *   
+ *   
+ * 
  *
  * Foo foo = unmarshal();
  * // 1 for 'unknown', another for 'foo'
@@ -254,7 +254,7 @@
  * // because of lax=true, the 'foo' element eagerly
  * // unmarshals to a Foo object.
  * assert foo.others[1] instanceof Foo;
- * 
+ * }
* * @author Kohsuke Kawaguchi * @since 1.6, JAXB 2.0 diff --git a/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java b/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java index a9b058e3..f0384399 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -66,16 +66,16 @@ * } *
* The above code maps to the following XML: - *
- * <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
- *   <xs:complexType>
- *     <xs:sequence>
- *       <xs:element name="body" type="ref:swaRef" minOccurs="0" />
- *     </xs:sequence>
- *     <xs:attribute name="data" type="ref:swaRef" use="optional" />
- *   </xs:complexType>
- * </xs:element>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *     
+ *     
+ *   
+ * 
+ * }
* *

* The above binding supports WS-I AP 1.0 WS-I Attachments Profile Version 1.0. diff --git a/src/main/java/javax/xml/bind/annotation/XmlAttribute.java b/src/main/java/javax/xml/bind/annotation/XmlAttribute.java index 447cc2d8..f322ddd5 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAttribute.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAttribute.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -104,14 +104,15 @@ * public java.math.BigDecimal getPrice() {...} ; * public void setPrice(java.math.BigDecimal ) {...}; * } - * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="USPrice"> - * <xs:sequence> - * </xs:sequence> - * <xs:attribute name="price" type="xs:decimal"/> - * </xs:complexType> - *

+ * {@code + * + * + * + * + * + * + * + * } * *

Example 2: Map a JavaBean property to an XML attribute with anonymous type.

* See Example 7 in @{@link XmlType}. @@ -123,17 +124,18 @@ * ... * @XmlAttribute List<Integer> items; * } - * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="foo"> + * {@code + * + * + * * ... - * <xs:attribute name="items"> - * <xs:simpleType> - * <xs:list itemType="xs:int"/> - * </xs:simpleType> - * </xs:complexType> + * + * + * + * + * * - * + * } * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlType * @since 1.6, JAXB 2.0 diff --git a/src/main/java/javax/xml/bind/annotation/XmlElement.java b/src/main/java/javax/xml/bind/annotation/XmlElement.java index 35228eef..ac3a0e06 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlElement.java +++ b/src/main/java/javax/xml/bind/annotation/XmlElement.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -97,14 +97,15 @@ * @XmlElement(name="itemprice") * public java.math.BigDecimal price; * } - * - * <!-- Example: Local XML Schema element --> - * <xs:complexType name="USPrice"/> - * <xs:sequence> - * <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/> - * </sequence> - * </xs:complexType> - * + * {@code + * + * + * + * + * + * + * + * } *

* * Example 2: Map a field to a nillable element. @@ -115,14 +116,15 @@ * @XmlElement(nillable=true) * public java.math.BigDecimal price; * } - * - * <!-- Example: Local XML Schema element --> - * <xs:complexType name="USPrice"> - * <xs:sequence> - * <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/> - * </sequence> - * </xs:complexType> - * + * {@code + * + * + * + * + * + * + * + * } *

* Example 3: Map a field to a nillable, required element. *

@@ -132,14 +134,15 @@
  *         @XmlElement(nillable=true, required=true)
  *         public java.math.BigDecimal price;
  *     }
- *
- *     <!-- Example: Local XML Schema element -->
- *     <xs:complexType name="USPrice">
- *       <xs:sequence>
- *         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
- *       </sequence>
- *     </xs:complexType>
- *   
+ * {@code + * + * + * + * + * + * + * + * } * *

Example 4: Map a JavaBean property to an XML element * with anonymous type.

@@ -194,7 +197,7 @@ * the enclosing class. * *
  • - * Otherwise '' (which produces unqualified element in the default + * Otherwise {@literal ''} (which produces unqualified element in the default * namespace. * */ diff --git a/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java b/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java index 39284973..7ac275f5 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java +++ b/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -80,21 +80,22 @@ * JAXBElement<String> createFoo(String s) { ... } * } * - *
     
    - *     <!-- XML input -->
    - *       <foo>string</foo>
    + * 
     {@code
    + * 
    + *     
    + *     string
      *
      *     // Example: code fragment corresponding to XML input
    - *     JAXBElement<String> o =
    - *     (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
    + *     JAXBElement o =
    + *     (JAXBElement)unmarshaller.unmarshal(aboveDocument);
      *     // print JAXBElement instance to show values
      *     System.out.println(o.getName());   // prints  "{}foo"
      *     System.out.println(o.getValue());  // prints  "string"
      *     System.out.println(o.getValue().getClass()); // prints "java.lang.String"
      *
    - *     <!-- Example: XML schema definition -->
    - *     <xs:element name="foo" type="xs:string"/>
    - * 
    + * + * + * }
    * *

    Example 2: Element declaration with non local scope *

    @@ -105,18 +106,18 @@ * The following example may be replaced in a future revision of * this javadoc. * - *

    - *     <!-- Example: XML schema definition -->
    - *     <xs:schema>
    - *       <xs:complexType name="pea">
    - *         <xs:choice maxOccurs="unbounded">
    - *           <xs:element name="foo" type="xs:string"/>
    - *           <xs:element name="bar" type="xs:string"/>
    - *         </xs:choice>
    - *       </xs:complexType>
    - *       <xs:element name="foo" type="xs:int"/>
    - *     </xs:schema>
    - * 
    + *
    {@code
    + *     
    + *     
    + *       
    + *         
    + *           
    + *           
    + *         
    + *       
    + *       
    + *     
    + * }
    *
      *     // Example: expected default binding
      *     class Pea {
    diff --git a/src/main/java/javax/xml/bind/annotation/XmlElementRef.java b/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
    index 9501852d..e6e5803e 100644
    --- a/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
    +++ b/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
    @@ -1,7 +1,7 @@
     /*
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
      *
    - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved.
      *
      * The contents of this file are subject to the terms of either the GNU
      * General Public License Version 2 only ("GPL") or the Common Development
    @@ -71,10 +71,10 @@
      * support for substitution groups using an element property,
      * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
      * element property method signature is of the form:
    - * 
    - *     public void setTerm(JAXBElement<? extends Operator>);
    - *     public JAXBElement<? extends Operator> getTerm();
    - * 
    + *
    {@code
    + *     public void setTerm(JAXBElement);
    + *     public JAXBElement getTerm();
    + * }
    *

    * An element factory method annotated with {@link XmlElementDecl} is * used to create a JAXBElement instance, containing an XML @@ -136,19 +136,20 @@ * class JavacTask extends Task { * ... * } + * {@code + * + * + * + * + * + * + * + * + * + * + * * - * <!-- 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> - * - *

    + * } *

    * Thus the following code fragment: *

    @@ -158,16 +159,16 @@
      *     marshal(target);
      * 
    * will produce the following XML output: - *
    - *     <target>
    - *       <jar>
    + * 
    {@code
    + *     
    + *       
      *         ....
    - *       </jar>
    - *       <javac>
    + *       
    + *       
      *         ....
    - *       </javac>
    - *     </target>
    - * 
    + * + * + * }
    *

    * It is not an error to have a class that extends Task * that doesn't have {@link XmlRootElement}. But they can't show up in an @@ -222,11 +223,11 @@ * marshal(m); * * will produce the following XML output: - *

    - *     <math>
    - *       <add>...</add>
    - *     </math>
    - * 
    + *
    {@code
    + *     
    + *       ...
    + *     
    + * }
    * * * @author
    • Kohsuke Kawaguchi, Sun Microsystems,Inc.
    • Sekhar Vajjhala, Sun Microsystems, Inc.
    diff --git a/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java b/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java index 988df6fe..dca2d84f 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java +++ b/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -54,21 +54,21 @@ * XML element around collections. The annotation therefore supports * two forms of serialization shown below. * - *
    + * 
    {@code
      *    //Example: code fragment
      *      int[] names;
      *
      *    // XML Serialization Form 1 (Unwrapped collection)
    - *    <names> ... </names>
    - *    <names> ... </names>
    + *     ... 
    + *     ... 
      * 
      *    // XML Serialization Form 2 ( Wrapped collection )
    - *    <wrapperElement>
    - *       <names> value-of-item </names>
    - *       <names> value-of-item </names>
    + *    
    + *        value-of-item 
    + *        value-of-item 
      *       ....
    - *    </wrapperElement>
    - * 
    + * + * }
    * *

    The two serialized XML forms allow a null collection to be * represented either by absence or presence of an element with a diff --git a/src/main/java/javax/xml/bind/annotation/XmlElements.java b/src/main/java/javax/xml/bind/annotation/XmlElements.java index 8da99384..b1098e96 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlElements.java +++ b/src/main/java/javax/xml/bind/annotation/XmlElements.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -59,7 +59,7 @@ * @XmlElements({ @XmlElement(...),@XmlElement(...) }) * * - *

    The @XmlElements annnotation can be used with the + *

    The @XmlElements annotation can be used with the * following program elements:

    *
      *
    • a JavaBean property
    • @@ -93,28 +93,29 @@ * @XmlElements( * @XmlElement(name="A", type=Integer.class), * @XmlElement(name="B", type=Float.class) - * } + * ) * public List items; * } - * - * <!-- XML Representation for a List of {1,2.5} - * XML output is not wrapped using another element --> + * {@code + * + * * ... - * <A> 1 </A> - * <B> 2.5 </B> + * 1 + * 2.5 * ... * - * <!-- 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> + * + * + * + * + * + * + * + * + * * - * + * } * *

      Example 2: Map to a list of elements wrapped with another element *

      @@ -129,21 +130,22 @@ * } * 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> - * + * {@code + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * *

      Example 3: Change element name based on type using an adapter. *

      @@ -160,21 +162,22 @@ * @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> - * + * {@code + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * * @author
      • Kohsuke Kawaguchi, Sun Microsystems, Inc.
      • Sekhar Vajjhala, Sun Microsystems, Inc.
      * @see XmlElement diff --git a/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java b/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java index e9e11428..4afa8724 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java +++ b/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -71,23 +71,24 @@ *

      In the absence of this annotation, {@link Enum#name()} is used * as the XML representation. * - *

      Example 1: Map enum constant name -> enumeration facet

      + *

      Example 1: Map enum constant name {@literal ->} enumeration facet

      *
        *     //Example: Code fragment
        *     @XmlEnum(String.class)
        *     public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }
      - *
      - *     <!-- Example: XML Schema fragment -->
      - *     <xs:simpleType name="Card">
      - *       <xs:restriction base="xs:string"/>
      - *         <xs:enumeration value="CLUBS"/>
      - *         <xs:enumeration value="DIAMONDS"/>
      - *         <xs:enumeration value="HEARTS"/>
      - *         <xs:enumeration value="SPADES"/>
      - *     </xs:simpleType>
      - * 
      - * - *

      Example 2: Map enum constant name(value) -> enumeration facet

      + * {@code + * + * + * + * + * + * + * + * + * + * } + * + *

      Example 2: Map enum constant name(value) {@literal ->} enumeration facet

      *
        *     //Example: code fragment
        *     @XmlType
      @@ -97,19 +98,20 @@
        *         @XmlEnumValue("5") NICKEL(5),
        *         @XmlEnumValue("10") DIME(10),
        *         @XmlEnumValue("25") QUARTER(25) }
      - *
      - *     <!-- Example: XML Schema fragment -->
      - *     <xs:simpleType name="Coin">
      - *       <xs:restriction base="xs:int">
      - *         <xs:enumeration value="1"/>
      - *         <xs:enumeration value="5"/>
      - *         <xs:enumeration value="10"/>
      - *         <xs:enumeration value="25"/>
      - *       </xs:restriction>
      - *     </xs:simpleType>
      - * 
      - * - *

      Example 3: Map enum constant name -> enumeration facet

      + * {@code + * + * + * + * + * + * + * + * + * + * + * } + * + *

      Example 3: Map enum constant name {@literal ->} enumeration facet

      * *
        *     //Code fragment
      @@ -119,15 +121,16 @@
        *         @XmlEnumValue("1") ONE,
        *         @XmlEnumValue("2") TWO;
        *     }
      + * {@code
        * 
      - *     <!-- Example: XML Schema fragment -->
      - *     <xs:simpleType name="Code">
      - *       <xs:restriction base="xs:int">
      - *         <xs:enumeration value="1"/>
      - *         <xs:enumeration value="2"/>
      - *       </xs:restriction>
      - *     </xs:simpleType>
      - * 
      + * + * + * + * + * + * + * + * } * * @since 1.6, JAXB 2.0 */ diff --git a/src/main/java/javax/xml/bind/annotation/XmlID.java b/src/main/java/javax/xml/bind/annotation/XmlID.java index 0cfdec68..363155ee 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlID.java +++ b/src/main/java/javax/xml/bind/annotation/XmlID.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -88,17 +88,18 @@ * public void setCustomerID(String id); * .... other properties not shown * } - * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="Customer"> - * <xs:complexContent> - * <xs:sequence> + * {@code + * + * + * + * + * * .... - * </xs:sequence> - * <xs:attribute name="customerID" type="xs:ID"/> - * </xs:complexContent> - * </xs:complexType> - * + * + * + * + * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlIDREF diff --git a/src/main/java/javax/xml/bind/annotation/XmlIDREF.java b/src/main/java/javax/xml/bind/annotation/XmlIDREF.java index 5572aa4c..8ce782e3 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlIDREF.java +++ b/src/main/java/javax/xml/bind/annotation/XmlIDREF.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -52,7 +52,7 @@ *

      * To preserve referential integrity of an object graph across XML * serialization followed by a XML deserialization, requires an object - * reference to be marshalled by reference or containment + * reference to be marshaled by reference or containment * appropriately. Annotations @XmlID and @XmlIDREF * together allow a customized mapping of a JavaBean property's * type by containment or reference. @@ -97,18 +97,19 @@ * public void setCustomer(Customer customer); * .... * } - * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="Shipping"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:IDREF"/> + * {@code + * + * + * + * + * + * * .... - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> + * + * + * * - * + * } * * *

      Example 2: The following is a complete example of @@ -157,64 +158,65 @@ * // maps reference to Invoice by containment by default. * public Invoice getInvoice(); * } + * {@code + * + * * - * <!-- XML Schema mapping for above code frament --> - * - * <xs:complexType name="Invoice"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:IDREF"/> + * + * + * + * * .... - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> - * - * <xs:complexType name="Shipping"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:IDREF"/> + * + * + * + * + * + * + * + * * .... - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> + * + * + * * - * <xs:complexType name="Customer"> - * <xs:complexContent> - * <xs:sequence> + * + * + * * .... - * </xs:sequence> - * <xs:attribute name="CustomerID" type="xs:ID"/> - * </xs:complexContent> - * </xs:complexType> - * - * <xs:complexType name="CustomerData"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:Customer"/> - * <xs:element name="shipping" type="xs:Shipping"/> - * <xs:element name="invoice" type="xs:Invoice"/> - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> - * - * <xs:element name"customerData" type="xs:CustomerData"/> - * - * <!-- Instance document conforming to the above XML Schema --> - * <customerData> - * <customer customerID="Alice"> + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * .... - * </customer> + * * - * <shipping customer="Alice"> + * * .... - * </shipping> + * * - * <invoice customer="Alice"> + * * .... - * </invoice> - * </customerData> + * + * * - * + * } * *

      Example 3: Mapping List to repeating element of type IDREF *

      @@ -224,16 +226,17 @@
        *         @XmlElement(name="Alice")
        *             public List customers;
        *     }
      - *
      - *     <!-- XML schema fragment -->
      - *     <xs:complexType name="Shipping">
      - *       <xs:sequence>
      - *         <xs:choice minOccurs="0" maxOccurs="unbounded">
      - *           <xs:element name="Alice" type="xs:IDREF"/>
      - *         </xs:choice>
      - *       </xs:sequence>
      - *     </xs:complexType>
      - * 
      + * {@code + * + * + * + * + * + * + * + * + * + * } * *

      Example 4: Mapping a List to a list of elements of type IDREF. *

      @@ -245,17 +248,18 @@
        *              @XmlElement(name="John", type="InternationalCustomer.class")
        *         public List customers;
        *     }
      - *
      - *     <!-- XML Schema fragment -->
      - *     <xs:complexType name="Shipping">
      - *       <xs:sequence>
      - *         <xs:choice minOccurs="0" maxOccurs="unbounded">
      - *           <xs:element name="Alice" type="xs:IDREF"/>
      - *           <xs:element name="John" type="xs:IDREF"/>
      - *         </xs:choice>
      - *       </xs:sequence>
      - *     </xs:complexType>
      - * 
      + * {@code + * + * + * + * + * + * + * + * + * + * + * } * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlID * @since 1.6, JAXB 2.0 diff --git a/src/main/java/javax/xml/bind/annotation/XmlList.java b/src/main/java/javax/xml/bind/annotation/XmlList.java index a87021f6..f551256d 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlList.java +++ b/src/main/java/javax/xml/bind/annotation/XmlList.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -74,12 +74,12 @@ * * would produce XML like this: * - *
      - * <foo>
      - *   <data>abc</data>
      - *   <data>def</data>
      - * </foo>
      - * 
      + *
      {@code
      + * 
      + *   abc
      + *   def
      + * 
      + * }
      * * @XmlList annotation, on the other hand, allows multiple values to be * represented as whitespace-separated tokens in a single element. For example, @@ -95,11 +95,11 @@ * * the above code will produce XML like this: * - *
      - * <foo>
      - *   <data>abc def</data>
      - * </foo>
      - * 
      + *
      {@code
      + * 
      + *   abc def
      + * 
      + * }
      * *

      This annotation can be used with the following annotations: * {@link XmlElement}, diff --git a/src/main/java/javax/xml/bind/annotation/XmlMixed.java b/src/main/java/javax/xml/bind/annotation/XmlMixed.java index 987c2832..2a04637d 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlMixed.java +++ b/src/main/java/javax/xml/bind/annotation/XmlMixed.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -71,32 +71,33 @@ *

    * * Below is an example of binding and creation of mixed content. - *
    - *  <!-- schema fragment having  mixed content -->
    - *  <xs:complexType name="letterBody" mixed="true">
    - *    <xs:sequence>
    - *	<xs:element name="name" type="xs:string"/>
    - *	<xs:element name="quantity" type="xs:positiveInteger"/>
    - *	<xs:element name="productName" type="xs:string"/>
    - *	<!-- etc. -->
    - *    </xs:sequence>
    - *  </xs:complexType>
    - *  <xs:element name="letterBody" type="letterBody"/>
    + * 
    {@code
    + * 
    + *  
    + *  
    + *    
    + *	
    + *	
    + *	
    + *	
    + *    
    + *  
    + *  
      * 
      * // Schema-derived Java code: 
      * // (Only annotations relevant to mixed content are shown below, 
    - * //  others are ommitted.)
    + * //  others are omitted.)
      * import java.math.BigInteger;
      * public class ObjectFactory {
      * 	// element instance factories
    - * 	JAXBElement<LetterBody> createLetterBody(LetterBody value);
    - * 	JAXBElement<String>     createLetterBodyName(String value);
    - * 	JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
    - * 	JAXBElement<String>     createLetterBodyProductName(String value);
    + * 	JAXBElement createLetterBody(LetterBody value);
    + * 	JAXBElement     createLetterBodyName(String value);
    + * 	JAXBElement createLetterBodyQuantity(BigInteger value);
    + * 	JAXBElement     createLetterBodyProductName(String value);
      *      // type instance factory
      * 	LetterBody createLetterBody();
      * }
    - * 
    + * }
    *
      * public class LetterBody {
      * 	// Mixed content can contain instances of Element classes
    @@ -111,17 +112,17 @@
      * }
      * 
    * The following is an XML instance document with mixed content - *
    - * <letterBody>
    - * Dear Mr.<name>Robert Smith</name>
    - * Your order of <quantity>1</quantity> <productName>Baby
    - * Monitor</productName> shipped from our warehouse. ....
    - * </letterBody>
    - * 
    + *
    {@code
    + * 
    + * Dear Mr.Robert Smith
    + * Your order of 1 Baby
    + * Monitor shipped from our warehouse. ....
    + * 
    + * }
    * that can be constructed using following JAXB API calls. - *
    + * 
    {@code
      * LetterBody lb = ObjectFactory.createLetterBody();
    - * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
    + * JAXBElement lbe = ObjectFactory.createLetterBody(lb);
      * List gcl = lb.getContent();  //add mixed content to general content property.
      * gcl.add("Dear Mr.");  // add text information item as a String.
      * 
    @@ -134,7 +135,7 @@
      * 	 		createLetterBodyQuantity(new BigInteger("1")));
      * gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));
      * gcl.add("shipped from our warehouse");  // add text information item
    - * 
    + * }
    * *

    See "Package Specification" in javax.xml.bind.package javadoc for * additional common information.

    diff --git a/src/main/java/javax/xml/bind/annotation/XmlRootElement.java b/src/main/java/javax/xml/bind/annotation/XmlRootElement.java index e4304c08..a2abc5c8 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlRootElement.java +++ b/src/main/java/javax/xml/bind/annotation/XmlRootElement.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -88,28 +88,30 @@ * marshal( new Point(3,5), System.out); * * - *
    - *     <!-- Example: XML output -->
    - *     <point>
    - *       <x> 3 </x>
    - *       <y> 5 </y>
    - *     </point>
    - * 
    + *
    {@code
    + * 
    + *     
    + *     
    + *        3 
    + *        5 
    + *     
    + * }
    * * The annotation causes an global element declaration to be produced * in the schema. The global element declaration is associated with * the XML schema type to which the class is mapped. * - *
    - *     <!-- Example: XML schema definition -->
    - *     <xs:element name="point" type="point"/>
    - *     <xs:complexType name="point">
    - *       <xs:sequence>
    - *         <xs:element name="x" type="xs:int"/>
    - *         <xs:element name="y" type="xs:int"/>
    - *       </xs:sequence>
    - *     </xs:complexType>
    - * 
    + *
    {@code
    + * 
    + *     
    + *     
    + *     
    + *       
    + *         
    + *         
    + *       
    + *     
    + * }
    * *

    * @@ -128,27 +130,28 @@ * * //Example: Code fragment corresponding to XML output * * marshal( new Point3D(3,5,0), System.out ); - * - * <!-- Example: XML output --> - * <!-- The element name is point3D not point --> - * <point3D> - * <x>3</x> - * <y>5</y> - * <z>0</z> - * </point3D> - * - * <!-- Example: XML schema definition --> - * <xs:element name="point3D" type="point3D"/> - * <xs:complexType name="point3D"> - * <xs:complexContent> - * <xs:extension base="point"> - * <xs:sequence> - * <xs:element name="z" type="xs:int"/> - * </xs:sequence> - * </xs:extension> - * </xs:complexContent> - * </xs:complexType> - * + * {@code + * + * + * + * + * 3 + * 5 + * 0 + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * * Example 3: Associate a global element with XML Schema type * to which the class is mapped. @@ -159,15 +162,16 @@ * @XmlElement * public java.math.BigDecimal price; * } - * - * <!-- Example: XML schema definition --> - * <xs:element name="PriceElement" type="USPrice"/> - * <xs:complexType name="USPrice"> - * <xs:sequence> - * <xs:element name="price" type="xs:decimal"/> - * </sequence> - * </xs:complexType> - * + * {@code + * + * + * + * + * + * + * + * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @since 1.6, JAXB 2.0 diff --git a/src/main/java/javax/xml/bind/annotation/XmlSchema.java b/src/main/java/javax/xml/bind/annotation/XmlSchema.java index de09abf3..26e7619a 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlSchema.java +++ b/src/main/java/javax/xml/bind/annotation/XmlSchema.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -78,16 +78,17 @@ * @javax.xml.bind.annotation.XmlSchema ( * namespace = "http://www.example.com/MYPO1" * ) - * - * <!-- XML Schema fragment --> - * <schema + * {@code + * + * + * + * > + * + * } * *

    Example 2: Customize namespace prefix, namespace URI * mapping

    @@ -101,16 +102,17 @@ * * @javax.xml.bind.annotation.XmlNs(prefix="xs", * namespaceURI="http://www.w3.org/2001/XMLSchema") - * ) + * } * ) + * {@code * - * <!-- XML Schema fragment --> - * <schema + * + * * - * + * } * *

    Example 3: Customize elementFormDefault

    *
    @@ -118,14 +120,15 @@
      *      elementFormDefault=XmlNsForm.UNQUALIFIED
      *      ...
      *    )
    + * {@code
      * 
    - *    <!-- XML Schema fragment -->
    - *    <schema
    + *    
    + *    
      * 
    - * 
    + * } * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @since 1.6, JAXB 2.0 diff --git a/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java b/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java index 17271b44..2d573c84 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java +++ b/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -80,14 +80,15 @@ * @XmlSchemaType(name="date") * public XMLGregorianCalendar date; * } + * {@code * - * <!-- Example: Local XML Schema element --> - * <xs:complexType name="USPrice"/> - * <xs:sequence> - * <xs:element name="date" type="xs:date"/> - * </sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * } * *

    Example 2: Customize mapping of XMLGregorianCalendar at package * level

    diff --git a/src/main/java/javax/xml/bind/annotation/XmlTransient.java b/src/main/java/javax/xml/bind/annotation/XmlTransient.java index c613c931..0d28bf8a 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlTransient.java +++ b/src/main/java/javax/xml/bind/annotation/XmlTransient.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -93,14 +93,15 @@ * String setName() {..}; * } * - * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="USAddress"> - * <xs:sequence> - * <xs:element name="name" type="xs:string"/> - * </xs:sequence> - * </xs:complexType> - * + * {@code + * + * + * + * + * + * + * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @since 1.6, JAXB 2.0 diff --git a/src/main/java/javax/xml/bind/annotation/XmlType.java b/src/main/java/javax/xml/bind/annotation/XmlType.java index fce7cbd4..99ecca18 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlType.java +++ b/src/main/java/javax/xml/bind/annotation/XmlType.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -127,7 +127,7 @@ * The following table shows the mapping of the class to a XML Schema * complex type or simple type. The notational symbols used in the table are: *
      - *
    • -> : represents a mapping
    • + *
    • {@literal ->} : represents a mapping
    • *
    • [x]+ : one or more occurances of x
    • *
    • [ @XmlValue property ]: JavaBean property annotated with * @XmlValue
    • @@ -147,7 +147,7 @@ * * Class * {} - * [property]+ -> elements + * [property]+ {@literal ->} elements * complexcontent
      xs:all * * @@ -155,7 +155,7 @@ * * Class * non empty - * [property]+ -> elements + * [property]+ {@literal ->} elements * complexcontent
      xs:sequence * * @@ -163,7 +163,7 @@ * * Class * X - * no property -> element + * no property {@literal ->} element * complexcontent
      empty sequence * * @@ -171,7 +171,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
      [property]+ -> attributes + * 1 [@XmlValue property] {@literal &&}
      [property]+ {@literal ->} attributes * simplecontent * * @@ -179,7 +179,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
      no properties -> attribute + * 1 [@XmlValue property] {@literal &&}
      no properties {@literal ->} attribute * * simpletype * @@ -223,35 +223,37 @@ * java.math.BigDecimal getZip() {..}; * void setZip(java.math.BigDecimal) {..}; * } - * - * <!-- XML Schema mapping for USAddress --> - * <xs:complexType name="USAddress"> - * <xs:sequence> - * <xs:element name="street" type="xs:string"/> - * <xs:element name="city" type="xs:string"/> - * <xs:element name="state" type="xs:string"/> - * <xs:element name="zip" type="xs:decimal"/> - * <xs:element name="name" type="xs:string"/> - * </xs:all> - * </xs:complexType> - * + * {@code + * + * + * + * + * + * + * + * + * + * + * + * } *

      Example 2: Map a class to a complex type with * xs:all

      *
        * @XmlType(propOrder={})
        * public class USAddress { ...}
      + * {@code
        * 
      - * <!-- XML Schema mapping for USAddress -->
      - * <xs:complexType name="USAddress">
      - *   <xs:all>
      - *     <xs:element name="name" type="xs:string"/>
      - *     <xs:element name="street" type="xs:string"/>
      - *     <xs:element name="city" type="xs:string"/>
      - *     <xs:element name="state" type="xs:string"/>
      - *     <xs:element name="zip" type="xs:decimal"/>
      - *   </xs:sequence>
      - * </xs:complexType>
      - *
      + * + * + * + * + * + * + * + * + * + * + *} *

      Example 3: Map a class to a global element with an * anonymous type. *

      @@ -259,20 +261,21 @@ * @XmlRootElement * @XmlType(name="") * public class USAddress { ...} - * - * <!-- XML Schema mapping for USAddress --> - * <xs:element name="USAddress"> - * <xs:complexType> - * <xs:sequence> - * <xs:element name="name" type="xs:string"/> - * <xs:element name="street" type="xs:string"/> - * <xs:element name="city" type="xs:string"/> - * <xs:element name="state" type="xs:string"/> - * <xs:element name="zip" type="xs:decimal"/> - * </xs:sequence> - * </xs:complexType> - * </xs:element> - * + * {@code + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * *

      Example 4: Map a property to a local element with * anonymous type. @@ -286,22 +289,23 @@ * @XmlType(name="") * public class USAddress { ... } * } - * - * <!-- XML Schema mapping for USAddress --> - * <xs:complexType name="Invoice"> - * <xs:sequence> - * <xs:element name="addr"> - * <xs:complexType> - * <xs:element name="name", type="xs:string"/> - * <xs:element name="city", type="xs:string"/> - * <xs:element name="city" type="xs:string"/> - * <xs:element name="state" type="xs:string"/> - * <xs:element name="zip" type="xs:decimal"/> - * </xs:complexType> + * {@code + * + * + * + * + * + * + * + * + * + * + * + * * ... - * </xs:sequence> - * </xs:complexType> - * + * + * + * } * *

      Example 5: Map a property to an attribute with * anonymous type. @@ -321,19 +325,20 @@ * @XmlValue * public java.math.BigDecimal price; * } - * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="Item"> - * <xs:sequence> - * <xs:element name="name" type="xs:string"/> - * <xs:attribute name="price"> - * <xs:simpleType> - * <xs:restriction base="xs:decimal"/> - * </xs:simpleType> - * </xs:attribute> - * </xs:sequence> - * </xs:complexType> - * + * {@code + * + * + * + * + * + * + * + * + * + * + * + * + * } * *

      Example 6: Define a factoryClass and factoryMethod * diff --git a/src/main/java/javax/xml/bind/annotation/XmlValue.java b/src/main/java/javax/xml/bind/annotation/XmlValue.java index b8bdc33d..4dfa5762 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlValue.java +++ b/src/main/java/javax/xml/bind/annotation/XmlValue.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -102,13 +102,14 @@ * @XmlValue * public java.math.BigDecimal price; * } - * - * <!-- Example 1: XML Schema fragment --> - * <xs:simpleType name="USPrice"> - * <xs:restriction base="xs:decimal"/> - * </xs:simpleType> + * {@code + * + * + * + * + * * - * + * } * *

      Example 2: Map a class to XML Schema complexType with * with simpleContent.

      @@ -123,17 +124,18 @@ * @XmlAttribute * public String currency; * } - * - * <!-- Example 2: XML Schema fragment --> - * <xs:complexType name="InternationalPrice"> - * <xs:simpleContent> - * <xs:extension base="xs:decimal"> - * <xs:attribute name="currency" type="xs:string"/> - * </xs:extension> - * </xs:simpleContent> - * </xs:complexType> - * - * + * {@code + * + * + * + * + * + * + * + * + * + * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlType diff --git a/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java b/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java index d021318a..d457788f 100644 --- a/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java +++ b/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -47,7 +47,7 @@ * *

      * This adapter removes leading and trailing whitespaces, then truncate any - * sequnce of tab, CR, LF, and SP by a single whitespace character ' '. + * sequence of tab, CR, LF, and SP by a single whitespace character ' '. * * @author Kohsuke Kawaguchi * @since 1.6, JAXB 2.0 @@ -56,7 +56,7 @@ public class CollapsedStringAdapter extends XmlAdapter { /** * Removes leading and trailing whitespaces of the string * given as the parameter, then truncate any - * sequnce of tab, CR, LF, and SP by a single whitespace character ' '. + * sequence of tab, CR, LF, and SP by a single whitespace character ' '. */ public String unmarshal(String text) { if(text==null) return null; // be defensive diff --git a/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java b/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java index 303f2902..d3170974 100644 --- a/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java +++ b/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -90,35 +90,35 @@ * *

      Step 1: Determine the desired XML representation for HashMap. * - *

      - *     <hashmap>
      - *         <entry key="id123">this is a value</entry>
      - *         <entry key="id312">this is another value</entry>
      + * 
      {@code
      + *     
      + *         this is a value
      + *         this is another value
        *         ...
      - *       </hashmap>
      - * 
      + * + * }
      * *

      Step 2: Determine the schema definition that the * desired XML representation shown above should follow. * - *

      + * 
      {@code
        *     
      - *     <xs:complexType name="myHashMapType">
      - *       <xs:sequence>
      - *         <xs:element name="entry" type="myHashMapEntryType"
      - *                        minOccurs = "0" maxOccurs="unbounded"/>
      - *       </xs:sequence>
      - *     </xs:complexType>
      - *
      - *     <xs:complexType name="myHashMapEntryType">
      - *       <xs:simpleContent>
      - *         <xs:extension base="xs:string">
      - *           <xs:attribute name="key" type="xs:int"/>
      - *         </xs:extension>
      - *       </xs:simpleContent>
      - *     </xs:complexType>
      - *
      - * 
      + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * }
      * *

      Step 3: Write value types that can generate the above * schema definition. @@ -140,11 +140,11 @@ *

      Step 4: Write the adapter that adapts the value type, * MyHashMapType to a bound type, HashMap, used by the application. * - *

      + * 
      {@code
        *     public final class MyHashMapAdapter extends
      - *                        XmlAdapter<MyHashMapType,HashMap> { ... }
      + *                        XmlAdapter { ... }
        *      
      - * 
      + * }
      * *

      Step 5: Use the adapter. * @@ -158,13 +158,13 @@ * * The above code fragment will map to the following schema: * - *

      - *     <xs:complexType name="Foo">
      - *       <xs:sequence>
      - *         <xs:element name="hashmap" type="myHashMapType">
      - *       </xs:sequence>
      - *     </xs:complexType>
      - * 
      + *
      {@code
      + *     
      + *       
      + *         
      + *       
      + *     
      + * }
      * * @param * The type that JAXB doesn't know how to handle. An adapter is written diff --git a/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java b/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java index 37426ead..ecf0491c 100644 --- a/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java +++ b/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2004-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004-2015 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -57,7 +57,7 @@ * @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) }) * * - *

      The @XmlJavaTypeAdapters annnotation is useful for + *

      The @XmlJavaTypeAdapters annotation is useful for * defining {@link XmlJavaTypeAdapter} annotations for different types * at the package level. *