1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<!-- NewPage --> 3<html lang="en"> 4<head> 5<!-- Generated by javadoc (version 1.7.0_25) on Wed Nov 13 20:23:19 PST 2013 --> 6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 7<title>JsonIdentityInfo (Jackson-annotations 2.3.0 API)</title> 8<meta name="date" content="2013-11-13"> 9<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> 10</head> 11<body> 12<script type="text/javascript"><!-- 13 if (location.href.indexOf('is-external=true') == -1) { 14 parent.document.title="JsonIdentityInfo (Jackson-annotations 2.3.0 API)"; 15 } 16//--> 17</script> 18<noscript> 19<div>JavaScript is disabled on your browser.</div> 20</noscript> 21<!-- ========= START OF TOP NAVBAR ======= --> 22<div class="topNav"><a name="navbar_top"> 23<!-- --> 24</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> 25<!-- --> 26</a> 27<ul class="navList" title="Navigation"> 28<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li> 29<li class="navBarCell1Rev">Class</li> 30<li><a href="class-use/JsonIdentityInfo.html">Use</a></li> 31<li><a href="package-tree.html">Tree</a></li> 32<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 33<li><a href="../../../../index-all.html">Index</a></li> 34<li><a href="../../../../help-doc.html">Help</a></li> 35</ul> 36</div> 37<div class="subNav"> 38<ul class="navList"> 39<li><a href="../../../../com/fasterxml/jackson/annotation/JsonGetter.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li> 40<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li> 41</ul> 42<ul class="navList"> 43<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonIdentityInfo.html" target="_top">Frames</a></li> 44<li><a href="JsonIdentityInfo.html" target="_top">No Frames</a></li> 45</ul> 46<ul class="navList" id="allclasses_navbar_top"> 47<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 48</ul> 49<div> 50<script type="text/javascript"><!-- 51 allClassesLink = document.getElementById("allclasses_navbar_top"); 52 if(window==top) { 53 allClassesLink.style.display = "block"; 54 } 55 else { 56 allClassesLink.style.display = "none"; 57 } 58 //--> 59</script> 60</div> 61<div> 62<ul class="subNavList"> 63<li>Summary: </li> 64<li><a href="#annotation_type_required_element_summary">Required</a> | </li> 65<li><a href="#annotation_type_optional_element_summary">Optional</a></li> 66</ul> 67<ul class="subNavList"> 68<li>Detail: </li> 69<li><a href="#annotation_type_element_detail">Element</a></li> 70</ul> 71</div> 72<a name="skip-navbar_top"> 73<!-- --> 74</a></div> 75<!-- ========= END OF TOP NAVBAR ========= --> 76<!-- ======== START OF CLASS DATA ======== --> 77<div class="header"> 78<div class="subTitle">com.fasterxml.jackson.annotation</div> 79<h2 title="Annotation Type JsonIdentityInfo" class="title">Annotation Type JsonIdentityInfo</h2> 80</div> 81<div class="contentContainer"> 82<div class="description"> 83<ul class="blockList"> 84<li class="blockList"> 85<hr> 86<br> 87<pre><a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Target.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</a>={<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#ANNOTATION_TYPE" title="class or interface in java.lang.annotation">ANNOTATION_TYPE</a>,<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#TYPE" title="class or interface in java.lang.annotation">TYPE</a>,<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#FIELD" title="class or interface in java.lang.annotation">FIELD</a>,<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#METHOD" title="class or interface in java.lang.annotation">METHOD</a>,<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#PARAMETER" title="class or interface in java.lang.annotation">PARAMETER</a>}) 88<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Retention.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</a>=<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</a>) 89public @interface <span class="strong">JsonIdentityInfo</span></pre> 90<div class="block">Annotation used for indicating that values of annotated type 91 or property should be serializing so that instances either 92 contain additional object identifier (in addition actual object 93 properties), or as a reference that consists of an object id 94 that refers to a full serialization. In practice this is done 95 by serializing the first instance as full object and object 96 identity, and other references to the object as reference values. 97<p> 98 There are two main approaches to generating object identifier: 99 either using a generator (either one of standard ones, or a custom 100 generator), or using a value of a property. The latter case is 101 indicated by using a placeholder generator marker 102 <a href="../../../../com/fasterxml/jackson/annotation/ObjectIdGenerators.PropertyGenerator.html" title="class in com.fasterxml.jackson.annotation"><code>ObjectIdGenerators.PropertyGenerator</code></a>; former by using explicit generator. 103 Object id has to be serialized as a property in case of POJOs; 104 object identity is currently NOT support for JSON Array types 105 (Java arrays or Lists) or Java Map types. 106<p> 107 Finally, note that generator type of <a href="../../../../com/fasterxml/jackson/annotation/ObjectIdGenerators.None.html" title="class in com.fasterxml.jackson.annotation"><code>ObjectIdGenerators.None</code></a> 108 indicates that no Object Id should be included or used: it is included 109 to allow suppressing Object Ids using mix-in annotations.</div> 110<dl><dt><span class="strong">Since:</span></dt> 111 <dd>2.0</dd></dl> 112</li> 113</ul> 114</div> 115<div class="summary"> 116<ul class="blockList"> 117<li class="blockList"> 118<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== --> 119<ul class="blockList"> 120<li class="blockList"><a name="annotation_type_required_element_summary"> 121<!-- --> 122</a> 123<h3>Required Element Summary</h3> 124<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Required Element Summary table, listing required elements, and an explanation"> 125<caption><span>Required Elements</span><span class="tabEnd"> </span></caption> 126<tr> 127<th class="colFirst" scope="col">Modifier and Type</th> 128<th class="colLast" scope="col">Required Element and Description</th> 129</tr> 130<tr class="altColor"> 131<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><? extends <a href="../../../../com/fasterxml/jackson/annotation/ObjectIdGenerator.html" title="class in com.fasterxml.jackson.annotation">ObjectIdGenerator</a><?>></code></td> 132<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityInfo.html#generator()">generator</a></strong></code> 133<div class="block">Generator to use for producing Object Identifier for objects: 134 either one of pre-defined generators from 135 <a href="../../../../com/fasterxml/jackson/annotation/ObjectIdGenerator.html" title="class in com.fasterxml.jackson.annotation"><code>ObjectIdGenerator</code></a>, or a custom generator.</div> 136</td> 137</tr> 138</table> 139</li> 140</ul> 141<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> 142<ul class="blockList"> 143<li class="blockList"><a name="annotation_type_optional_element_summary"> 144<!-- --> 145</a> 146<h3>Optional Element Summary</h3> 147<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation"> 148<caption><span>Optional Elements</span><span class="tabEnd"> </span></caption> 149<tr> 150<th class="colFirst" scope="col">Modifier and Type</th> 151<th class="colLast" scope="col">Optional Element and Description</th> 152</tr> 153<tr class="altColor"> 154<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> 155<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityInfo.html#property()">property</a></strong></code> 156<div class="block">Name of JSON property in which Object Id will reside: also, 157 if "from property" marker generator is used, identifies 158 property that will be accessed to get type id.</div> 159</td> 160</tr> 161<tr class="rowColor"> 162<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?></code></td> 163<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityInfo.html#scope()">scope</a></strong></code> 164<div class="block">Scope is used to define applicability of an Object Id: all ids 165 must be unique within their scope; where scope is defined 166 as combination of this value and generator type.</div> 167</td> 168</tr> 169</table> 170</li> 171</ul> 172</li> 173</ul> 174</div> 175<div class="details"> 176<ul class="blockList"> 177<li class="blockList"> 178<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== --> 179<ul class="blockList"> 180<li class="blockList"><a name="annotation_type_element_detail"> 181<!-- --> 182</a> 183<h3>Element Detail</h3> 184<a name="generator()"> 185<!-- --> 186</a> 187<ul class="blockListLast"> 188<li class="blockList"> 189<h4>generator</h4> 190<pre>public abstract <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><? extends <a href="../../../../com/fasterxml/jackson/annotation/ObjectIdGenerator.html" title="class in com.fasterxml.jackson.annotation">ObjectIdGenerator</a><?>> generator</pre> 191<div class="block">Generator to use for producing Object Identifier for objects: 192 either one of pre-defined generators from 193 <a href="../../../../com/fasterxml/jackson/annotation/ObjectIdGenerator.html" title="class in com.fasterxml.jackson.annotation"><code>ObjectIdGenerator</code></a>, or a custom generator. 194 Defined as class to instantiate. 195<p> 196 Note that special type 197 <a href="../../../../com/fasterxml/jackson/annotation/ObjectIdGenerators.None.html" title="class in com.fasterxml.jackson.annotation"><code>ObjectIdGenerators.None</code></a> 198 can be used to disable inclusion of Object Ids.</div> 199</li> 200</ul> 201<a name="property()"> 202<!-- --> 203</a> 204<ul class="blockList"> 205<li class="blockList"> 206<h4>property</h4> 207<pre>public abstract <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> property</pre> 208<div class="block">Name of JSON property in which Object Id will reside: also, 209 if "from property" marker generator is used, identifies 210 property that will be accessed to get type id. 211 If a property is used, name must match its external 212 name (one defined by annotation, or derived from accessor 213 name as per Java Bean Introspection rules). 214<p> 215 Default value is <code>@id</code>.</div> 216<dl> 217<dt>Default:</dt> 218<dd>"@id"</dd> 219</dl> 220</li> 221</ul> 222<a name="scope()"> 223<!-- --> 224</a> 225<ul class="blockListLast"> 226<li class="blockList"> 227<h4>scope</h4> 228<pre>public abstract <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> scope</pre> 229<div class="block">Scope is used to define applicability of an Object Id: all ids 230 must be unique within their scope; where scope is defined 231 as combination of this value and generator type. 232 Comparison is simple equivalence, meaning that both type 233 generator type and scope class must be the same. 234<p> 235 Scope is used for determining how many generators are needed; 236 more than one scope is typically only needed if external Object Ids 237 have overlapping value domains (i.e. are only unique within some 238 limited scope)</div> 239<dl> 240<dt>Default:</dt> 241<dd>java.lang.Object.class</dd> 242</dl> 243</li> 244</ul> 245</li> 246</ul> 247</li> 248</ul> 249</div> 250</div> 251<!-- ========= END OF CLASS DATA ========= --> 252<!-- ======= START OF BOTTOM NAVBAR ====== --> 253<div class="bottomNav"><a name="navbar_bottom"> 254<!-- --> 255</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 256<!-- --> 257</a> 258<ul class="navList" title="Navigation"> 259<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li> 260<li class="navBarCell1Rev">Class</li> 261<li><a href="class-use/JsonIdentityInfo.html">Use</a></li> 262<li><a href="package-tree.html">Tree</a></li> 263<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 264<li><a href="../../../../index-all.html">Index</a></li> 265<li><a href="../../../../help-doc.html">Help</a></li> 266</ul> 267</div> 268<div class="subNav"> 269<ul class="navList"> 270<li><a href="../../../../com/fasterxml/jackson/annotation/JsonGetter.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li> 271<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li> 272</ul> 273<ul class="navList"> 274<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonIdentityInfo.html" target="_top">Frames</a></li> 275<li><a href="JsonIdentityInfo.html" target="_top">No Frames</a></li> 276</ul> 277<ul class="navList" id="allclasses_navbar_bottom"> 278<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 279</ul> 280<div> 281<script type="text/javascript"><!-- 282 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 283 if(window==top) { 284 allClassesLink.style.display = "block"; 285 } 286 else { 287 allClassesLink.style.display = "none"; 288 } 289 //--> 290</script> 291</div> 292<div> 293<ul class="subNavList"> 294<li>Summary: </li> 295<li><a href="#annotation_type_required_element_summary">Required</a> | </li> 296<li><a href="#annotation_type_optional_element_summary">Optional</a></li> 297</ul> 298<ul class="subNavList"> 299<li>Detail: </li> 300<li><a href="#annotation_type_element_detail">Element</a></li> 301</ul> 302</div> 303<a name="skip-navbar_bottom"> 304<!-- --> 305</a></div> 306<!-- ======== END OF BOTTOM NAVBAR ======= --> 307<p class="legalCopy"><small>Copyright © 2012-2013 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p> 308</body> 309</html> 310