| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (version 1.7.0_11) on Wed Sep 18 01:54:20 EDT 2013 --> |
| <title>XmlID (EclipseLink 2.5.1, build 'v20130918-f2b9fc5' API Reference)</title> |
| <meta name="date" content="2013-09-18"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="XmlID (EclipseLink 2.5.1, build 'v20130918-f2b9fc5' API Reference)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><em>EclipseLink 2.5.1, build 'v20130918-f2b9fc5' API Reference</em></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../javax/xml/bind/annotation/XmlEnumValue.html" title="annotation in javax.xml.bind.annotation"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../javax/xml/bind/annotation/XmlIDREF.html" title="annotation in javax.xml.bind.annotation"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?javax/xml/bind/annotation/XmlID.html" target="_top">Frames</a></li> |
| <li><a href="XmlID.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Required | </li> |
| <li>Optional</li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Element</li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">javax.xml.bind.annotation</div> |
| <h2 title="Annotation Type XmlID" class="title">Annotation Type XmlID</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>@Retention(value=RUNTIME) |
| @Target(value={FIELD,METHOD}) |
| public @interface <span class="strong">XmlID</span></pre> |
| <div class="block"><p> |
| Maps a JavaBean property to XML ID. |
| |
| <p> |
| 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 <tt>@XmlID</tt> and <tt>@XmlIDREF</tt> |
| together allow a customized mapping of a JavaBean property's |
| type by containment or reference. |
| |
| <p><b>Usage</b> </p> |
| The <tt>@XmlID</tt> annotation can be used with the following |
| program elements: |
| <ul> |
| <li> a JavaBean property </li> |
| <li> non static, non transient field </li> |
| </ul> |
| |
| <p>See "Package Specification" in javax.xml.bind.package javadoc for |
| additional common information.</p> |
| |
| The usage is subject to the following constraints: |
| <ul> |
| <li> At most one field or property in a class can be annotated |
| with <tt>@XmlID</tt>. </li> |
| <li> The JavaBean property's type must be <tt>java.lang.String</tt>.</li> |
| <li> The only other mapping annotations that can be used |
| with <tt>@XmlID</tt> |
| are:<tt>@XmlElement</tt> and <tt>@XmlAttribute</tt>.</li> |
| </ul> |
| |
| <p><b>Example</b>: Map a JavaBean property's type to <tt>xs:ID</tt></p> |
| <pre> |
| // Example: code fragment |
| public class Customer { |
| @XmlAttribute |
| @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> |
| .... |
| </xs:sequence> |
| <xs:attribute name="customerID" type="xs:ID"/> |
| </xs:complexContent> |
| </xs:complexType> |
| </pre></div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../javax/xml/bind/annotation/XmlIDREF.html" title="annotation in javax.xml.bind.annotation"><code>XmlIDREF</code></a></dd><dt><span class="strong">Author:</span></dt> |
| <dd>Sekhar Vajjhala, Sun Microsystems, Inc.</dd> |
| <dt><span class="strong">Since:</span></dt> |
| <dd>JAXB2.0</dd></dl> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><em>EclipseLink 2.5.1, build 'v20130918-f2b9fc5' API Reference</em></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../javax/xml/bind/annotation/XmlEnumValue.html" title="annotation in javax.xml.bind.annotation"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../javax/xml/bind/annotation/XmlIDREF.html" title="annotation in javax.xml.bind.annotation"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?javax/xml/bind/annotation/XmlID.html" target="_top">Frames</a></li> |
| <li><a href="XmlID.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Required | </li> |
| <li>Optional</li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Element</li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |