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 Mon Jun 02 17:48:55 PDT 2014 --> 6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 7<title>JsonDeserialize (jackson-databind 2.4.0 API)</title> 8<meta name="date" content="2014-06-02"> 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="JsonDeserialize (jackson-databind 2.4.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="../../../../../overview-summary.html">Overview</a></li> 29<li><a href="package-summary.html">Package</a></li> 30<li class="navBarCell1Rev">Class</li> 31<li><a href="class-use/JsonDeserialize.html">Use</a></li> 32<li><a href="package-tree.html">Tree</a></li> 33<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 34<li><a href="../../../../../index-all.html">Index</a></li> 35<li><a href="../../../../../help-doc.html">Help</a></li> 36</ul> 37</div> 38<div class="subNav"> 39<ul class="navList"> 40<li><a href="../../../../../com/fasterxml/jackson/databind/annotation/JacksonStdImpl.html" title="annotation in com.fasterxml.jackson.databind.annotation"><span class="strong">Prev Class</span></a></li> 41<li><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonNaming.html" title="annotation in com.fasterxml.jackson.databind.annotation"><span class="strong">Next Class</span></a></li> 42</ul> 43<ul class="navList"> 44<li><a href="../../../../../index.html?com/fasterxml/jackson/databind/annotation/JsonDeserialize.html" target="_top">Frames</a></li> 45<li><a href="JsonDeserialize.html" target="_top">No Frames</a></li> 46</ul> 47<ul class="navList" id="allclasses_navbar_top"> 48<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> 49</ul> 50<div> 51<script type="text/javascript"><!-- 52 allClassesLink = document.getElementById("allclasses_navbar_top"); 53 if(window==top) { 54 allClassesLink.style.display = "block"; 55 } 56 else { 57 allClassesLink.style.display = "none"; 58 } 59 //--> 60</script> 61</div> 62<div> 63<ul class="subNavList"> 64<li>Summary: </li> 65<li>Required | </li> 66<li><a href="#annotation_type_optional_element_summary">Optional</a></li> 67</ul> 68<ul class="subNavList"> 69<li>Detail: </li> 70<li><a href="#annotation_type_element_detail">Element</a></li> 71</ul> 72</div> 73<a name="skip-navbar_top"> 74<!-- --> 75</a></div> 76<!-- ========= END OF TOP NAVBAR ========= --> 77<!-- ======== START OF CLASS DATA ======== --> 78<div class="header"> 79<div class="subTitle">com.fasterxml.jackson.databind.annotation</div> 80<h2 title="Annotation Type JsonDeserialize" class="title">Annotation Type JsonDeserialize</h2> 81</div> 82<div class="contentContainer"> 83<div class="description"> 84<ul class="blockList"> 85<li class="blockList"> 86<hr> 87<br> 88<pre><a href="http://docs.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://docs.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://docs.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://docs.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://docs.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://docs.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://docs.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>}) 89<a href="http://docs.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://docs.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://docs.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>) 90public @interface <span class="strong">JsonDeserialize</span></pre> 91<div class="block">Annotation use for configuring deserialization aspects, by attaching 92 to "setter" methods or fields, or to value classes. 93 When annotating value classes, configuration is used for instances 94 of the value class but can be overridden by more specific annotations 95 (ones that attach to methods or fields). 96<p> 97 An example annotation would be: 98<pre> 99 @JsonDeserialize(using=MySerializer.class, 100 as=MyHashMap.class, 101 keyAs=MyHashKey.class, 102 contentAs=MyHashValue.class 103 ) 104</pre> 105<p></div> 106</li> 107</ul> 108</div> 109<div class="summary"> 110<ul class="blockList"> 111<li class="blockList"> 112<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> 113<ul class="blockList"> 114<li class="blockList"><a name="annotation_type_optional_element_summary"> 115<!-- --> 116</a> 117<h3>Optional Element Summary</h3> 118<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation"> 119<caption><span>Optional Elements</span><span class="tabEnd"> </span></caption> 120<tr> 121<th class="colFirst" scope="col">Modifier and Type</th> 122<th class="colLast" scope="col">Optional Element and Description</th> 123</tr> 124<tr class="altColor"> 125<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?></code></td> 126<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#as()">as</a></strong></code> 127<div class="block">Concrete type to deserialize values as, instead of type otherwise 128 declared.</div> 129</td> 130</tr> 131<tr class="rowColor"> 132<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?></code></td> 133<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#builder()">builder</a></strong></code> 134<div class="block">Annotation for specifying if an external Builder class is to 135 be used for building up deserialized instances of annotated 136 class.</div> 137</td> 138</tr> 139<tr class="altColor"> 140<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?></code></td> 141<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#contentAs()">contentAs</a></strong></code> 142<div class="block">Concrete type to deserialize content (elements 143 of a Collection/array, values of Maps) values as, 144 instead of type otherwise declared.</div> 145</td> 146</tr> 147<tr class="rowColor"> 148<td class="colFirst"><code><a href="http://docs.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/databind/util/Converter.html" title="interface in com.fasterxml.jackson.databind.util">Converter</a><?,?>></code></td> 149<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#contentConverter()">contentConverter</a></strong></code> 150<div class="block">Similar to <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#converter()"><code>converter()</code></a>, but used for values of structures types 151 (List, arrays, Maps).</div> 152</td> 153</tr> 154<tr class="altColor"> 155<td class="colFirst"><code><a href="http://docs.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/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?>></code></td> 156<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#contentUsing()">contentUsing</a></strong></code> 157<div class="block">Deserializer class to use for deserializing contents (elements 158 of a Collection/array, values of Maps) of annotated property.</div> 159</td> 160</tr> 161<tr class="rowColor"> 162<td class="colFirst"><code><a href="http://docs.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/databind/util/Converter.html" title="interface in com.fasterxml.jackson.databind.util">Converter</a><?,?>></code></td> 163<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#converter()">converter</a></strong></code> 164<div class="block">Which helper object (if any) is to be used to convert from Jackson-bound 165 intermediate type (source type of converter) into actual property type 166 (which must be same as result type of converter).</div> 167</td> 168</tr> 169<tr class="altColor"> 170<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?></code></td> 171<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#keyAs()">keyAs</a></strong></code> 172<div class="block">Concrete type to deserialize keys of <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><code>Map</code></a> as, 173 instead of type otherwise declared.</div> 174</td> 175</tr> 176<tr class="rowColor"> 177<td class="colFirst"><code><a href="http://docs.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/databind/KeyDeserializer.html" title="class in com.fasterxml.jackson.databind">KeyDeserializer</a>></code></td> 178<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#keyUsing()">keyUsing</a></strong></code> 179<div class="block">Deserializer class to use for deserializing Map keys 180 of annotated property.</div> 181</td> 182</tr> 183<tr class="altColor"> 184<td class="colFirst"><code><a href="http://docs.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/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?>></code></td> 185<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#using()">using</a></strong></code> 186<div class="block">Deserializer class to use for deserializing associated value.</div> 187</td> 188</tr> 189</table> 190</li> 191</ul> 192</li> 193</ul> 194</div> 195<div class="details"> 196<ul class="blockList"> 197<li class="blockList"> 198<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== --> 199<ul class="blockList"> 200<li class="blockList"><a name="annotation_type_element_detail"> 201<!-- --> 202</a> 203<h3>Element Detail</h3> 204<a name="using()"> 205<!-- --> 206</a> 207<ul class="blockList"> 208<li class="blockList"> 209<h4>using</h4> 210<pre>public abstract <a href="http://docs.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/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?>> using</pre> 211<div class="block">Deserializer class to use for deserializing associated value. 212 Depending on what is annotated, 213 value is either an instance of annotated class (used globablly 214 anywhere where class deserializer is needed); or only used for 215 deserializing property access via a setter method.</div> 216<dl> 217<dt>Default:</dt> 218<dd>com.fasterxml.jackson.databind.JsonDeserializer.None.class</dd> 219</dl> 220</li> 221</ul> 222<a name="contentUsing()"> 223<!-- --> 224</a> 225<ul class="blockList"> 226<li class="blockList"> 227<h4>contentUsing</h4> 228<pre>public abstract <a href="http://docs.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/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?>> contentUsing</pre> 229<div class="block">Deserializer class to use for deserializing contents (elements 230 of a Collection/array, values of Maps) of annotated property. 231 Can only be used on instances (methods, fields, constructors), 232 and not value classes themselves.</div> 233<dl> 234<dt>Default:</dt> 235<dd>com.fasterxml.jackson.databind.JsonDeserializer.None.class</dd> 236</dl> 237</li> 238</ul> 239<a name="keyUsing()"> 240<!-- --> 241</a> 242<ul class="blockList"> 243<li class="blockList"> 244<h4>keyUsing</h4> 245<pre>public abstract <a href="http://docs.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/databind/KeyDeserializer.html" title="class in com.fasterxml.jackson.databind">KeyDeserializer</a>> keyUsing</pre> 246<div class="block">Deserializer class to use for deserializing Map keys 247 of annotated property. 248 Can only be used on instances (methods, fields, constructors), 249 and not value classes themselves.</div> 250<dl> 251<dt>Default:</dt> 252<dd>com.fasterxml.jackson.databind.KeyDeserializer.None.class</dd> 253</dl> 254</li> 255</ul> 256<a name="builder()"> 257<!-- --> 258</a> 259<ul class="blockList"> 260<li class="blockList"> 261<h4>builder</h4> 262<pre>public abstract <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> builder</pre> 263<div class="block">Annotation for specifying if an external Builder class is to 264 be used for building up deserialized instances of annotated 265 class. If so, an instance of referenced class is first constructed 266 (possibly using a Creator method; or if none defined, using default 267 constructor), and its "with-methods" are used for populating fields; 268 and finally "build-method" is invoked to complete deserialization.</div> 269<dl> 270<dt>Default:</dt> 271<dd>java.lang.Void.class</dd> 272</dl> 273</li> 274</ul> 275<a name="converter()"> 276<!-- --> 277</a> 278<ul class="blockList"> 279<li class="blockList"> 280<h4>converter</h4> 281<pre>public abstract <a href="http://docs.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/databind/util/Converter.html" title="interface in com.fasterxml.jackson.databind.util">Converter</a><?,?>> converter</pre> 282<div class="block">Which helper object (if any) is to be used to convert from Jackson-bound 283 intermediate type (source type of converter) into actual property type 284 (which must be same as result type of converter). This is often used 285 for two-step deserialization; Jackson binds data into suitable intermediate 286 type (like Tree representation), and converter then builds actual property 287 type.</div> 288<dl><dt><span class="strong">Since:</span></dt> 289 <dd>2.2</dd></dl> 290<dl> 291<dt>Default:</dt> 292<dd>com.fasterxml.jackson.databind.util.Converter.None.class</dd> 293</dl> 294</li> 295</ul> 296<a name="contentConverter()"> 297<!-- --> 298</a> 299<ul class="blockList"> 300<li class="blockList"> 301<h4>contentConverter</h4> 302<pre>public abstract <a href="http://docs.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/databind/util/Converter.html" title="interface in com.fasterxml.jackson.databind.util">Converter</a><?,?>> contentConverter</pre> 303<div class="block">Similar to <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#converter()"><code>converter()</code></a>, but used for values of structures types 304 (List, arrays, Maps).</div> 305<dl><dt><span class="strong">Since:</span></dt> 306 <dd>2.2</dd></dl> 307<dl> 308<dt>Default:</dt> 309<dd>com.fasterxml.jackson.databind.util.Converter.None.class</dd> 310</dl> 311</li> 312</ul> 313<a name="as()"> 314<!-- --> 315</a> 316<ul class="blockList"> 317<li class="blockList"> 318<h4>as</h4> 319<pre>public abstract <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> as</pre> 320<div class="block">Concrete type to deserialize values as, instead of type otherwise 321 declared. Must be a subtype of declared type; otherwise an 322 exception may be thrown by deserializer. 323<p> 324 Bogus type <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Void.html?is-external=true" title="class or interface in java.lang"><code>Void</code></a> can be used to indicate that declared 325 type is used as is (i.e. this annotation property has no setting); 326 this since annotation properties are not allowed to have null value. 327<p> 328 Note: if <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#using()"><code>using()</code></a> is also used it has precedence 329 (since it directly specified 330 deserializer, whereas this would only be used to locate the 331 deserializer) 332 and value of this annotation property is ignored.</div> 333<dl> 334<dt>Default:</dt> 335<dd>java.lang.Void.class</dd> 336</dl> 337</li> 338</ul> 339<a name="keyAs()"> 340<!-- --> 341</a> 342<ul class="blockList"> 343<li class="blockList"> 344<h4>keyAs</h4> 345<pre>public abstract <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> keyAs</pre> 346<div class="block">Concrete type to deserialize keys of <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><code>Map</code></a> as, 347 instead of type otherwise declared. 348 Must be a subtype of declared type; otherwise an exception may be 349 thrown by deserializer.</div> 350<dl> 351<dt>Default:</dt> 352<dd>java.lang.Void.class</dd> 353</dl> 354</li> 355</ul> 356<a name="contentAs()"> 357<!-- --> 358</a> 359<ul class="blockListLast"> 360<li class="blockList"> 361<h4>contentAs</h4> 362<pre>public abstract <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> contentAs</pre> 363<div class="block">Concrete type to deserialize content (elements 364 of a Collection/array, values of Maps) values as, 365 instead of type otherwise declared. 366 Must be a subtype of declared type; otherwise an exception may be 367 thrown by deserializer.</div> 368<dl> 369<dt>Default:</dt> 370<dd>java.lang.Void.class</dd> 371</dl> 372</li> 373</ul> 374</li> 375</ul> 376</li> 377</ul> 378</div> 379</div> 380<!-- ========= END OF CLASS DATA ========= --> 381<!-- ======= START OF BOTTOM NAVBAR ====== --> 382<div class="bottomNav"><a name="navbar_bottom"> 383<!-- --> 384</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 385<!-- --> 386</a> 387<ul class="navList" title="Navigation"> 388<li><a href="../../../../../overview-summary.html">Overview</a></li> 389<li><a href="package-summary.html">Package</a></li> 390<li class="navBarCell1Rev">Class</li> 391<li><a href="class-use/JsonDeserialize.html">Use</a></li> 392<li><a href="package-tree.html">Tree</a></li> 393<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 394<li><a href="../../../../../index-all.html">Index</a></li> 395<li><a href="../../../../../help-doc.html">Help</a></li> 396</ul> 397</div> 398<div class="subNav"> 399<ul class="navList"> 400<li><a href="../../../../../com/fasterxml/jackson/databind/annotation/JacksonStdImpl.html" title="annotation in com.fasterxml.jackson.databind.annotation"><span class="strong">Prev Class</span></a></li> 401<li><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonNaming.html" title="annotation in com.fasterxml.jackson.databind.annotation"><span class="strong">Next Class</span></a></li> 402</ul> 403<ul class="navList"> 404<li><a href="../../../../../index.html?com/fasterxml/jackson/databind/annotation/JsonDeserialize.html" target="_top">Frames</a></li> 405<li><a href="JsonDeserialize.html" target="_top">No Frames</a></li> 406</ul> 407<ul class="navList" id="allclasses_navbar_bottom"> 408<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> 409</ul> 410<div> 411<script type="text/javascript"><!-- 412 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 413 if(window==top) { 414 allClassesLink.style.display = "block"; 415 } 416 else { 417 allClassesLink.style.display = "none"; 418 } 419 //--> 420</script> 421</div> 422<div> 423<ul class="subNavList"> 424<li>Summary: </li> 425<li>Required | </li> 426<li><a href="#annotation_type_optional_element_summary">Optional</a></li> 427</ul> 428<ul class="subNavList"> 429<li>Detail: </li> 430<li><a href="#annotation_type_element_detail">Element</a></li> 431</ul> 432</div> 433<a name="skip-navbar_bottom"> 434<!-- --> 435</a></div> 436<!-- ======== END OF BOTTOM NAVBAR ======= --> 437<p class="legalCopy"><small>Copyright © 2014 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p> 438</body> 439</html> 440