EclipseLink 2.1.2, build 'v20101206-r8635' API Reference

org.eclipse.persistence.oxm.annotations
Annotation Type XmlPath


@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface XmlPath

This annotation allows a user to specify an xpath instead of an element name. It can be used in conjunction with JAXB Annotations to provide a higher level of customisation to the mappings. The following types of paths are supported:

Example:
 @XmlRootElement(name="customer")
 public class Customer {
    ...
    @XmlPath("personal-info/first-name/text()")
    @XmlElement
    public String firstName
    @XmlPath("contact-info/address[1]")
    public Address homeAddress;
    @XmlPath("contact-info/address[2]")
    public Address workAddress;
    ...
 }


Required Element Summary
 java.lang.String value
           
 

Element Detail

value

public abstract java.lang.String value

EclipseLink 2.1.2, build 'v20101206-r8635' API Reference