Top Description Methods
org.eclipse.persistence.oxm.annotations

public @Interface XmlPaths

extends Annotation
Annotations
@Target:FIELD, METHOD
@Retention:RUNTIME
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Purpose: This annotation is used in conjunction with an XmlElements annotation to specify an XmlPath for each of the XmlElement annotations in the XmlElements. The number of XmlPath annotations must be the same as the number of XmlElement annotations and the order must be the same.

Example:
 @XmlRootElement(name="customer")
 public class Customer {
    ...
    @XmlElements({@XmlElement(type=String.class), @XmlElement(type=Integer.class)})
    @XmlPaths({@XmlPath("choice-element/string/text()"), @XmlPath("choice-element/integer/text()")})
    public Object choice
    ...
 }


Will create the following Schema:

   ...
   <xsd:choice>
      <xsd:element name="choice-element" minOccurs="0">
         <xsd:complexType>
            <xsd:choice>
               <xsd:element name="string" type="xsd:string" minOccurs="0"/>
               <xsd:element name="integer" type="xsd:int" minOccurs="0"/>
            </xsd:choice>
         </xsd:complexType>
      </xsd:element>
   </xsd:choice>
   ...

Method Summary

Modifier and TypeMethod and Description
public XmlPath[]
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public XmlPath[] value()