Annotation Type XmlKey

  • @Target({METHOD,FIELD})
    public @interface XmlKey

    XmlKey is used to mark a property as a key, to be referenced using a key-based mapping via XmlJoinNode. This is similar to the XmlID annotation, but doesn't require the property be bound to the schema type ID. XmlKey is typically used in the composite key use case, since only 1 property can be annotated with the XmlID annotation.


     public class Employee {
         public String id;
         public String department;
             @XmlJoinNode(xmlPath="manager/id/text()", referencedXmlPath="id/text()"),
             @XmlJoinNode(xmlPath="manager/dept/text()", referencedXmlPath="department/text()")
         public Employee manager;
    See Also:
    XmlJoinNode, XmlJoinNodes