From e63ee00a04179bb51dbd7b5ad30986bae76c5ee1 Mon Sep 17 00:00:00 2001 From: Petros Splinakis Date: Mon, 23 Feb 2015 17:44:08 +0100 Subject: [PATCH 1/2] Replacing escaped characters with code blocks in Javadoc Signed-off-by: Petros Splinakis --- src/main/java/javax/xml/bind/JAXBContext.java | 16 +- .../java/javax/xml/bind/JAXBIntrospector.java | 6 +- src/main/java/javax/xml/bind/Marshaller.java | 6 +- .../javax/xml/bind/SchemaOutputResolver.java | 6 +- .../java/javax/xml/bind/Unmarshaller.java | 42 ++-- .../xml/bind/annotation/XmlAccessorType.java | 6 +- .../xml/bind/annotation/XmlAnyAttribute.java | 8 +- .../xml/bind/annotation/XmlAnyElement.java | 168 +++++++-------- .../xml/bind/annotation/XmlAttachmentRef.java | 32 +-- .../xml/bind/annotation/XmlAttribute.java | 48 ++--- .../javax/xml/bind/annotation/XmlElement.java | 58 +++--- .../xml/bind/annotation/XmlElementDecl.java | 74 +++---- .../xml/bind/annotation/XmlElementRef.java | 104 +++++----- .../bind/annotation/XmlElementWrapper.java | 18 +- .../xml/bind/annotation/XmlElements.java | 136 ++++++------- .../xml/bind/annotation/XmlEnumValue.java | 94 ++++----- .../java/javax/xml/bind/annotation/XmlID.java | 36 ++-- .../javax/xml/bind/annotation/XmlIDREF.java | 192 +++++++++--------- .../javax/xml/bind/annotation/XmlList.java | 40 ++-- .../javax/xml/bind/annotation/XmlMixed.java | 74 +++---- .../xml/bind/annotation/XmlRootElement.java | 108 +++++----- .../javax/xml/bind/annotation/XmlSchema.java | 50 ++--- .../xml/bind/annotation/XmlSchemaType.java | 24 +-- .../xml/bind/annotation/XmlSchemaTypes.java | 6 +- .../javax/xml/bind/annotation/XmlSeeAlso.java | 4 +- .../xml/bind/annotation/XmlTransient.java | 20 +- .../javax/xml/bind/annotation/XmlType.java | 168 +++++++-------- .../javax/xml/bind/annotation/XmlValue.java | 42 ++-- .../adapters/CollapsedStringAdapter.java | 6 +- .../bind/annotation/adapters/XmlAdapter.java | 78 +++---- .../adapters/XmlJavaTypeAdapters.java | 8 +- 31 files changed, 839 insertions(+), 839 deletions(-) diff --git a/src/main/java/javax/xml/bind/JAXBContext.java b/src/main/java/javax/xml/bind/JAXBContext.java index c0cfda9b..18234c3d 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">, + * {@code }, * 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 @@ -549,7 +549,7 @@ public static JAXBContext newInstance( String contextPath, ClassLoader classLoad * will recognize both Foo and Bar, but not Zot or FooBar: *

      * class Foo {
-     *      @XmlTransient FooBar c;
+     *      {@code @XmlTransient} FooBar c;
      *      Bar b;
      * }
      * class Bar { int x; }
diff --git a/src/main/java/javax/xml/bind/JAXBIntrospector.java b/src/main/java/javax/xml/bind/JAXBIntrospector.java
index 7a425240..83a2ce36 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
@@ -66,7 +66,7 @@ public abstract class JAXBIntrospector {
      * 
    *
  1. It is an instance of javax.xml.bind.JAXBElement.
  2. *
  3. The class of object is annotated with - * @XmlRootElement. + * @XmlRootElement. *
  4. *
* @@ -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/Marshaller.java b/src/main/java/javax/xml/bind/Marshaller.java index 0bf3abaf..b83e0c3f 100644 --- a/src/main/java/javax/xml/bind/Marshaller.java +++ b/src/main/java/javax/xml/bind/Marshaller.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 @@ -178,7 +178,7 @@ * and pass the wrapper element as the first parameter to * a Marshaller.marshal method. For java to schema binding, it * is also possible to simply annotate the instance's class with - * @{@link XmlRootElement}. + * {@code @}{@link XmlRootElement}. * * *

@@ -679,7 +679,7 @@ public ValidationEventHandler getEventHandler() * *

* Every marshaller internally maintains a - * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>, + * {@link java.util.Map}{@code <}{@link Class},{@link XmlAdapter}{@code >}, * which it uses for marshalling classes whose fields/methods are annotated * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}. * diff --git a/src/main/java/javax/xml/bind/SchemaOutputResolver.java b/src/main/java/javax/xml/bind/SchemaOutputResolver.java index e2501287..6ceab17d 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 {@code } 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. + * {@code }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..dc16fec9 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 {@code 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); + * }
*
* *

@@ -1024,7 +1024,7 @@ public void setProperty( String name, Object value ) * *

* Every unmarshaller internally maintains a - * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>, + * {@link java.util.Map}{@code <}{@link Class},{@link XmlAdapter}{@code >}, * which it uses for unmarshalling classes whose fields/methods are annotated * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}. * diff --git a/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java b/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java index c3210153..c6f8c16e 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2013 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 @@ -83,14 +83,14 @@ *

By default, if @XmlAccessorType on a package is absent, * then the following package level annotation is assumed.

*
- *   @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ *   {@code @XmlAccessorType}(XmlAccessType.PUBLIC_MEMBER)
  * 
*

By default, if @XmlAccessorType on a class is absent, * and none of its super classes is annotated with * @XmlAccessorType, then the following default on the class * is assumed:

*
- *   @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ *   {@code @XmlAccessorType}(XmlAccessType.PUBLIC_MEMBER)
  * 
*

This annotation can be used with the following annotations: * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder}, diff --git a/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java b/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java index 8a2de0ba..63baf356 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.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 @@ -55,7 +55,7 @@ * *

Usage

*

- * The @XmlAnyAttribute annotation can be used with the + * The {@code @XmlAnyAttribute} annotation can be used with the * following program elements: *

    *
  • JavaBean property
  • @@ -68,7 +68,7 @@ * The usage is subject to the following constraints: *
      *
    • At most one field or property in a class can be annotated - * with @XmlAnyAttribute.
    • + * with {@code @XmlAnyAttribute}. *
    • The type of the property or the field must java.util.Map
    • *
    * @@ -77,7 +77,7 @@ * each attribute that is not statically associated with another * JavaBean property, via {@link XmlAttribute}, is entered into the * wildcard attribute map represented by - * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the + * {@link Map}{@code <}{@link QName},{@link Object}{@code >}. The attribute QName is the * map's key. The key's value is the String value of the attribute. * * @author Kohsuke Kawaguchi, Sun Microsystems, Inc. diff --git a/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java b/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java index 5c965534..6e38a387 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 @@ -61,23 +61,23 @@ * xml content into a instance of a JAXB annotated class. It typically * annotates a multi-valued JavaBean property, but it can occur on * single value JavaBean property. During unmarshalling, each xml element - * that does not match a static @XmlElement or @XmlElementRef + * that does not match a static {@code @XmlElement} or {@code @XmlElementRef} * annotation for the other JavaBean properties on the class, is added to this * "catch-all" property. * *

    Usages:

    *
    - * @XmlAnyElement
    + * {@code @XmlAnyElement}
      * public {@link Element}[] others;
      * 
      * // Collection of {@link Element} or JAXB elements.
    - * @XmlAnyElement(lax="true")
    + * {@code @XmlAnyElement}(lax="true")
      * public {@link Object}[] others;
      *
    - * @XmlAnyElement
    - * private List<{@link Element}> nodes;
    + * {@code @XmlAnyElement}
    + * private List{@code <}{@link Element}{@code >} nodes;
      *
    - * @XmlAnyElement
    + * {@code @XmlAnyElement}
      * private {@link Element} node;
      * 
    * @@ -101,59 +101,59 @@ * This annotation can be used with {@link XmlMixed} like this: *
      * // List of java.lang.String or DOM nodes.
    - * @XmlAnyElement @XmlMixed
    - * List<Object> others;
    + * {@code @XmlAnyElement} {@code @XmlMixed}
    + * {@code List} others;
      * 
      *
      *
      * 

    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 {
      *   int a;
      *   int b;
    - *   @{@link XmlAnyElement}
    - *   List<Element> any;
    + *   {@code @}{@link XmlAnyElement}
    + *   {@code List} any;
      * }
      * 
    * * 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,45 +186,45 @@ * *

    * 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 {
    - *   @{@link XmlAnyElement}(lax="true")
    - *   @{@link XmlElementRefs}({
    - *     @{@link XmlElementRef}(name="a", type="JAXBElement.class")
    - *     @{@link XmlElementRef}(name="b", type="JAXBElement.class")
    + *   {@code @}{@link XmlAnyElement}(lax="true")
    + *   {@code @}{@link XmlElementRefs}({
    + *     {@code @}{@link XmlElementRef}(name="a", type="JAXBElement.class")
    + *     {@code @}{@link XmlElementRef}(name="b", type="JAXBElement.class")
      *   })
    - *   {@link List}<{@link Object}> others;
    + *   {@link List}{@code <}{@link Object}{@code >} others;
      * }
      *
    - * @XmlRegistry
    + * {@code @XmlRegistry}
      * class ObjectFactory {
      *   ...
    - *   @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
    - *   {@link JAXBElement}<Integer> createFooA( Integer i ) { ... }
    + *   {@code @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)}
    + *   {@link JAXBElement}{@code } createFooA( Integer i ) { ... }
      *
    - *   @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
    - *   {@link JAXBElement}<Integer> createFooB( Integer i ) { ... }
    + *   {@code @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)}
    + *   {@link JAXBElement}{@code } createFooB( Integer i ) { ... }
      * 
    * * 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
    + * 
    + *   1     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
    + *     // this will unmarshal to a DOM {@link Element}.
    + *   3     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
    + * 
    + * }
    * * * @@ -233,18 +233,18 @@ * The lax element of the annotation enables the emulation of the "lax" wildcard semantics. * For example, when the Java source code is annotated like this: *
    - * @{@link XmlRootElement}
    + * {@code @}{@link XmlRootElement}
      * class Foo {
    - *   @XmlAnyElement(lax=true)
    + *   {@code @XmlAnyElement(lax=true)}
      *   public {@link Object}[] others;
      * }
      * 
    * 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..99217420 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 @@ -54,28 +54,28 @@ * *

    Usage

    *
    - * @{@link XmlRootElement}
    + * {@code @}{@link XmlRootElement}
      * class Foo {
    - *   @{@link XmlAttachmentRef}
    - *   @{@link XmlAttribute}
    + *   {@code @}{@link XmlAttachmentRef}
    + *   {@code @}{@link XmlAttribute}
      *   {@link DataHandler} data;
      *
    - *   @{@link XmlAttachmentRef}
    - *   @{@link XmlElement}
    + *   {@code @}{@link XmlAttachmentRef}
    + *   {@code @}{@link XmlElement}
      *   {@link DataHandler} body;
      * }
      * 
    * 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..ad0ad481 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 @@ -71,8 +71,8 @@ * simple type. *

      *     // Examples
    - *     @XmlAttribute List<Integer> items; //legal
    - *     @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
    + *     {@code @XmlAttribute List} items; //legal
    + *     {@code @XmlAttribute List} foo; // illegal if Bar does not map to a schema simple type
      * 
    * *
  • If the type of the field or the property is a non @@ -80,8 +80,8 @@ * must map to a simple schema type. *
      *     // Examples
    - *     @XmlAttribute int foo; // legal
    - *     @XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
    + *     {@code @}XmlAttribute int foo; // legal
    + *     {@code @}XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
      * 
    *
  • *
  • This annotation can be used with the following annotations: @@ -100,18 +100,18 @@ *
      *     //Example: Code fragment
      *     public class USPrice { 
    - *         @XmlAttribute
    + *         {@code @}XmlAttribute
      *         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}. @@ -121,19 +121,19 @@ * // Example: Code fragment * class Foo { * ... - * @XmlAttribute List<Integer> items; + * {@code @XmlAttribute List} 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..48b5cb7f 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 @@ -94,17 +94,17 @@ *
      *     //Example: Code fragment
      *     public class USPrice {
    - *         @XmlElement(name="itemprice")
    + *         {@code @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. @@ -112,34 +112,34 @@ * * //Example: Code fragment * public class USPrice { - * @XmlElement(nillable=true) + * {@code @}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. *

      *
      *     //Example: Code fragment
      *     public class USPrice {
    - *         @XmlElement(nillable=true, required=true)
    + *         {@code @}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 +194,7 @@ * the enclosing class. * *
  • - * Otherwise '' (which produces unqualified element in the default + * Otherwise {@code ''} (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..0bda3e5c 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 @@ -58,14 +58,14 @@ * (and annotated) from a schema into the ObjectFactory class in a * Java package that represents the binding of the element * declaration's target namespace. Thus, while the annotation syntax - * allows @XmlElementDecl to be used on any method, semantically + * allows {@code @XmlElementDecl} to be used on any method, semantically * its use is restricted to annotation of element factory method. * * The usage is subject to the following constraints: * *
      *
    • The class containing the element factory method annotated - * with @XmlElementDecl must be marked with {@link + * with {@code @XmlElementDecl} must be marked with {@link * XmlRegistry}.
    • *
    • The element factory method must take one parameter * assignable to {@link Object}.
    • @@ -74,27 +74,27 @@ *

      Example 1: Annotation on a factory method *

        *     // Example: code fragment
      - *     @XmlRegistry
      + *     {@code @XmlRegistry}
        *     class ObjectFactory {
      - *         @XmlElementDecl(name="foo")
      - *         JAXBElement<String> createFoo(String s) { ... }
      + *         {@code @XmlElementDecl(name="foo")}
      + *         {@code JAXBElement} 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,38 +105,38 @@ * 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 {
      - *         @XmlElementRefs({
      - *             @XmlElementRef(name="foo",type=JAXBElement.class)
      - *             @XmlElementRef(name="bar",type=JAXBElement.class)
      + *         {@code @XmlElementRefs}({
      + *             {@code @XmlElementRef}(name="foo",type=JAXBElement.class)
      + *             {@code @XmlElementRef}(name="bar",type=JAXBElement.class)
        *         })
      - *         List<JAXBElement<String>> fooOrBar;
      + *         {@code List>} fooOrBar;
        *     }
        * 
      - *     @XmlRegistry
      + *     {@code @XmlRegistry}
        *     class ObjectFactory {
      - *         @XmlElementDecl(scope=Pea.class,name="foo")
      - *         JAXBElement<String> createPeaFoo(String s);
      + *         {@code @XmlElementDecl}(scope=Pea.class,name="foo")
      + *         {@code JAXBElement} createPeaFoo(String s);
        * 
      - *         @XmlElementDecl(scope=Pea.class,name="bar")
      - *         JAXBElement<String> createPeaBar(String s);
      + *         {@code @XmlElementDecl}(scope=Pea.class,name="bar")
      + *         {@code JAXBElement} createPeaBar(String s);
        * 
      - *         @XmlElementDecl(name="foo")
      - *         JAXBElement<Integer> createFoo(Integer i);
      + *         {@code @XmlElementDecl}(name="foo")
      + *         {@code JAXBElement} createFoo(Integer i);
        *     }
        * 
        * 
      diff --git a/src/main/java/javax/xml/bind/annotation/XmlElementRef.java b/src/main/java/javax/xml/bind/annotation/XmlElementRef.java index 9501852d..63410801 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 @@ -54,7 +54,7 @@ *

      * Usage *

      - * @XmlElementRef annotation can be used with a + * @XmlElementRef annotation can be used with a * JavaBean property or from within {@link XmlElementRefs} *

      * This annotation dynamically associates an XML element name with the JavaBean @@ -71,14 +71,14 @@ * 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 - * element name. The presence of @XmlElementRef annotation on an + * element name. The presence of {@code @XmlElementRef} annotation on an * element property indicates that the element name from JAXBElement * instance be used instead of deriving an XML element name from the * JavaBean property name. @@ -89,7 +89,7 @@ *

    • If the collection item type (for collection property) or * property type (for single valued property) is * {@link javax.xml.bind.JAXBElement}, then - * @XmlElementRef}.name() and @XmlElementRef.namespace() must + * @XmlElementRef.name() and @XmlElementRef.namespace() must * point an element factory method with an @XmlElementDecl * annotation in a class annotated with @XmlRegistry (usually * ObjectFactory class generated by the schema compiler) : @@ -113,42 +113,42 @@ * The following Java class hierarchy models an Ant build * script. An Ant task corresponds to a class in the class * hierarchy. The XML element name of an Ant task is indicated by the - * @XmlRootElement annotation on its corresponding class. + * {@code @XmlRootElement} annotation on its corresponding class. *
      - *     @XmlRootElement(name="target")
      + *     {@code @XmlRootElement}(name="target")
        *     class Target {
      - *         // The presence of @XmlElementRef indicates that the XML
      - *         // element name will be derived from the @XmlRootElement 
      + *         // 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;
      + *         {@code @XmlElementRef}
      + *         {@code List} tasks;
        *     }
        *
        *     abstract class Task {
        *     }
        *
      - *     @XmlRootElement(name="jar")
      + *     {@code @XmlRootElement}(name="jar")
        *     class JarTask extends Task {
        *         ...
        *     }
        *
      - *     @XmlRootElement(name="javac")
      + *     {@code @XmlRootElement}(name="javac")
        *     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 +158,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 @@ -179,12 +179,12 @@ * derived from the schema. * *

      - *     @XmlElement
      + *     {@code @XmlElement}
        *     class Math {
        *         //  The value of {@link #type()}is 
        *         //  JAXBElement.class , which indicates the XML
        *         //  element name ObjectFactory - in general a class marked
      - *         //  with @XmlRegistry. (See ObjectFactory below)
      + *         //  with @XmlRegistry. (See ObjectFactory below)
        *         //  
        *         //  The {@link #name()} is "operator", a pointer to a
        *         // factory method annotated with a
      @@ -196,18 +196,18 @@
        *         //  instance contains the element name that has been
        *         //  substituted in the XML document.
        *         // 
      - *         @XmlElementRef(type=JAXBElement.class,name="operator")
      - *         JAXBElement<? extends Operator> term;
      + *         {@code @XmlElementRef}(type=JAXBElement.class,name="operator")
      + *         {@code JAXBElement} term;
        *     }
        *
      - *     @XmlRegistry
      + *     {@code @XmlRegistry}
        *     class ObjectFactory {
      - *         @XmlElementDecl(name="operator")
      - *         JAXBElement<Operator> createOperator(Operator o) {...}
      - *         @XmlElementDecl(name="add",substitutionHeadName="operator")
      - *         JAXBElement<Operator> createAdd(Operator o) {...}
      - *         @XmlElementDecl(name="sub",substitutionHeadName="operator")
      - *         JAXBElement<Operator> createSub(Operator o) {...}
      + *         {@code @XmlElementDecl}(name="operator")
      + *         {@code JAXBElement} createOperator(Operator o) {...}
      + *         {@code @XmlElementDecl}(name="add",substitutionHeadName="operator")
      + *         {@code JAXBElement} createAdd(Operator o) {...}
      + *         {@code @XmlElementDecl}(name="sub",substitutionHeadName="operator")
      + *         {@code JAXBElement} createSub(Operator o) {...}
        *     }
        *
        *     class Operator {
      @@ -222,11 +222,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..ea3fe322 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 @@ -53,13 +53,13 @@ * * Multiple annotations of the same type are not allowed on a program * element. This annotation therefore serves as a container annotation - * for multiple @XmlElements as follows: + * for multiple {@code @XmlElements} as follows: * *

      - * @XmlElements({ @XmlElement(...),@XmlElement(...) })
      + * {@code @XmlElements}({ {@code @XmlElement}(...),{@code @XmlElement(...)} })
        * 
      * - *

      The @XmlElements annnotation can be used with the + *

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

      *
        *
      • a JavaBean property
      • @@ -74,10 +74,10 @@ *

        The usage is subject to the following constraints: *

          *
        • This annotation can be used with the following - * annotations: @{@link XmlIDREF}, @{@link XmlElementWrapper}.
        • + * annotations: {@code @}{@link XmlIDREF}, {@code @}{@link XmlElementWrapper}. *
        • If @XmlIDREF is also specified on the JavaBean property, - * then each @XmlElement.type() must contain a JavaBean - * property annotated with @XmlID.
        • + * then each {@code @XmlElement.type()} must contain a JavaBean + * property annotated with @XmlID. *
        * *

        See "Package Specification" in javax.xml.bind.package javadoc for @@ -90,31 +90,31 @@ * * // Mapped code fragment * public class Foo { - * @XmlElements( - * @XmlElement(name="A", type=Integer.class), - * @XmlElement(name="B", type=Float.class) + * {@code @XmlElements}( + * {@code @XmlElement}(name="A", type=Integer.class), + * {@code @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 --> + * * ... - * <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> - * - * + * {@code + * + * + * + * + * + * + * + * + * + * + * } * *

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

        @@ -122,59 +122,59 @@ * * // Mapped code fragment * public class Foo { - * @XmlElementWrapper(name="bar") - * @XmlElements( - * @XmlElement(name="A", type=Integer.class), - * @XmlElement(name="B", type=Float.class) + * {@code @XmlElementWrapper}(name="bar") + * {@code @XmlElements}( + * {@code @XmlElement}(name="A", type=Integer.class), + * {@code @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> - * + * {@code + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * *

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

        *
          *    class Foo {
        - *       @XmlJavaTypeAdapter(QtoPAdapter.class)
        - *       @XmlElements({
        - *           @XmlElement(name="A",type=PX.class),
        - *           @XmlElement(name="B",type=PY.class)
        + *       {@code @XmlJavaTypeAdapter}(QtoPAdapter.class)
        + *       {@code @XmlElements}({
        + *           {@code @XmlElement}(name="A",type=PX.class),
        + *           {@code @XmlElement}(name="B",type=PY.class)
          *       })
          *       Q bar;
          *    }
          * 
        - *    @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 @XmlType} abstract class P {...} + * {@code @XmlType}(name="PX") class PX extends P {...} + * {@code @XmlType}(name="PY") class PY extends P {...} + * {@code + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * * @author
        • Kohsuke Kawaguchi, Sun Microsystems, Inc.
        • Sekhar Vajjhala, Sun Microsystems, Inc.
        * @see XmlElement @@ -186,7 +186,7 @@ @Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface XmlElements { /** - * Collection of @{@link XmlElement} annotations + * Collection of {@code @}{@link XmlElement} annotations */ XmlElement[] value(); } diff --git a/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java b/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java index e9e11428..5b6c37d0 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,63 +71,63 @@ *

        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 {@code ->} enumeration facet

        *
          *     //Example: Code fragment
        - *     @XmlEnum(String.class)
        + *     {@code @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) {@code ->} enumeration facet

        *
          *     //Example: code fragment
        - *     @XmlType
        - *     @XmlEnum(Integer.class)
        + *     {@code @XmlType}
        + *     {@code @XmlEnum}(Integer.class)
          *     public enum Coin { 
        - *         @XmlEnumValue("1") PENNY(1),
        - *         @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 @XmlEnumValue}("1") PENNY(1), + * {@code @XmlEnumValue}("5") NICKEL(5), + * {@code @XmlEnumValue}("10") DIME(10), + * {@code @XmlEnumValue}("25") QUARTER(25) } + * {@code + * + * + * + * + * + * + * + * + * + * } + * + *

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

        * *
          *     //Code fragment
        - *     @XmlType
        - *     @XmlEnum(Integer.class)
        + *     {@code @XmlType}
        + *     {@code @XmlEnum}(Integer.class)
          *     public enum Code {
        - *         @XmlEnumValue("1") ONE,
        - *         @XmlEnumValue("2") TWO;
        + *         {@code @XmlEnumValue}("1") ONE,
        + *         {@code @XmlEnumValue}("2") TWO;
          *     }
        - * 
        - *     <!-- 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>
        - * 
        + * {@code + * + * + * + * + * + * + * + * } * * @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..ba45c221 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 @@ -53,12 +53,12 @@ * 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 - * appropriately. Annotations @XmlID and @XmlIDREF + * appropriately. Annotations @XmlID and @XmlIDREF * together allow a customized mapping of a JavaBean property's * type by containment or reference. * *

        Usage

        - * The @XmlID annotation can be used with the following + * The @XmlID annotation can be used with the following * program elements: *
          *
        • a JavaBean property
        • @@ -71,34 +71,34 @@ * The usage is subject to the following constraints: *
            *
          • At most one field or property in a class can be annotated - * with @XmlID.
          • + * with @XmlID. *
          • The JavaBean property's type must be java.lang.String.
          • *
          • The only other mapping annotations that can be used - * with @XmlID - * are:@XmlElement and @XmlAttribute.
          • + * with @XmlID + * are:@XmlElement and @XmlAttribute. *
          * *

          Example: Map a JavaBean property's type to xs:ID

          *
            *    // Example: code fragment
            *    public class Customer {
          - *        @XmlAttribute
          - *        @XmlID
          + *        {@code @XmlAttribute}
          + *        {@code @XmlID}
            *        public String getCustomerID();
            *        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..973a27b2 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,13 +52,13 @@ *

          * 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 - * appropriately. Annotations @XmlID and @XmlIDREF + * 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. * *

          Usage

          - * The @XmlIDREF annotation can be used with the following + * The @XmlIDREF annotation can be used with the following * program elements: *
            *
          • a JavaBean property
          • @@ -73,14 +73,14 @@ * *
          • If the type of the field or property is a collection type, * then the collection item type must contain a property or - * field annotated with @XmlID.
          • + * field annotated with @XmlID. *
          • If the field or property is single valued, then the type of * the property or field must contain a property or field - * annotated with @XmlID. + * annotated with @XmlID. *

            Note: If the collection item type or the type of the * property (for non collection type) is java.lang.Object, then * the instance must contain a property/field annotated with - * @XmlID attribute. + * @XmlID attribute. *

          • *
          • This annotation can be used with the following annotations: * {@link XmlElement}, {@link XmlAttribute}, {@link XmlList}, @@ -93,22 +93,22 @@ * * //EXAMPLE: Code fragment * public class Shipping { - * @XmlIDREF public Customer getCustomer(); + * {@code @XmlIDREF} public Customer getCustomer(); * 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 @@ -119,7 +119,7 @@ * public class Customer { * * // map JavaBean property type to xs:ID - * @XmlID public String getCustomerID(); + * {@code @XmlID} public String getCustomerID(); * public void setCustomerID(String id); * * // .... other properties not shown @@ -130,7 +130,7 @@ * public class Invoice { * * // map by reference - * @XmlIDREF public Customer getCustomer(); + * {@code @XmlIDREF} public Customer getCustomer(); * public void setCustomer(Customer customer); * * // .... other properties not shown here @@ -140,13 +140,13 @@ * public class Shipping { * * // map by reference - * @XmlIDREF public Customer getCustomer(); + * {@code @XmlIDREF} public Customer getCustomer(); * public void setCustomer(Customer customer); * } * * // at least one class must reference Customer by containment; * // Customer instances won't be marshalled. - * @XmlElement(name="CustomerData") + * {@code @XmlElement}(name="CustomerData") * public class CustomerData { * // map reference to Customer by containment by default. * public Customer getCustomer(); @@ -158,104 +158,104 @@ * public Invoice getInvoice(); * } * - * <!-- XML Schema mapping for above code frament --> - * - * <xs:complexType name="Invoice"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:IDREF"/> + * + * {@code + * + * + * + * * .... - * </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 *

              *     // Code fragment
              *     public class Shipping {
            - *         @XmlIDREF
            - *         @XmlElement(name="Alice")
            + *         {@code @XmlIDREF}
            + *         {@code @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. *

              *     //Code fragment
              *     public class Shipping {
            - *         @XmlIDREF
            - *         @XmlElements(
            - *             @XmlElement(name="Alice", type="Customer.class")
            - *              @XmlElement(name="John", type="InternationalCustomer.class")
            + *         {@code @XmlIDREF}
            + *         {@code @XmlElements}(
            + *             {@code @XmlElement}(name="Alice", type="Customer.class")
            + *             {@code @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..7d09cb01 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 @@ -65,41 +65,41 @@ * For example, * *
            - * @XmlRootElement
            + * {@code @XmlRootElement}
              * class Foo {
            - *     @XmlElement
            - *     List<String> data;
            + *     {@code @XmlElement}
            + *     {@code List} data;
              * }
              * 
            * * 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 + * {@code @XmlList} annotation, on the other hand, allows multiple values to be * represented as whitespace-separated tokens in a single element. For example, * *
            - * @XmlRootElement
            + * {@code @XmlRootElement}
              * class Foo {
            - *     @XmlElement
            - *     @XmlList
            - *     List<String> data;
            + *     {@code @XmlElement}
            + *     {@code @XmlList}
            + *     {@code List} data;
              * }
              * 
            * * 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..3afce8c6 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 @@ -57,71 +57,71 @@ *

            * The usage is subject to the following constraints: *

              - *
            • can be used with @XmlElementRef, @XmlElementRefs or @XmlAnyElement
            • + *
            • can be used with {@code @XmlElementRef}, {@code @XmlElementRefs} or {@code @XmlAnyElement}
            • *
            *

            - * The following can be inserted into @XmlMixed annotated multi-valued property + * The following can be inserted into {@code @XmlMixed} annotated multi-valued property *

              *
            • XML text information items are added as values of java.lang.String.
            • *
            • Children element information items are added as instances of * {@link JAXBElement} or instances with a class that is annotated with - * @XmlRootElement.
            • + * {@code @XmlRootElement}. *
            • Unknown content that is not be bound to a JAXB mapped class is inserted - * as {@link Element}. (Assumes property annotated with @XmlAnyElement)
            • + * as {@link Element}. (Assumes property annotated with {@code @XmlAnyElement}) *
            * * 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
              * 	// Name, Quantity and ProductName. Text data is represented as
              *	// java.util.String for text.
            - *	@XmlMixed 
            - * 	@XmlElementRefs({
            - *		@XmlElementRef(name="productName", type=JAXBElement.class),
            - *		@XmlElementRef(name="quantity", type=JAXBElement.class),
            - *		@XmlElementRef(name="name", type=JAXBElement.class)})
            + *	{@code @XmlMixed} 
            + * 	{@code @XmlElementRefs}({
            + *		{@code @XmlElementRef}(name="productName", type=JAXBElement.class),
            + *		{@code @XmlElementRef}(name="quantity", type=JAXBElement.class),
            + *		{@code @XmlElementRef}(name="name", type=JAXBElement.class)})
              *	List getContent(){...}
              * }
              * 
            * 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 +134,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..3c3161a3 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 @@ -51,7 +51,7 @@ * *

            Usage

            *

            - * The @XmlRootElement annotation can be used with the following program + * The {@code @XmlRootElement} annotation can be used with the following program * elements: *

              *
            • a top level class
            • @@ -63,7 +63,7 @@ * *

              * When a top level class or an enum type is annotated with the - * @XmlRootElement annotation, then its value is represented + * {@code @XmlRootElement} annotation, then its value is represented * as XML element in an XML document. * *

              This annotation can be used with the following annotations: @@ -75,7 +75,7 @@ * Example 1: Associate an element with XML Schema type *

                *     // Example: Code fragment
              - *     @XmlRootElement
              + *     {@code @XmlRootElement}
                *     class Point {
                *        int x;
                *        int y;
              @@ -88,28 +88,28 @@
                *     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
              + *     
              + *     
              + *     
              + *       
              + *         
              + *         
              + *       
              + *     
              + * }
              * *

              * @@ -120,7 +120,7 @@ * derived types. The following example shows this. *

                *     // Example: Code fragment
              - *     @XmlRootElement
              + *     {@code @XmlRootElement}
                *     class Point3D extends Point {
                *         int z;
                *         Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
              @@ -128,46 +128,46 @@
                *
                *     //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. *
                *     //Example: Code fragment
              - *     @XmlRootElement(name="PriceElement")
              + *     {@code @XmlRootElement}(name="PriceElement")
                *     public class USPrice {
              - *         @XmlElement
              + *         {@code @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..be56e145 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 @@ -75,57 +75,57 @@ * package is mapped.

              * *
              - *    @javax.xml.bind.annotation.XmlSchema (
              + *    {@code @javax.xml.bind.annotation.XmlSchema} (
                *      namespace = "http://www.example.com/MYPO1"
                *    )
              - *    
              - *    <!-- XML Schema fragment -->
              - *    <schema
              + * {@code   
              + *    
              + *    
              + *    >
              + *    
              + * }
              * *

              Example 2: Customize namespace prefix, namespace URI * mapping

              * *
                *    // Package level annotation
              - *    @javax.xml.bind.annotation.XmlSchema (
              + *    {@code @javax.xml.bind.annotation.XmlSchema} (
                *      xmlns = { 
              - *        @javax.xml.bind.annotation.XmlNs(prefix = "po", 
              + *        {@code @javax.xml.bind.annotation.XmlNs}(prefix = "po", 
                *                   namespaceURI="http://www.example.com/myPO1"),
                *
              - *        @javax.xml.bind.annotation.XmlNs(prefix="xs",
              + *        {@code @javax.xml.bind.annotation.XmlNs}(prefix="xs",
                *                   namespaceURI="http://www.w3.org/2001/XMLSchema")
                *      )
                *    )
              - * 
              - *    <!-- XML Schema fragment -->
              - *    <schema
              + * {@code
              + *    
              + *    
                * 
              - * 
              + * } * *

              Example 3: Customize elementFormDefault

              *
              - *    @javax.xml.bind.annotation.XmlSchema (
              + *    {@code @javax.xml.bind.annotation.XmlSchema} (
                *      elementFormDefault=XmlNsForm.UNQUALIFIED
                *      ...
                *    )
              - * 
              - *    <!-- XML Schema fragment -->
              - *    <schema
              + * {@code
              + *    
              + *    
                * 
              - * 
              + * } * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @since 1.6, JAXB 2.0 @@ -194,11 +194,11 @@ * More precisely, the value must be either "", "##generate", or * * a valid lexical representation of xs:anyURI that begins - * with <scheme>:. + * with {@code }:. * *

              * A schema generator is expected to generate a corresponding - * <xs:import namespace="..." schemaLocation="..."/> (or + * {@code } (or * no schemaLocation attribute at all if the empty string is specified.) * However, the schema generator is allowed to use a different value in * the schemaLocation attribute (including not generating diff --git a/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java b/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java index 17271b44..c808d89d 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 @@ -76,24 +76,24 @@ *

                *     //Example: Code fragment
                *     public class USPrice {
              - *         @XmlElement
              - *         @XmlSchemaType(name="date")
              + *         {@code @XmlElement}
              + *         {@code @XmlSchemaType}(name="date")
                *         public XMLGregorianCalendar date;
                *     }
              - * 
              - *     <!-- Example: Local XML Schema element -->
              - *     <xs:complexType name="USPrice"/>
              - *       <xs:sequence>
              - *         <xs:element name="date" type="xs:date"/>
              - *       </sequence>
              - *     </xs:complexType>
              - * 
              + * {@code + * + * + * + * + * + * + * } * *

              Example 2: Customize mapping of XMLGregorianCalendar at package * level

              *
                *     package foo;
              - *     @javax.xml.bind.annotation.XmlSchemaType(
              + *     {@code @javax.xml.bind.annotation.XmlSchemaType}(
                *          name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
                *     }
                * 
              diff --git a/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java b/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java index ed6843e4..5091fdad 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java +++ b/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2013 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 @@ -51,10 +51,10 @@ * *

              Multiple annotations of the same type are not allowed on a program * element. This annotation therefore serves as a container annotation - * for multiple @XmlSchemaType annotations as follows: + * for multiple {@code @XmlSchemaType} annotations as follows: * *

              - * @XmlSchemaTypes({ @XmlSchemaType(...), @XmlSchemaType(...) })
              + * {@code @XmlSchemaTypes}({ {@code @XmlSchemaType}(...), {@code @XmlSchemaType}(...) })
                * 
              *

              The @XmlSchemaTypes annnotation can be used to * define {@link XmlSchemaType} for different types at the diff --git a/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java b/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java index 0b9f60c9..5ca32d99 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java +++ b/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2006-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006-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 @@ -73,7 +73,7 @@ *

              * {@link XmlSeeAlso} annotation would allow you to write: *

              - * @XmlSeeAlso({Dog.class,Cat.class})
              + * {@code @XmlSeeAlso}({Dog.class,Cat.class})
                * class Animal {}
                * class Dog extends Animal {}
                * class Cat extends Animal {}
              diff --git a/src/main/java/javax/xml/bind/annotation/XmlTransient.java b/src/main/java/javax/xml/bind/annotation/XmlTransient.java
              index c613c931..2366f063 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
              @@ -87,20 +87,20 @@
                *
                *       // The field name "name" collides with the property name 
                *       // obtained by bean decapitalization of getName() below
              - *       @XmlTransient public String name;
              + *       {@code @XmlTransient} public String name;
                *
                *       String getName() {..};
                *       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..30e364f3 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 @@ -79,7 +79,7 @@ * mapping of JavaBean properties and fields contained within the * class. The schema type to which the class is mapped can either be * named or anonymous. A class can be mapped to an anonymous schema - * type by annotating the class with @XmlType(name=""). + * type by annotating the class with @XmlType(name=""). *

              * Either a global element, local element or a local attribute can be * associated with an anonymous type as follows: @@ -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
              • + *
              • {@code ->} : 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]+ {@code ->} elements * complexcontent
                xs:all * * @@ -155,7 +155,7 @@ * * Class * non empty - * [property]+ -> elements + * [property]+ {@code ->} elements * complexcontent
                xs:sequence * * @@ -163,7 +163,7 @@ * * Class * X - * no property -> element + * no property {@code ->} element * complexcontent
                empty sequence * * @@ -171,7 +171,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
                [property]+ -> attributes + * 1 [@XmlValue property] {@literal &&}
                [property]+ {@code ->} attributes * simplecontent * * @@ -179,7 +179,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
                no properties -> attribute + * 1 [@XmlValue property] {@literal &&}
                no properties {@code ->} attribute * * simpletype * @@ -206,7 +206,7 @@ *

                * *
                - *   @XmlType(propOrder={"street", "city" , "state", "zip", "name" })
                + *   {@code @XmlType}(propOrder={"street", "city" , "state", "zip", "name" })
                  *   public class USAddress {
                  *     String getName() {..};
                  *     void setName(String) {..};
                @@ -223,56 +223,56 @@
                  *     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={})
                + * {@code @XmlType}(propOrder={})
                  * public class USAddress { ...}
                - * 
                - * <!-- 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>
                - *
                + * {@code + * + * + * + * + * + * + * + * + * + * + *} *

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

                *
                - *   @XmlRootElement
                - *   @XmlType(name="")
                + *   {@code @XmlRootElement}
                + *   {@code @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. @@ -283,25 +283,25 @@ * ... * } * - * @XmlType(name="") + * {@code @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. @@ -311,34 +311,34 @@ * //Example: Code fragment * public class Item { * public String name; - * @XmlAttribute + * {@code @XmlAttribute} * public USPrice price; * } * * // map class to anonymous simple type. - * @XmlType(name="") + * {@code @XmlType(name="")} * public class USPrice { - * @XmlValue + * {@code @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 * *

                 
                - *      @XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
                + *      {@code @XmlType}(name="USAddressType", factoryClass=USAddressFactory.class,
                  *      factoryMethod="getUSAddress")
                  *      public class USAddress {
                  *
                @@ -369,7 +369,7 @@
                  *  

                Example 7: Define factoryMethod and use the default factoryClass * *

                - *      @XmlType(name="USAddressType", factoryMethod="getNewInstance")
                + *      {@code @XmlType}(name="USAddressType", factoryMethod="getNewInstance")
                  *      public class USAddress {
                  *
                  *          private String city;
                diff --git a/src/main/java/javax/xml/bind/annotation/XmlValue.java b/src/main/java/javax/xml/bind/annotation/XmlValue.java
                index b8bdc33d..2378c48b 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
                @@ -99,16 +99,16 @@
                  * 
                  *     // Example 1: Code fragment
                  *     public class USPrice {
                - *         @XmlValue
                + *         {@code @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.

                @@ -117,23 +117,23 @@ * * // Example 2: Code fragment * public class InternationalPrice { - * @XmlValue + * {@code @XmlValue} * public java.math.BigDecimal price; * - * @XmlAttribute + * {@code @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..c595ddf4 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 @@ -85,54 +85,54 @@ * *

                Example: Customized mapping of HashMap

                *

                The following example illustrates the use of - * @XmlAdapter and @XmlJavaTypeAdapter to + * {@code @XmlAdapter} and {@code @XmlJavaTypeAdapter} to * customize the mapping of a HashMap. * *

                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. * *

                  *     public class MyHashMapType {
                - *         List<MyHashMapEntryType> entry;
                + *         {@code List} entry;
                  *     }
                  *
                  *     public class MyHashMapEntryType {
                - *         @XmlAttribute
                + *         {@code @XmlAttribute}
                  *         public Integer key; 
                  *
                - *         @XmlValue
                + *         {@code @XmlValue}
                  *         public String value;
                  *     }
                  * 
                @@ -140,17 +140,17 @@ *

                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. * *

                  *     public class Foo {
                - *         @XmlJavaTypeAdapter(MyHashMapAdapter.class)
                + *         {@code @XmlJavaTypeAdapter(MyHashMapAdapter.class)}
                  *         HashMap hashmap;
                  *         ...
                  *     }
                @@ -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..a759ec59 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 @@ -51,13 +51,13 @@ * *

                Multiple annotations of the same type are not allowed on a program * element. This annotation therefore serves as a container annotation - * for multiple @XmlJavaTypeAdapter as follows: + * for multiple {@code @XmlJavaTypeAdapter} as follows: * *

                - * @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) })
                + * {@code @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. * From d1ccb0511306f20c15ebdccda1a5ac1acf86baae Mon Sep 17 00:00:00 2001 From: Petros Splinakis Date: Tue, 24 Feb 2015 14:55:23 +0100 Subject: [PATCH 2/2] Reverting escaping of '@' symbol Signed-off-by: Petros Splinakis --- src/main/java/javax/xml/bind/JAXBContext.java | 4 +- .../java/javax/xml/bind/JAXBIntrospector.java | 2 +- src/main/java/javax/xml/bind/Marshaller.java | 6 +- .../javax/xml/bind/SchemaOutputResolver.java | 4 +- .../java/javax/xml/bind/Unmarshaller.java | 4 +- .../xml/bind/annotation/XmlAccessorType.java | 6 +- .../xml/bind/annotation/XmlAnyAttribute.java | 8 +-- .../xml/bind/annotation/XmlAnyElement.java | 58 +++++++++---------- .../xml/bind/annotation/XmlAttachmentRef.java | 10 ++-- .../xml/bind/annotation/XmlAttribute.java | 14 +++-- .../javax/xml/bind/annotation/XmlElement.java | 11 ++-- .../xml/bind/annotation/XmlElementDecl.java | 35 +++++------ .../xml/bind/annotation/XmlElementRef.java | 45 +++++++------- .../xml/bind/annotation/XmlElements.java | 49 ++++++++-------- .../xml/bind/annotation/XmlEnumValue.java | 31 +++++----- .../java/javax/xml/bind/annotation/XmlID.java | 15 ++--- .../javax/xml/bind/annotation/XmlIDREF.java | 40 +++++++------ .../javax/xml/bind/annotation/XmlList.java | 16 ++--- .../javax/xml/bind/annotation/XmlMixed.java | 19 +++--- .../xml/bind/annotation/XmlRootElement.java | 16 +++-- .../javax/xml/bind/annotation/XmlSchema.java | 19 +++--- .../xml/bind/annotation/XmlSchemaType.java | 7 ++- .../xml/bind/annotation/XmlSchemaTypes.java | 6 +- .../javax/xml/bind/annotation/XmlSeeAlso.java | 4 +- .../xml/bind/annotation/XmlTransient.java | 3 +- .../javax/xml/bind/annotation/XmlType.java | 39 +++++++------ .../javax/xml/bind/annotation/XmlValue.java | 12 ++-- .../bind/annotation/adapters/XmlAdapter.java | 10 ++-- .../adapters/XmlJavaTypeAdapters.java | 4 +- 29 files changed, 266 insertions(+), 231 deletions(-) diff --git a/src/main/java/javax/xml/bind/JAXBContext.java b/src/main/java/javax/xml/bind/JAXBContext.java index 18234c3d..4e011eaf 100644 --- a/src/main/java/javax/xml/bind/JAXBContext.java +++ b/src/main/java/javax/xml/bind/JAXBContext.java @@ -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 - * {@code }, + * {@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 @@ -549,7 +549,7 @@ public static JAXBContext newInstance( String contextPath, ClassLoader classLoad * will recognize both Foo and Bar, but not Zot or FooBar: *

                      * class Foo {
                -     *      {@code @XmlTransient} FooBar c;
                +     *      @XmlTransient FooBar c;
                      *      Bar b;
                      * }
                      * class Bar { int x; }
                diff --git a/src/main/java/javax/xml/bind/JAXBIntrospector.java b/src/main/java/javax/xml/bind/JAXBIntrospector.java
                index 83a2ce36..75106fd4 100644
                --- a/src/main/java/javax/xml/bind/JAXBIntrospector.java
                +++ b/src/main/java/javax/xml/bind/JAXBIntrospector.java
                @@ -66,7 +66,7 @@ public abstract class JAXBIntrospector {
                      * 
                  *
                1. It is an instance of javax.xml.bind.JAXBElement.
                2. *
                3. The class of object is annotated with - * @XmlRootElement. + * @XmlRootElement. *
                4. *
                * diff --git a/src/main/java/javax/xml/bind/Marshaller.java b/src/main/java/javax/xml/bind/Marshaller.java index b83e0c3f..0bf3abaf 100644 --- a/src/main/java/javax/xml/bind/Marshaller.java +++ b/src/main/java/javax/xml/bind/Marshaller.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2003-2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003-2014 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 @@ -178,7 +178,7 @@ * and pass the wrapper element as the first parameter to * a Marshaller.marshal method. For java to schema binding, it * is also possible to simply annotate the instance's class with - * {@code @}{@link XmlRootElement}. + * @{@link XmlRootElement}. * * *

                @@ -679,7 +679,7 @@ public ValidationEventHandler getEventHandler() * *

                * Every marshaller internally maintains a - * {@link java.util.Map}{@code <}{@link Class},{@link XmlAdapter}{@code >}, + * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>, * which it uses for marshalling classes whose fields/methods are annotated * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}. * diff --git a/src/main/java/javax/xml/bind/SchemaOutputResolver.java b/src/main/java/javax/xml/bind/SchemaOutputResolver.java index 6ceab17d..5b998202 100644 --- a/src/main/java/javax/xml/bind/SchemaOutputResolver.java +++ b/src/main/java/javax/xml/bind/SchemaOutputResolver.java @@ -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 {@code } 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 - * {@code }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 dc16fec9..be911646 100644 --- a/src/main/java/javax/xml/bind/Unmarshaller.java +++ b/src/main/java/javax/xml/bind/Unmarshaller.java @@ -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 {@code JAXBElement} + * These methods always return a {@literal JAXBElement} * instance. The table below shows how the properties of the returned JAXBElement * instance are set. * @@ -1024,7 +1024,7 @@ public void setProperty( String name, Object value ) * *

                * Every unmarshaller internally maintains a - * {@link java.util.Map}{@code <}{@link Class},{@link XmlAdapter}{@code >}, + * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>, * which it uses for unmarshalling classes whose fields/methods are annotated * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}. * diff --git a/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java b/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java index c6f8c16e..c3210153 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2013 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 @@ -83,14 +83,14 @@ *

                By default, if @XmlAccessorType on a package is absent, * then the following package level annotation is assumed.

                *
                - *   {@code @XmlAccessorType}(XmlAccessType.PUBLIC_MEMBER)
                + *   @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
                  * 
                *

                By default, if @XmlAccessorType on a class is absent, * and none of its super classes is annotated with * @XmlAccessorType, then the following default on the class * is assumed:

                *
                - *   {@code @XmlAccessorType}(XmlAccessType.PUBLIC_MEMBER)
                + *   @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
                  * 
                *

                This annotation can be used with the following annotations: * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder}, diff --git a/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java b/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java index 63baf356..8a2de0ba 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2014 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 @@ -55,7 +55,7 @@ * *

                Usage

                *

                - * The {@code @XmlAnyAttribute} annotation can be used with the + * The @XmlAnyAttribute annotation can be used with the * following program elements: *

                  *
                • JavaBean property
                • @@ -68,7 +68,7 @@ * The usage is subject to the following constraints: *
                    *
                  • At most one field or property in a class can be annotated - * with {@code @XmlAnyAttribute}.
                  • + * with @XmlAnyAttribute. *
                  • The type of the property or the field must java.util.Map
                  • *
                  * @@ -77,7 +77,7 @@ * each attribute that is not statically associated with another * JavaBean property, via {@link XmlAttribute}, is entered into the * wildcard attribute map represented by - * {@link Map}{@code <}{@link QName},{@link Object}{@code >}. The attribute QName is the + * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the * map's key. The key's value is the String value of the attribute. * * @author Kohsuke Kawaguchi, Sun Microsystems, Inc. diff --git a/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java b/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java index 6e38a387..f115639e 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java @@ -61,23 +61,23 @@ * xml content into a instance of a JAXB annotated class. It typically * annotates a multi-valued JavaBean property, but it can occur on * single value JavaBean property. During unmarshalling, each xml element - * that does not match a static {@code @XmlElement} or {@code @XmlElementRef} + * that does not match a static @XmlElement or @XmlElementRef * annotation for the other JavaBean properties on the class, is added to this * "catch-all" property. * *

                  Usages:

                  *
                  - * {@code @XmlAnyElement}
                  + * @XmlAnyElement
                    * public {@link Element}[] others;
                    * 
                    * // Collection of {@link Element} or JAXB elements.
                  - * {@code @XmlAnyElement}(lax="true")
                  + * @XmlAnyElement(lax="true")
                    * public {@link Object}[] others;
                    *
                  - * {@code @XmlAnyElement}
                  - * private List{@code <}{@link Element}{@code >} nodes;
                  + * @XmlAnyElement
                  + * private List<{@link Element}> nodes;
                    *
                  - * {@code @XmlAnyElement}
                  + * @XmlAnyElement
                    * private {@link Element} node;
                    * 
                  * @@ -101,8 +101,8 @@ * This annotation can be used with {@link XmlMixed} like this: *
                    * // List of java.lang.String or DOM nodes.
                  - * {@code @XmlAnyElement} {@code @XmlMixed}
                  - * {@code List} others;
                  + * @XmlAnyElement @XmlMixed
                  + * List<Object> others;
                    * 
                    *
                    *
                  @@ -123,8 +123,8 @@
                    * class Foo {
                    *   int a;
                    *   int b;
                  - *   {@code @}{@link XmlAnyElement}
                  - *   {@code List} any;
                  + *   @{@link XmlAnyElement}
                  + *   List<Element> any;
                    * }
                    * 
                    *
                  @@ -198,33 +198,33 @@
                    *
                    * 
                    * class Foo {
                  - *   {@code @}{@link XmlAnyElement}(lax="true")
                  - *   {@code @}{@link XmlElementRefs}({
                  - *     {@code @}{@link XmlElementRef}(name="a", type="JAXBElement.class")
                  - *     {@code @}{@link XmlElementRef}(name="b", type="JAXBElement.class")
                  + *   @{@link XmlAnyElement}(lax="true")
                  + *   @{@link XmlElementRefs}({
                  + *     @{@link XmlElementRef}(name="a", type="JAXBElement.class")
                  + *     @{@link XmlElementRef}(name="b", type="JAXBElement.class")
                    *   })
                  - *   {@link List}{@code <}{@link Object}{@code >} others;
                  + *   {@link List}<{@link Object}> others;
                    * }
                    *
                  - * {@code @XmlRegistry}
                  + * @XmlRegistry
                    * class ObjectFactory {
                    *   ...
                  - *   {@code @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)}
                  - *   {@link JAXBElement}{@code } createFooA( Integer i ) { ... }
                  + *   @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
                  + *   {@link JAXBElement}<Integer> createFooA( Integer i ) { ... }
                    *
                  - *   {@code @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)}
                  - *   {@link JAXBElement}{@code } createFooB( Integer i ) { ... }
                  + *   @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
                  + *   {@link JAXBElement}<Integer> createFooB( Integer i ) { ... }
                    * 
                  * * It can unmarshal instances like * - *
                  {@code
                  - * 
                  - *   1     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
                  - *     // this will unmarshal to a DOM {@link Element}.
                  - *   3     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
                  - * 
                  - * }
                  + *
                  + *{@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 }
                  + * 
                  * * * @@ -233,9 +233,9 @@ * The lax element of the annotation enables the emulation of the "lax" wildcard semantics. * For example, when the Java source code is annotated like this: *
                  - * {@code @}{@link XmlRootElement}
                  + * @{@link XmlRootElement}
                    * class Foo {
                  - *   {@code @XmlAnyElement(lax=true)}
                  + *   @XmlAnyElement(lax=true)
                    *   public {@link Object}[] others;
                    * }
                    * 
                  diff --git a/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java b/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java index 99217420..f0384399 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java @@ -54,14 +54,14 @@ * *

                  Usage

                  *
                  - * {@code @}{@link XmlRootElement}
                  + * @{@link XmlRootElement}
                    * class Foo {
                  - *   {@code @}{@link XmlAttachmentRef}
                  - *   {@code @}{@link XmlAttribute}
                  + *   @{@link XmlAttachmentRef}
                  + *   @{@link XmlAttribute}
                    *   {@link DataHandler} data;
                    *
                  - *   {@code @}{@link XmlAttachmentRef}
                  - *   {@code @}{@link XmlElement}
                  + *   @{@link XmlAttachmentRef}
                  + *   @{@link XmlElement}
                    *   {@link DataHandler} body;
                    * }
                    * 
                  diff --git a/src/main/java/javax/xml/bind/annotation/XmlAttribute.java b/src/main/java/javax/xml/bind/annotation/XmlAttribute.java index ad0ad481..f322ddd5 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlAttribute.java +++ b/src/main/java/javax/xml/bind/annotation/XmlAttribute.java @@ -71,8 +71,8 @@ * simple type. *
                    *     // Examples
                  - *     {@code @XmlAttribute List} items; //legal
                  - *     {@code @XmlAttribute List} foo; // illegal if Bar does not map to a schema simple type
                  + *     @XmlAttribute List<Integer> items; //legal
                  + *     @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
                    * 
                  * *
                • If the type of the field or the property is a non @@ -80,8 +80,8 @@ * must map to a simple schema type. *
                    *     // Examples
                  - *     {@code @}XmlAttribute int foo; // legal
                  - *     {@code @}XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
                  + *     @XmlAttribute int foo; // legal
                  + *     @XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
                    * 
                  *
                • *
                • This annotation can be used with the following annotations: @@ -100,11 +100,12 @@ *
                    *     //Example: Code fragment
                    *     public class USPrice { 
                  - *         {@code @}XmlAttribute
                  + *         @XmlAttribute
                    *         public java.math.BigDecimal getPrice() {...} ;
                    *         public void setPrice(java.math.BigDecimal ) {...};
                    *     }
                    * {@code
                  + * 
                    *     
                    *     
                    *       
                  @@ -121,9 +122,10 @@
                    *     // Example: Code fragment
                    *     class Foo {
                    *         ...
                  - *         {@code @XmlAttribute List} items;
                  + *         @XmlAttribute List<Integer> items;
                    *     } 
                    * {@code
                  + * 
                    *     
                    *     
                    *     	 ...
                  diff --git a/src/main/java/javax/xml/bind/annotation/XmlElement.java b/src/main/java/javax/xml/bind/annotation/XmlElement.java
                  index 48b5cb7f..ac3a0e06 100644
                  --- a/src/main/java/javax/xml/bind/annotation/XmlElement.java
                  +++ b/src/main/java/javax/xml/bind/annotation/XmlElement.java
                  @@ -94,10 +94,11 @@
                    * 
                    *     //Example: Code fragment
                    *     public class USPrice {
                  - *         {@code @XmlElement}(name="itemprice")
                  + *         @XmlElement(name="itemprice")
                    *         public java.math.BigDecimal price;
                    *     }
                    * {@code
                  + * 
                    *     
                    *     
                    *       
                  @@ -112,10 +113,11 @@
                    *
                    *     //Example: Code fragment
                    *     public class USPrice {
                  - *         {@code @}XmlElement(nillable=true)
                  + *         @XmlElement(nillable=true)
                    *         public java.math.BigDecimal price;
                    *     }
                    * {@code
                  + * 
                    *     
                    *     
                    *       
                  @@ -129,10 +131,11 @@
                    *
                    *     //Example: Code fragment
                    *     public class USPrice {
                  - *         {@code @}XmlElement(nillable=true, required=true)
                  + *         @XmlElement(nillable=true, required=true)
                    *         public java.math.BigDecimal price;
                    *     }
                    * {@code
                  + * 
                    *     
                    *     
                    *       
                  @@ -194,7 +197,7 @@
                        *  the enclosing class.
                        *
                        *  
                • - * Otherwise {@code ''} (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 0bda3e5c..7ac275f5 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java +++ b/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java @@ -58,14 +58,14 @@ * (and annotated) from a schema into the ObjectFactory class in a * Java package that represents the binding of the element * declaration's target namespace. Thus, while the annotation syntax - * allows {@code @XmlElementDecl} to be used on any method, semantically + * allows @XmlElementDecl to be used on any method, semantically * its use is restricted to annotation of element factory method. * * The usage is subject to the following constraints: * *
                    *
                  • The class containing the element factory method annotated - * with {@code @XmlElementDecl} must be marked with {@link + * with @XmlElementDecl must be marked with {@link * XmlRegistry}.
                  • *
                  • The element factory method must take one parameter * assignable to {@link Object}.
                  • @@ -74,15 +74,16 @@ *

                    Example 1: Annotation on a factory method *

                      *     // Example: code fragment
                    - *     {@code @XmlRegistry}
                    + *     @XmlRegistry
                      *     class ObjectFactory {
                    - *         {@code @XmlElementDecl(name="foo")}
                    - *         {@code JAXBElement} createFoo(String s) { ... }
                    + *         @XmlElementDecl(name="foo")
                    + *         JAXBElement<String> createFoo(String s) { ... }
                      *     }
                      * 
                    *
                     {@code
                    + * 
                      *     
                    - *       string
                    + *     string
                      *
                      *     // Example: code fragment corresponding to XML input
                      *     JAXBElement o =
                    @@ -120,23 +121,23 @@
                      * 
                      *     // Example: expected default binding
                      *     class Pea {
                    - *         {@code @XmlElementRefs}({
                    - *             {@code @XmlElementRef}(name="foo",type=JAXBElement.class)
                    - *             {@code @XmlElementRef}(name="bar",type=JAXBElement.class)
                    + *         @XmlElementRefs({
                    + *             @XmlElementRef(name="foo",type=JAXBElement.class)
                    + *             @XmlElementRef(name="bar",type=JAXBElement.class)
                      *         })
                    - *         {@code List>} fooOrBar;
                    + *         List<JAXBElement<String>> fooOrBar;
                      *     }
                      * 
                    - *     {@code @XmlRegistry}
                    + *     @XmlRegistry
                      *     class ObjectFactory {
                    - *         {@code @XmlElementDecl}(scope=Pea.class,name="foo")
                    - *         {@code JAXBElement} createPeaFoo(String s);
                    + *         @XmlElementDecl(scope=Pea.class,name="foo")
                    + *         JAXBElement<String> createPeaFoo(String s);
                      * 
                    - *         {@code @XmlElementDecl}(scope=Pea.class,name="bar")
                    - *         {@code JAXBElement} createPeaBar(String s);
                    + *         @XmlElementDecl(scope=Pea.class,name="bar")
                    + *         JAXBElement<String> createPeaBar(String s);
                      * 
                    - *         {@code @XmlElementDecl}(name="foo")
                    - *         {@code JAXBElement} createFoo(Integer i);
                    + *         @XmlElementDecl(name="foo")
                    + *         JAXBElement<Integer> createFoo(Integer i);
                      *     }
                      * 
                      * 
                    diff --git a/src/main/java/javax/xml/bind/annotation/XmlElementRef.java b/src/main/java/javax/xml/bind/annotation/XmlElementRef.java index 63410801..e6e5803e 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlElementRef.java +++ b/src/main/java/javax/xml/bind/annotation/XmlElementRef.java @@ -54,7 +54,7 @@ *

                    * Usage *

                    - * @XmlElementRef annotation can be used with a + * @XmlElementRef annotation can be used with a * JavaBean property or from within {@link XmlElementRefs} *

                    * This annotation dynamically associates an XML element name with the JavaBean @@ -78,7 +78,7 @@ *

                    * An element factory method annotated with {@link XmlElementDecl} is * used to create a JAXBElement instance, containing an XML - * element name. The presence of {@code @XmlElementRef} annotation on an + * element name. The presence of @XmlElementRef annotation on an * element property indicates that the element name from JAXBElement * instance be used instead of deriving an XML element name from the * JavaBean property name. @@ -89,7 +89,7 @@ *

                  • If the collection item type (for collection property) or * property type (for single valued property) is * {@link javax.xml.bind.JAXBElement}, then - * @XmlElementRef.name() and @XmlElementRef.namespace() must + * @XmlElementRef}.name() and @XmlElementRef.namespace() must * point an element factory method with an @XmlElementDecl * annotation in a class annotated with @XmlRegistry (usually * ObjectFactory class generated by the schema compiler) : @@ -113,30 +113,31 @@ * The following Java class hierarchy models an Ant build * script. An Ant task corresponds to a class in the class * hierarchy. The XML element name of an Ant task is indicated by the - * {@code @XmlRootElement} annotation on its corresponding class. + * @XmlRootElement annotation on its corresponding class. *
                    - *     {@code @XmlRootElement}(name="target")
                    + *     @XmlRootElement(name="target")
                      *     class Target {
                    - *         // The presence of @XmlElementRef indicates that the XML
                    - *         // element name will be derived from the @XmlRootElement 
                    + *         // 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). 
                    - *         {@code @XmlElementRef}
                    - *         {@code List} tasks;
                    + *         @XmlElementRef
                    + *         List<Task> tasks;
                      *     }
                      *
                      *     abstract class Task {
                      *     }
                      *
                    - *     {@code @XmlRootElement}(name="jar")
                    + *     @XmlRootElement(name="jar")
                      *     class JarTask extends Task {
                      *         ...
                      *     }
                      *
                    - *     {@code @XmlRootElement}(name="javac")
                    + *     @XmlRootElement(name="javac")
                      *     class JavacTask extends Task {
                      *         ...
                      *     }
                      * {@code
                    + * 
                      *     
                      *     
                      *     
                    @@ -179,12 +180,12 @@
                      * derived from the schema.
                      * 
                      * 
                    - *     {@code @XmlElement}
                    + *     @XmlElement
                      *     class Math {
                      *         //  The value of {@link #type()}is 
                      *         //  JAXBElement.class , which indicates the XML
                      *         //  element name ObjectFactory - in general a class marked
                    - *         //  with @XmlRegistry. (See ObjectFactory below)
                    + *         //  with @XmlRegistry. (See ObjectFactory below)
                      *         //  
                      *         //  The {@link #name()} is "operator", a pointer to a
                      *         // factory method annotated with a
                    @@ -196,18 +197,18 @@
                      *         //  instance contains the element name that has been
                      *         //  substituted in the XML document.
                      *         // 
                    - *         {@code @XmlElementRef}(type=JAXBElement.class,name="operator")
                    - *         {@code JAXBElement} term;
                    + *         @XmlElementRef(type=JAXBElement.class,name="operator")
                    + *         JAXBElement<? extends Operator> term;
                      *     }
                      *
                    - *     {@code @XmlRegistry}
                    + *     @XmlRegistry
                      *     class ObjectFactory {
                    - *         {@code @XmlElementDecl}(name="operator")
                    - *         {@code JAXBElement} createOperator(Operator o) {...}
                    - *         {@code @XmlElementDecl}(name="add",substitutionHeadName="operator")
                    - *         {@code JAXBElement} createAdd(Operator o) {...}
                    - *         {@code @XmlElementDecl}(name="sub",substitutionHeadName="operator")
                    - *         {@code JAXBElement} createSub(Operator o) {...}
                    + *         @XmlElementDecl(name="operator")
                    + *         JAXBElement<Operator> createOperator(Operator o) {...}
                    + *         @XmlElementDecl(name="add",substitutionHeadName="operator")
                    + *         JAXBElement<Operator> createAdd(Operator o) {...}
                    + *         @XmlElementDecl(name="sub",substitutionHeadName="operator")
                    + *         JAXBElement<Operator> createSub(Operator o) {...}
                      *     }
                      *
                      *     class Operator {
                    diff --git a/src/main/java/javax/xml/bind/annotation/XmlElements.java b/src/main/java/javax/xml/bind/annotation/XmlElements.java
                    index ea3fe322..b1098e96 100644
                    --- a/src/main/java/javax/xml/bind/annotation/XmlElements.java
                    +++ b/src/main/java/javax/xml/bind/annotation/XmlElements.java
                    @@ -53,10 +53,10 @@
                      *
                      * Multiple annotations of the same type are not allowed on a program
                      * element. This annotation therefore serves as a container annotation
                    - * for multiple {@code @XmlElements} as follows:
                    + * for multiple @XmlElements as follows:
                      *
                      * 
                    - * {@code @XmlElements}({ {@code @XmlElement}(...),{@code @XmlElement(...)} })
                    + * @XmlElements({ @XmlElement(...),@XmlElement(...) })
                      * 
                    * *

                    The @XmlElements annotation can be used with the @@ -74,10 +74,10 @@ *

                    The usage is subject to the following constraints: *

                      *
                    • This annotation can be used with the following - * annotations: {@code @}{@link XmlIDREF}, {@code @}{@link XmlElementWrapper}.
                    • + * annotations: @{@link XmlIDREF}, @{@link XmlElementWrapper}. *
                    • If @XmlIDREF is also specified on the JavaBean property, - * then each {@code @XmlElement.type()} must contain a JavaBean - * property annotated with @XmlID.
                    • + * then each @XmlElement.type() must contain a JavaBean + * property annotated with @XmlID. *
                    * *

                    See "Package Specification" in javax.xml.bind.package javadoc for @@ -90,20 +90,21 @@ * * // Mapped code fragment * public class Foo { - * {@code @XmlElements}( - * {@code @XmlElement}(name="A", type=Integer.class), - * {@code @XmlElement}(name="B", type=Float.class) - * } + * @XmlElements( + * @XmlElement(name="A", type=Integer.class), + * @XmlElement(name="B", type=Float.class) + * ) * public List items; * } - * + * {@code + * * * ... * 1 * 2.5 * ... - * {@code + * * * * @@ -122,14 +123,15 @@ * * // Mapped code fragment * public class Foo { - * {@code @XmlElementWrapper}(name="bar") - * {@code @XmlElements}( - * {@code @XmlElement}(name="A", type=Integer.class), - * {@code @XmlElement}(name="B", type=Float.class) + * @XmlElementWrapper(name="bar") + * @XmlElements( + * @XmlElement(name="A", type=Integer.class), + * @XmlElement(name="B", type=Float.class) * } * public List items; * } * {@code + * * * * @@ -149,18 +151,19 @@ *

                    *
                      *    class Foo {
                    - *       {@code @XmlJavaTypeAdapter}(QtoPAdapter.class)
                    - *       {@code @XmlElements}({
                    - *           {@code @XmlElement}(name="A",type=PX.class),
                    - *           {@code @XmlElement}(name="B",type=PY.class)
                    + *       @XmlJavaTypeAdapter(QtoPAdapter.class)
                    + *       @XmlElements({
                    + *           @XmlElement(name="A",type=PX.class),
                    + *           @XmlElement(name="B",type=PY.class)
                      *       })
                      *       Q bar;
                      *    }
                      * 
                    - *    {@code @XmlType} abstract class P {...}
                    - *    {@code @XmlType}(name="PX") class PX extends P {...}
                    - *    {@code @XmlType}(name="PY") class PY extends P {...}
                    + *    @XmlType abstract class P {...}
                    + *    @XmlType(name="PX") class PX extends P {...}
                    + *    @XmlType(name="PY") class PY extends P {...}
                      * {@code
                    + * 
                      *    
                      *    
                      *      
                    @@ -186,7 +189,7 @@
                     @Retention(RUNTIME) @Target({FIELD,METHOD})
                     public @interface XmlElements {
                         /**
                    -     * Collection of {@code @}{@link XmlElement} annotations
                    +     * Collection of @{@link XmlElement} annotations
                          */
                         XmlElement[] value();
                     }
                    diff --git a/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java b/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
                    index 5b6c37d0..4afa8724 100644
                    --- a/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
                    +++ b/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
                    @@ -71,12 +71,13 @@
                      * 

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

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

                    + *

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

                    *
                      *     //Example: Code fragment
                    - *     {@code @XmlEnum}(String.class)
                    + *     @XmlEnum(String.class)
                      *     public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }
                      * {@code
                    + * 
                      *     
                      *     
                      *       
                    @@ -87,17 +88,18 @@
                      *     
                      * }
                    * - *

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

                    + *

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

                    *
                      *     //Example: code fragment
                    - *     {@code @XmlType}
                    - *     {@code @XmlEnum}(Integer.class)
                    + *     @XmlType
                    + *     @XmlEnum(Integer.class)
                      *     public enum Coin { 
                    - *         {@code @XmlEnumValue}("1") PENNY(1),
                    - *         {@code @XmlEnumValue}("5") NICKEL(5),
                    - *         {@code @XmlEnumValue}("10") DIME(10),
                    - *         {@code @XmlEnumValue}("25") QUARTER(25) }
                    + *         @XmlEnumValue("1") PENNY(1),
                    + *         @XmlEnumValue("5") NICKEL(5),
                    + *         @XmlEnumValue("10") DIME(10),
                    + *         @XmlEnumValue("25") QUARTER(25) }
                      * {@code
                    + * 
                      *     
                      *     
                      *       
                    @@ -109,17 +111,18 @@
                      *     
                      * }
                    * - *

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

                    + *

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

                    * *
                      *     //Code fragment
                    - *     {@code @XmlType}
                    - *     {@code @XmlEnum}(Integer.class)
                    + *     @XmlType
                    + *     @XmlEnum(Integer.class)
                      *     public enum Code {
                    - *         {@code @XmlEnumValue}("1") ONE,
                    - *         {@code @XmlEnumValue}("2") TWO;
                    + *         @XmlEnumValue("1") ONE,
                    + *         @XmlEnumValue("2") TWO;
                      *     }
                      * {@code
                    + * 
                      *     
                      *     
                      *       
                    diff --git a/src/main/java/javax/xml/bind/annotation/XmlID.java b/src/main/java/javax/xml/bind/annotation/XmlID.java
                    index ba45c221..363155ee 100644
                    --- a/src/main/java/javax/xml/bind/annotation/XmlID.java
                    +++ b/src/main/java/javax/xml/bind/annotation/XmlID.java
                    @@ -53,12 +53,12 @@
                      * 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
                    - * appropriately. Annotations @XmlID and @XmlIDREF
                    + * appropriately. Annotations @XmlID and @XmlIDREF
                      * together allow a customized mapping of a JavaBean property's
                      * type by containment or reference. 
                      *
                      * 

                    Usage

                    - * The @XmlID annotation can be used with the following + * The @XmlID annotation can be used with the following * program elements: *
                      *
                    • a JavaBean property
                    • @@ -71,24 +71,25 @@ * The usage is subject to the following constraints: *
                        *
                      • At most one field or property in a class can be annotated - * with @XmlID.
                      • + * with @XmlID. *
                      • The JavaBean property's type must be java.lang.String.
                      • *
                      • The only other mapping annotations that can be used - * with @XmlID - * are:@XmlElement and @XmlAttribute.
                      • + * with @XmlID + * are:@XmlElement and @XmlAttribute. *
                      * *

                      Example: Map a JavaBean property's type to xs:ID

                      *
                        *    // Example: code fragment
                        *    public class Customer {
                      - *        {@code @XmlAttribute}
                      - *        {@code @XmlID}
                      + *        @XmlAttribute
                      + *        @XmlID
                        *        public String getCustomerID();
                        *        public void setCustomerID(String id);
                        *        .... other properties not shown 
                        *    }
                        * {@code
                      + * 
                        *    
                        *    
                        *      
                      diff --git a/src/main/java/javax/xml/bind/annotation/XmlIDREF.java b/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
                      index 973a27b2..8ce782e3 100644
                      --- a/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
                      +++ b/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
                      @@ -53,12 +53,12 @@
                        * To preserve referential integrity of an object graph across XML
                        * serialization followed by a XML deserialization, requires an object
                        * reference to be marshaled by reference or containment
                      - * appropriately. Annotations @XmlID and @XmlIDREF
                      + * appropriately. Annotations @XmlID and @XmlIDREF
                        * together allow a customized mapping of a JavaBean property's
                        * type by containment or reference. 
                        *
                        * 

                      Usage

                      - * The @XmlIDREF annotation can be used with the following + * The @XmlIDREF annotation can be used with the following * program elements: *
                        *
                      • a JavaBean property
                      • @@ -73,14 +73,14 @@ * *
                      • If the type of the field or property is a collection type, * then the collection item type must contain a property or - * field annotated with @XmlID.
                      • + * field annotated with @XmlID. *
                      • If the field or property is single valued, then the type of * the property or field must contain a property or field - * annotated with @XmlID. + * annotated with @XmlID. *

                        Note: If the collection item type or the type of the * property (for non collection type) is java.lang.Object, then * the instance must contain a property/field annotated with - * @XmlID attribute. + * @XmlID attribute. *

                      • *
                      • This annotation can be used with the following annotations: * {@link XmlElement}, {@link XmlAttribute}, {@link XmlList}, @@ -93,11 +93,12 @@ * * //EXAMPLE: Code fragment * public class Shipping { - * {@code @XmlIDREF} public Customer getCustomer(); + * @XmlIDREF public Customer getCustomer(); * public void setCustomer(Customer customer); * .... * } * {@code + * * * * @@ -119,7 +120,7 @@ * public class Customer { * * // map JavaBean property type to xs:ID - * {@code @XmlID} public String getCustomerID(); + * @XmlID public String getCustomerID(); * public void setCustomerID(String id); * * // .... other properties not shown @@ -130,7 +131,7 @@ * public class Invoice { * * // map by reference - * {@code @XmlIDREF} public Customer getCustomer(); + * @XmlIDREF public Customer getCustomer(); * public void setCustomer(Customer customer); * * // .... other properties not shown here @@ -140,13 +141,13 @@ * public class Shipping { * * // map by reference - * {@code @XmlIDREF} public Customer getCustomer(); + * @XmlIDREF public Customer getCustomer(); * public void setCustomer(Customer customer); * } * * // at least one class must reference Customer by containment; * // Customer instances won't be marshalled. - * {@code @XmlElement}(name="CustomerData") + * @XmlElement(name="CustomerData") * public class CustomerData { * // map reference to Customer by containment by default. * public Customer getCustomer(); @@ -157,9 +158,10 @@ * // maps reference to Invoice by containment by default. * public Invoice getInvoice(); * } - * - * * {@code + * + * + * * * * @@ -220,11 +222,12 @@ *
                          *     // Code fragment
                          *     public class Shipping {
                        - *         {@code @XmlIDREF}
                        - *         {@code @XmlElement}(name="Alice")
                        + *         @XmlIDREF
                        + *         @XmlElement(name="Alice")
                          *             public List customers;
                          *     }
                          * {@code
                        + * 
                          *     
                          *     
                          *       
                        @@ -239,13 +242,14 @@
                          * 
                          *     //Code fragment
                          *     public class Shipping {
                        - *         {@code @XmlIDREF}
                        - *         {@code @XmlElements}(
                        - *             {@code @XmlElement}(name="Alice", type="Customer.class")
                        - *             {@code @XmlElement}(name="John", type="InternationalCustomer.class")
                        + *         @XmlIDREF
                        + *         @XmlElements(
                        + *             @XmlElement(name="Alice", type="Customer.class")
                        + *              @XmlElement(name="John", type="InternationalCustomer.class")
                          *         public List customers;
                          *     }
                          * {@code
                        + * 
                          *     
                          *     
                          *       
                        diff --git a/src/main/java/javax/xml/bind/annotation/XmlList.java b/src/main/java/javax/xml/bind/annotation/XmlList.java
                        index 7d09cb01..f551256d 100644
                        --- a/src/main/java/javax/xml/bind/annotation/XmlList.java
                        +++ b/src/main/java/javax/xml/bind/annotation/XmlList.java
                        @@ -65,10 +65,10 @@
                          * For example,
                          *
                          * 
                        - * {@code @XmlRootElement}
                        + * @XmlRootElement
                          * class Foo {
                        - *     {@code @XmlElement}
                        - *     {@code List} data;
                        + *     @XmlElement
                        + *     List<String> data;
                          * }
                          * 
                        * @@ -81,15 +81,15 @@ * * }
                        * - * {@code @XmlList} annotation, on the other hand, allows multiple values to be + * @XmlList annotation, on the other hand, allows multiple values to be * represented as whitespace-separated tokens in a single element. For example, * *
                        - * {@code @XmlRootElement}
                        + * @XmlRootElement
                          * class Foo {
                        - *     {@code @XmlElement}
                        - *     {@code @XmlList}
                        - *     {@code List} data;
                        + *     @XmlElement
                        + *     @XmlList
                        + *     List<String> data;
                          * }
                          * 
                        * diff --git a/src/main/java/javax/xml/bind/annotation/XmlMixed.java b/src/main/java/javax/xml/bind/annotation/XmlMixed.java index 3afce8c6..2a04637d 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlMixed.java +++ b/src/main/java/javax/xml/bind/annotation/XmlMixed.java @@ -57,21 +57,22 @@ *

                        * The usage is subject to the following constraints: *

                          - *
                        • can be used with {@code @XmlElementRef}, {@code @XmlElementRefs} or {@code @XmlAnyElement}
                        • + *
                        • can be used with @XmlElementRef, @XmlElementRefs or @XmlAnyElement
                        • *
                        *

                        - * The following can be inserted into {@code @XmlMixed} annotated multi-valued property + * The following can be inserted into @XmlMixed annotated multi-valued property *

                          *
                        • XML text information items are added as values of java.lang.String.
                        • *
                        • Children element information items are added as instances of * {@link JAXBElement} or instances with a class that is annotated with - * {@code @XmlRootElement}.
                        • + * @XmlRootElement. *
                        • Unknown content that is not be bound to a JAXB mapped class is inserted - * as {@link Element}. (Assumes property annotated with {@code @XmlAnyElement})
                        • + * as {@link Element}. (Assumes property annotated with @XmlAnyElement) *
                        * * Below is an example of binding and creation of mixed content. *
                        {@code
                        + * 
                          *  
                          *  
                          *    
                        @@ -102,11 +103,11 @@
                          * 	// Mixed content can contain instances of Element classes
                          * 	// Name, Quantity and ProductName. Text data is represented as
                          *	// java.util.String for text.
                        - *	{@code @XmlMixed} 
                        - * 	{@code @XmlElementRefs}({
                        - *		{@code @XmlElementRef}(name="productName", type=JAXBElement.class),
                        - *		{@code @XmlElementRef}(name="quantity", type=JAXBElement.class),
                        - *		{@code @XmlElementRef}(name="name", type=JAXBElement.class)})
                        + *	@XmlMixed 
                        + * 	@XmlElementRefs({
                        + *		@XmlElementRef(name="productName", type=JAXBElement.class),
                        + *		@XmlElementRef(name="quantity", type=JAXBElement.class),
                        + *		@XmlElementRef(name="name", type=JAXBElement.class)})
                          *	List getContent(){...}
                          * }
                          * 
                        diff --git a/src/main/java/javax/xml/bind/annotation/XmlRootElement.java b/src/main/java/javax/xml/bind/annotation/XmlRootElement.java index 3c3161a3..a2abc5c8 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlRootElement.java +++ b/src/main/java/javax/xml/bind/annotation/XmlRootElement.java @@ -51,7 +51,7 @@ * *

                        Usage

                        *

                        - * The {@code @XmlRootElement} annotation can be used with the following program + * The @XmlRootElement annotation can be used with the following program * elements: *

                          *
                        • a top level class
                        • @@ -63,7 +63,7 @@ * *

                          * When a top level class or an enum type is annotated with the - * {@code @XmlRootElement} annotation, then its value is represented + * @XmlRootElement annotation, then its value is represented * as XML element in an XML document. * *

                          This annotation can be used with the following annotations: @@ -75,7 +75,7 @@ * Example 1: Associate an element with XML Schema type *

                            *     // Example: Code fragment
                          - *     {@code @XmlRootElement}
                          + *     @XmlRootElement
                            *     class Point {
                            *        int x;
                            *        int y;
                          @@ -89,6 +89,7 @@
                            * 
                          * *
                          {@code
                          + * 
                            *     
                            *     
                            *        3 
                          @@ -101,6 +102,7 @@
                            * the XML schema type to which the class is mapped.
                            *
                            * 
                          {@code
                          + * 
                            *     
                            *     
                            *     
                          @@ -120,7 +122,7 @@
                            * derived types. The following example shows this.
                            * 
                            *     // Example: Code fragment
                          - *     {@code @XmlRootElement}
                          + *     @XmlRootElement
                            *     class Point3D extends Point {
                            *         int z;
                            *         Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
                          @@ -129,6 +131,7 @@
                            *     //Example: Code fragment corresponding to XML output * 
                            *     marshal( new Point3D(3,5,0), System.out );
                            * {@code
                          + * 
                            *     
                            *     
                            *     
                          @@ -154,12 +157,13 @@
                            * to which the class is mapped.
                            * 
                            *     //Example: Code fragment
                          - *     {@code @XmlRootElement}(name="PriceElement")
                          + *     @XmlRootElement(name="PriceElement")
                            *     public class USPrice {
                          - *         {@code @XmlElement}
                          + *         @XmlElement
                            *         public java.math.BigDecimal price;
                            *     }
                            * {@code
                          + * 
                            *     
                            *     
                            *     
                          diff --git a/src/main/java/javax/xml/bind/annotation/XmlSchema.java b/src/main/java/javax/xml/bind/annotation/XmlSchema.java
                          index be56e145..26e7619a 100644
                          --- a/src/main/java/javax/xml/bind/annotation/XmlSchema.java
                          +++ b/src/main/java/javax/xml/bind/annotation/XmlSchema.java
                          @@ -75,10 +75,11 @@
                            * package is mapped.

                          * *
                          - *    {@code @javax.xml.bind.annotation.XmlSchema} (
                          + *    @javax.xml.bind.annotation.XmlSchema (
                            *      namespace = "http://www.example.com/MYPO1"
                            *    )
                            * {@code   
                          + * 
                            *    
                            *    
                            *    // Package level annotation
                          - *    {@code @javax.xml.bind.annotation.XmlSchema} (
                          + *    @javax.xml.bind.annotation.XmlSchema (
                            *      xmlns = { 
                          - *        {@code @javax.xml.bind.annotation.XmlNs}(prefix = "po", 
                          + *        @javax.xml.bind.annotation.XmlNs(prefix = "po", 
                            *                   namespaceURI="http://www.example.com/myPO1"),
                            *
                          - *        {@code @javax.xml.bind.annotation.XmlNs}(prefix="xs",
                          + *        @javax.xml.bind.annotation.XmlNs(prefix="xs",
                            *                   namespaceURI="http://www.w3.org/2001/XMLSchema")
                          - *      )
                          + *      }
                            *    )
                            * {@code
                          + * 
                            *    
                            *    Example 3: Customize elementFormDefault

                          *
                          - *    {@code @javax.xml.bind.annotation.XmlSchema} (
                          + *    @javax.xml.bind.annotation.XmlSchema (
                            *      elementFormDefault=XmlNsForm.UNQUALIFIED
                            *      ...
                            *    )
                            * {@code
                          + * 
                            *    
                            *    "", "##generate", or
                                * 
                                * a valid lexical representation of xs:anyURI that begins
                          -     * with {@code }:.
                          +     * with <scheme>:.
                                *
                                * 

                          * A schema generator is expected to generate a corresponding - * {@code } (or + * <xs:import namespace="..." schemaLocation="..."/> (or * no schemaLocation attribute at all if the empty string is specified.) * However, the schema generator is allowed to use a different value in * the schemaLocation attribute (including not generating diff --git a/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java b/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java index c808d89d..2d573c84 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java +++ b/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java @@ -76,11 +76,12 @@ *

                            *     //Example: Code fragment
                            *     public class USPrice {
                          - *         {@code @XmlElement}
                          - *         {@code @XmlSchemaType}(name="date")
                          + *         @XmlElement
                          + *         @XmlSchemaType(name="date")
                            *         public XMLGregorianCalendar date;
                            *     }
                            * {@code
                          + * 
                            *     
                            *     
                            *       
                          @@ -93,7 +94,7 @@
                            *     level 

                          *
                            *     package foo;
                          - *     {@code @javax.xml.bind.annotation.XmlSchemaType}(
                          + *     @javax.xml.bind.annotation.XmlSchemaType(
                            *          name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
                            *     }
                            * 
                          diff --git a/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java b/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java index 5091fdad..ed6843e4 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java +++ b/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2005-2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005-2013 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 @@ -51,10 +51,10 @@ * *

                          Multiple annotations of the same type are not allowed on a program * element. This annotation therefore serves as a container annotation - * for multiple {@code @XmlSchemaType} annotations as follows: + * for multiple @XmlSchemaType annotations as follows: * *

                          - * {@code @XmlSchemaTypes}({ {@code @XmlSchemaType}(...), {@code @XmlSchemaType}(...) })
                          + * @XmlSchemaTypes({ @XmlSchemaType(...), @XmlSchemaType(...) })
                            * 
                          *

                          The @XmlSchemaTypes annnotation can be used to * define {@link XmlSchemaType} for different types at the diff --git a/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java b/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java index 5ca32d99..0b9f60c9 100644 --- a/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java +++ b/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2006-2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006-2013 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 @@ -73,7 +73,7 @@ *

                          * {@link XmlSeeAlso} annotation would allow you to write: *

                          - * {@code @XmlSeeAlso}({Dog.class,Cat.class})
                          + * @XmlSeeAlso({Dog.class,Cat.class})
                            * class Animal {}
                            * class Dog extends Animal {}
                            * class Cat extends Animal {}
                          diff --git a/src/main/java/javax/xml/bind/annotation/XmlTransient.java b/src/main/java/javax/xml/bind/annotation/XmlTransient.java
                          index 2366f063..0d28bf8a 100644
                          --- a/src/main/java/javax/xml/bind/annotation/XmlTransient.java
                          +++ b/src/main/java/javax/xml/bind/annotation/XmlTransient.java
                          @@ -87,13 +87,14 @@
                            *
                            *       // The field name "name" collides with the property name 
                            *       // obtained by bean decapitalization of getName() below
                          - *       {@code @XmlTransient} public String name;
                          + *       @XmlTransient public String name;
                            *
                            *       String getName() {..};
                            *       String setName() {..};
                            *   }
                            *
                            * {@code   
                          + * 
                            *   
                            *   
                            *     
                          diff --git a/src/main/java/javax/xml/bind/annotation/XmlType.java b/src/main/java/javax/xml/bind/annotation/XmlType.java
                          index 30e364f3..99ecca18 100644
                          --- a/src/main/java/javax/xml/bind/annotation/XmlType.java
                          +++ b/src/main/java/javax/xml/bind/annotation/XmlType.java
                          @@ -79,7 +79,7 @@
                            * mapping of JavaBean properties and fields contained within the
                            * class. The schema type to which the class is mapped can either be
                            * named or anonymous. A class can be mapped to an anonymous schema
                          - * type by annotating the class with @XmlType(name="").
                          + * type by annotating the class with @XmlType(name="").
                            * 

                          * Either a global element, local element or a local attribute can be * associated with an anonymous type as follows: @@ -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: *

                            - *
                          • {@code ->} : 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]+ {@code ->} elements + * [property]+ {@literal ->} elements * complexcontent
                            xs:all * * @@ -155,7 +155,7 @@ * * Class * non empty - * [property]+ {@code ->} elements + * [property]+ {@literal ->} elements * complexcontent
                            xs:sequence * * @@ -163,7 +163,7 @@ * * Class * X - * no property {@code ->} element + * no property {@literal ->} element * complexcontent
                            empty sequence * * @@ -171,7 +171,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
                            [property]+ {@code ->} attributes + * 1 [@XmlValue property] {@literal &&}
                            [property]+ {@literal ->} attributes * simplecontent * * @@ -179,7 +179,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
                            no properties {@code ->} attribute + * 1 [@XmlValue property] {@literal &&}
                            no properties {@literal ->} attribute * * simpletype * @@ -206,7 +206,7 @@ *

                            * *
                            - *   {@code @XmlType}(propOrder={"street", "city" , "state", "zip", "name" })
                            + *   @XmlType(propOrder={"street", "city" , "state", "zip", "name" })
                              *   public class USAddress {
                              *     String getName() {..};
                              *     void setName(String) {..};
                            @@ -224,6 +224,7 @@
                              *     void setZip(java.math.BigDecimal) {..};
                              *   }
                              * {@code
                            + * 
                              *   
                              *   
                              *     
                            @@ -238,9 +239,10 @@
                              * 

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

                            *
                            - * {@code @XmlType}(propOrder={})
                            + * @XmlType(propOrder={})
                              * public class USAddress { ...}
                              * {@code
                            + * 
                              * 
                              * 
                              *   
                            @@ -256,10 +258,11 @@
                              * anonymous type. 
                              * 

                            *
                            - *   {@code @XmlRootElement}
                            - *   {@code @XmlType}(name="")
                            + *   @XmlRootElement
                            + *   @XmlType(name="")
                              *   public class USAddress { ...}
                              * {@code
                            + * 
                              *   
                              *   
                              *     
                            @@ -283,10 +286,11 @@
                              *           ...
                              *       }
                              *
                            - *   {@code @XmlType}(name="")
                            + *   @XmlType(name="")
                              *   public class USAddress { ... }
                              *   } 
                              * {@code
                            + * 
                              *   
                              *   
                              *     
                            @@ -311,17 +315,18 @@
                              *     //Example: Code fragment
                              *     public class Item {
                              *         public String name;
                            - *         {@code @XmlAttribute} 
                            + *         @XmlAttribute 
                              *         public USPrice price;
                              *     }
                              *    
                              *     // map class to anonymous simple type. 
                            - *     {@code @XmlType(name="")}
                            + *     @XmlType(name="")
                              *     public class USPrice { 
                            - *         {@code @XmlValue}
                            + *         @XmlValue
                              *         public java.math.BigDecimal price;
                              *     }
                              * {@code
                            + * 
                              *     
                              *     
                              *       
                            @@ -338,7 +343,7 @@
                              *  

                            Example 6: Define a factoryClass and factoryMethod * *

                             
                            - *      {@code @XmlType}(name="USAddressType", factoryClass=USAddressFactory.class,
                            + *      @XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
                              *      factoryMethod="getUSAddress")
                              *      public class USAddress {
                              *
                            @@ -369,7 +374,7 @@
                              *  

                            Example 7: Define factoryMethod and use the default factoryClass * *

                            - *      {@code @XmlType}(name="USAddressType", factoryMethod="getNewInstance")
                            + *      @XmlType(name="USAddressType", factoryMethod="getNewInstance")
                              *      public class USAddress {
                              *
                              *          private String city;
                            diff --git a/src/main/java/javax/xml/bind/annotation/XmlValue.java b/src/main/java/javax/xml/bind/annotation/XmlValue.java
                            index 2378c48b..4dfa5762 100644
                            --- a/src/main/java/javax/xml/bind/annotation/XmlValue.java
                            +++ b/src/main/java/javax/xml/bind/annotation/XmlValue.java
                            @@ -99,10 +99,11 @@
                              * 
                              *     // Example 1: Code fragment
                              *     public class USPrice {
                            - *         {@code @XmlValue}
                            + *         @XmlValue
                              *         public java.math.BigDecimal price;
                              *     }
                            - * {@code 
                            + * {@code
                            + * 
                              *     
                              *     
                              *       
                            @@ -117,13 +118,14 @@
                              *
                              *   // Example 2: Code fragment
                              *   public class InternationalPrice {
                            - *       {@code @XmlValue}
                            + *       @XmlValue
                              *       public java.math.BigDecimal price;
                              * 
                            - *       {@code @XmlAttribute}
                            + *       @XmlAttribute
                              *       public String currency;
                              *   }
                            - * {@code 
                            + * {@code
                            + * 
                              *   
                              *   
                              *     
                            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 c595ddf4..d3170974 100644
                            --- a/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
                            +++ b/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
                            @@ -85,7 +85,7 @@
                              *
                              * 

                            Example: Customized mapping of HashMap

                            *

                            The following example illustrates the use of - * {@code @XmlAdapter} and {@code @XmlJavaTypeAdapter} to + * @XmlAdapter and @XmlJavaTypeAdapter to * customize the mapping of a HashMap. * *

                            Step 1: Determine the desired XML representation for HashMap. @@ -125,14 +125,14 @@ * *

                              *     public class MyHashMapType {
                            - *         {@code List} entry;
                            + *         List<MyHashMapEntryType> entry;
                              *     }
                              *
                              *     public class MyHashMapEntryType {
                            - *         {@code @XmlAttribute}
                            + *         @XmlAttribute
                              *         public Integer key; 
                              *
                            - *         {@code @XmlValue}
                            + *         @XmlValue
                              *         public String value;
                              *     }
                              * 
                            @@ -150,7 +150,7 @@ * *
                              *     public class Foo {
                            - *         {@code @XmlJavaTypeAdapter(MyHashMapAdapter.class)}
                            + *         @XmlJavaTypeAdapter(MyHashMapAdapter.class)
                              *         HashMap hashmap;
                              *         ...
                              *     }
                            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 a759ec59..ecf0491c 100644
                            --- a/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
                            +++ b/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
                            @@ -51,10 +51,10 @@
                              *
                              * 

                            Multiple annotations of the same type are not allowed on a program * element. This annotation therefore serves as a container annotation - * for multiple {@code @XmlJavaTypeAdapter} as follows: + * for multiple @XmlJavaTypeAdapter as follows: * *

                            - * {@code @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) })}
                            + * @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) })
                              * 
                            * *

                            The @XmlJavaTypeAdapters annotation is useful for