Annotation Interface XmlIdentifier


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface XmlIdentifier
This annotation denotes the single Xml attribute or element that should be used as the unique (within the xpath) identifier. The type of this Xml attribute or element must be String. There may only be one attribute or element in the Java bean that uses this annotation

This annotation is very much like the standard JAXB annotation XmlID except that the uniqueness of this field need only be per xpath from the root, and not over the entire tree. For example, consider a Java Bean such as a PropertyBean that is used all over the tree for those Beans that have a set of properties. The PropertyBean might have identical keys in two different xpaths from the root, and therefore could not use XmlID, since the XmlID requires uniqueness over the entire tree, and not over just one xpath

Furthermore, whereas XmlID can be referred to with XmlIDREF there is no corresponding automatic reference with this annotation. If both XmlID and this annotation are found on different properties of this bean then this annotation will be used in preference over XmlID

Author:
jwells