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 Thu Jan 01 17:43:54 PST 2015 --> 6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 7<title>JsonDeserializer (jackson-databind 2.5.0 API)</title> 8<meta name="date" content="2015-01-01"> 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="JsonDeserializer (jackson-databind 2.5.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/JsonDeserializer.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/JavaType.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Prev Class</span></a></li> 41<li><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.None.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Next Class</span></a></li> 42</ul> 43<ul class="navList"> 44<li><a href="../../../../index.html?com/fasterxml/jackson/databind/JsonDeserializer.html" target="_top">Frames</a></li> 45<li><a href="JsonDeserializer.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><a href="#nested_class_summary">Nested</a> | </li> 66<li>Field | </li> 67<li><a href="#constructor_summary">Constr</a> | </li> 68<li><a href="#method_summary">Method</a></li> 69</ul> 70<ul class="subNavList"> 71<li>Detail: </li> 72<li>Field | </li> 73<li><a href="#constructor_detail">Constr</a> | </li> 74<li><a href="#method_detail">Method</a></li> 75</ul> 76</div> 77<a name="skip-navbar_top"> 78<!-- --> 79</a></div> 80<!-- ========= END OF TOP NAVBAR ========= --> 81<!-- ======== START OF CLASS DATA ======== --> 82<div class="header"> 83<div class="subTitle">com.fasterxml.jackson.databind</div> 84<h2 title="Class JsonDeserializer" class="title">Class JsonDeserializer<T></h2> 85</div> 86<div class="contentContainer"> 87<ul class="inheritance"> 88<li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> 89<li> 90<ul class="inheritance"> 91<li>com.fasterxml.jackson.databind.JsonDeserializer<T></li> 92</ul> 93</li> 94</ul> 95<div class="description"> 96<ul class="blockList"> 97<li class="blockList"> 98<dl> 99<dt>Direct Known Subclasses:</dt> 100<dd><a href="../../../../com/fasterxml/jackson/databind/deser/AbstractDeserializer.html" title="class in com.fasterxml.jackson.databind.deser">AbstractDeserializer</a>, <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.None.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer.None</a>, <a href="../../../../com/fasterxml/jackson/databind/deser/impl/NoClassDefFoundDeserializer.html" title="class in com.fasterxml.jackson.databind.deser.impl">NoClassDefFoundDeserializer</a>, <a href="../../../../com/fasterxml/jackson/databind/deser/std/StdDeserializer.html" title="class in com.fasterxml.jackson.databind.deser.std">StdDeserializer</a>, <a href="../../../../com/fasterxml/jackson/databind/deser/impl/TypeWrappedDeserializer.html" title="class in com.fasterxml.jackson.databind.deser.impl">TypeWrappedDeserializer</a></dd> 101</dl> 102<hr> 103<br> 104<pre>public abstract class <span class="strong">JsonDeserializer<T></span> 105extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> 106<div class="block">Abstract class that defines API used by <a href="../../../../com/fasterxml/jackson/databind/ObjectMapper.html" title="class in com.fasterxml.jackson.databind"><code>ObjectMapper</code></a> (and 107 other chained <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind"><code>JsonDeserializer</code></a>s too) to deserialize Objects of 108 arbitrary types from JSON, using provided <code>JsonParser</code>. 109<p> 110 Custom deserializers should usually not directly extend this class, 111 but instead extend <a href="../../../../com/fasterxml/jackson/databind/deser/std/StdDeserializer.html" title="class in com.fasterxml.jackson.databind.deser.std"><code>StdDeserializer</code></a> 112 (or its subtypes like <a href="../../../../com/fasterxml/jackson/databind/deser/std/StdScalarDeserializer.html" title="class in com.fasterxml.jackson.databind.deser.std"><code>StdScalarDeserializer</code></a>). 113<p> 114 If deserializer is an aggregate one -- meaning it delegates handling of some 115 of its contents by using other deserializer(s) -- it typically also needs 116 to implement <a href="../../../../com/fasterxml/jackson/databind/deser/ResolvableDeserializer.html" title="interface in com.fasterxml.jackson.databind.deser"><code>ResolvableDeserializer</code></a>, 117 which can locate dependant deserializers. This is important to allow dynamic 118 overrides of deserializers; separate call interface is needed to separate 119 resolution of dependant deserializers (which may have cyclic link back 120 to deserializer itself, directly or indirectly). 121<p> 122 In addition, to support per-property annotations (to configure aspects 123 of deserialization on per-property basis), deserializers may want 124 to implement 125 <a href="../../../../com/fasterxml/jackson/databind/deser/ContextualDeserializer.html" title="interface in com.fasterxml.jackson.databind.deser"><code>ContextualDeserializer</code></a>, 126 which allows specialization of deserializers: call to 127 <a href="../../../../com/fasterxml/jackson/databind/deser/ContextualDeserializer.html#createContextual(com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.BeanProperty)"><code>ContextualDeserializer.createContextual(com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.BeanProperty)</code></a> 128 is passed information on property, and can create a newly configured 129 deserializer for handling that particular property. 130<p> 131 If both 132 <a href="../../../../com/fasterxml/jackson/databind/deser/ResolvableDeserializer.html" title="interface in com.fasterxml.jackson.databind.deser"><code>ResolvableDeserializer</code></a> and 133 <a href="../../../../com/fasterxml/jackson/databind/deser/ContextualDeserializer.html" title="interface in com.fasterxml.jackson.databind.deser"><code>ContextualDeserializer</code></a> 134 are implemented, resolution of deserializers occurs before 135 contextualization.</div> 136</li> 137</ul> 138</div> 139<div class="summary"> 140<ul class="blockList"> 141<li class="blockList"> 142<!-- ======== NESTED CLASS SUMMARY ======== --> 143<ul class="blockList"> 144<li class="blockList"><a name="nested_class_summary"> 145<!-- --> 146</a> 147<h3>Nested Class Summary</h3> 148<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> 149<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> 150<tr> 151<th class="colFirst" scope="col">Modifier and Type</th> 152<th class="colLast" scope="col">Class and Description</th> 153</tr> 154<tr class="altColor"> 155<td class="colFirst"><code>static class </code></td> 156<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.None.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer.None</a></strong></code> 157<div class="block">This marker class is only to be used with annotations, to 158 indicate that <b>no deserializer is configured</b>.</div> 159</td> 160</tr> 161</table> 162</li> 163</ul> 164<!-- ======== CONSTRUCTOR SUMMARY ======== --> 165<ul class="blockList"> 166<li class="blockList"><a name="constructor_summary"> 167<!-- --> 168</a> 169<h3>Constructor Summary</h3> 170<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> 171<caption><span>Constructors</span><span class="tabEnd"> </span></caption> 172<tr> 173<th class="colOne" scope="col">Constructor and Description</th> 174</tr> 175<tr class="altColor"> 176<td class="colOne"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#JsonDeserializer()">JsonDeserializer</a></strong>()</code> </td> 177</tr> 178</table> 179</li> 180</ul> 181<!-- ========== METHOD SUMMARY =========== --> 182<ul class="blockList"> 183<li class="blockList"><a name="method_summary"> 184<!-- --> 185</a> 186<h3>Method Summary</h3> 187<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> 188<caption><span>Methods</span><span class="tabEnd"> </span></caption> 189<tr> 190<th class="colFirst" scope="col">Modifier and Type</th> 191<th class="colLast" scope="col">Method and Description</th> 192</tr> 193<tr class="altColor"> 194<td class="colFirst"><code>abstract <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a></code></td> 195<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)">deserialize</a></strong>(com.fasterxml.jackson.core.JsonParser p, 196 <a href="../../../../com/fasterxml/jackson/databind/DeserializationContext.html" title="class in com.fasterxml.jackson.databind">DeserializationContext</a> ctxt)</code> 197<div class="block">Method that can be called to ask implementation to deserialize 198 JSON content into the value type this serializer handles.</div> 199</td> 200</tr> 201<tr class="rowColor"> 202<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a></code></td> 203<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, T)">deserialize</a></strong>(com.fasterxml.jackson.core.JsonParser p, 204 <a href="../../../../com/fasterxml/jackson/databind/DeserializationContext.html" title="class in com.fasterxml.jackson.databind">DeserializationContext</a> ctxt, 205 <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a> intoValue)</code> 206<div class="block">Alternate deserialization method (compared to the most commonly 207 used, <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)"><code>deserialize(JsonParser, DeserializationContext)</code></a>), 208 which takes in initialized value instance, to be 209 configured and/or populated by deserializer.</div> 210</td> 211</tr> 212<tr class="altColor"> 213<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> 214<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#deserializeWithType(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.jsontype.TypeDeserializer)">deserializeWithType</a></strong>(com.fasterxml.jackson.core.JsonParser p, 215 <a href="../../../../com/fasterxml/jackson/databind/DeserializationContext.html" title="class in com.fasterxml.jackson.databind">DeserializationContext</a> ctxt, 216 <a href="../../../../com/fasterxml/jackson/databind/jsontype/TypeDeserializer.html" title="class in com.fasterxml.jackson.databind.jsontype">TypeDeserializer</a> typeDeserializer)</code> 217<div class="block">Deserialization called when type being deserialized is defined to 218 contain additional type identifier, to allow for correctly 219 instantiating correct subtype.</div> 220</td> 221</tr> 222<tr class="rowColor"> 223<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/deser/SettableBeanProperty.html" title="class in com.fasterxml.jackson.databind.deser">SettableBeanProperty</a></code></td> 224<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#findBackReference(java.lang.String)">findBackReference</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> refName)</code> 225<div class="block">Method needed by <a href="../../../../com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.html" title="class in com.fasterxml.jackson.databind.deser"><code>BeanDeserializerFactory</code></a> to properly link 226 managed- and back-reference pairs.</div> 227</td> 228</tr> 229<tr class="altColor"> 230<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?></code></td> 231<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#getDelegatee()">getDelegatee</a></strong>()</code> 232<div class="block">Accessor that can be used to determine if this deserializer uses 233 another deserializer for actual deserialization, by delegating 234 calls.</div> 235</td> 236</tr> 237<tr class="rowColor"> 238<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a></code></td> 239<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#getEmptyValue()">getEmptyValue</a></strong>()</code> 240<div class="block">Method called to determine value to be used for "empty" values 241 (most commonly when deserializing from empty JSON Strings).</div> 242</td> 243</tr> 244<tr class="altColor"> 245<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>></code></td> 246<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#getKnownPropertyNames()">getKnownPropertyNames</a></strong>()</code> 247<div class="block">Method that will 248 either return null to indicate that type being deserializers 249 has no concept of properties; or a collection of identifiers 250 for which <code>toString</code> will give external property 251 name.</div> 252</td> 253</tr> 254<tr class="rowColor"> 255<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a></code></td> 256<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#getNullValue()">getNullValue</a></strong>()</code> 257<div class="block">Method that can be called to determine value to be used for 258 representing null values (values deserialized when JSON token 259 is <code>JsonToken.VALUE_NULL</code>).</div> 260</td> 261</tr> 262<tr class="altColor"> 263<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/deser/impl/ObjectIdReader.html" title="class in com.fasterxml.jackson.databind.deser.impl">ObjectIdReader</a></code></td> 264<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#getObjectIdReader()">getObjectIdReader</a></strong>()</code> 265<div class="block">Accessor that can be used to check whether this deserializer 266 is expecting to possibly get an Object Identifier value instead of full value 267 serialization, and if so, should be able to resolve it to actual 268 Object instance to return as deserialized value.</div> 269</td> 270</tr> 271<tr class="rowColor"> 272<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> 273<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#handledType()">handledType</a></strong>()</code> 274<div class="block">Method for accessing type of values this deserializer produces.</div> 275</td> 276</tr> 277<tr class="altColor"> 278<td class="colFirst"><code>boolean</code></td> 279<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#isCachable()">isCachable</a></strong>()</code> 280<div class="block">Method called to see if deserializer instance is cachable and 281 usable for other properties of same type (type for which instance 282 was created).</div> 283</td> 284</tr> 285<tr class="rowColor"> 286<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?></code></td> 287<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#replaceDelegatee(com.fasterxml.jackson.databind.JsonDeserializer)">replaceDelegatee</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?> delegatee)</code> 288<div class="block">Method that can be called to try to replace deserializer this deserializer 289 delegates calls to.</div> 290</td> 291</tr> 292<tr class="altColor"> 293<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><<a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a>></code></td> 294<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#unwrappingDeserializer(com.fasterxml.jackson.databind.util.NameTransformer)">unwrappingDeserializer</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/util/NameTransformer.html" title="class in com.fasterxml.jackson.databind.util">NameTransformer</a> unwrapper)</code> 295<div class="block">Method that will return deserializer instance that is able 296 to handle "unwrapped" value instances 297 If no unwrapped instance can be constructed, will simply 298 return this object as-is.</div> 299</td> 300</tr> 301</table> 302<ul class="blockList"> 303<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> 304<!-- --> 305</a> 306<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> 307<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li> 308</ul> 309</li> 310</ul> 311</li> 312</ul> 313</div> 314<div class="details"> 315<ul class="blockList"> 316<li class="blockList"> 317<!-- ========= CONSTRUCTOR DETAIL ======== --> 318<ul class="blockList"> 319<li class="blockList"><a name="constructor_detail"> 320<!-- --> 321</a> 322<h3>Constructor Detail</h3> 323<a name="JsonDeserializer()"> 324<!-- --> 325</a> 326<ul class="blockListLast"> 327<li class="blockList"> 328<h4>JsonDeserializer</h4> 329<pre>public JsonDeserializer()</pre> 330</li> 331</ul> 332</li> 333</ul> 334<!-- ============ METHOD DETAIL ========== --> 335<ul class="blockList"> 336<li class="blockList"><a name="method_detail"> 337<!-- --> 338</a> 339<h3>Method Detail</h3> 340<a name="deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)"> 341<!-- --> 342</a> 343<ul class="blockList"> 344<li class="blockList"> 345<h4>deserialize</h4> 346<pre>public abstract <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a> deserialize(com.fasterxml.jackson.core.JsonParser p, 347 <a href="../../../../com/fasterxml/jackson/databind/DeserializationContext.html" title="class in com.fasterxml.jackson.databind">DeserializationContext</a> ctxt) 348 throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, 349 com.fasterxml.jackson.core.JsonProcessingException</pre> 350<div class="block">Method that can be called to ask implementation to deserialize 351 JSON content into the value type this serializer handles. 352 Returned instance is to be constructed by method itself. 353<p> 354 Pre-condition for this method is that the parser points to the 355 first event that is part of value to deserializer (and which 356 is never JSON 'null' literal, more on this below): for simple 357 types it may be the only value; and for structured types the 358 Object start marker or a FIELD_NAME. 359 </p> 360 <p> 361 The two possible input conditions for structured types result 362 from polymorphism via fields. In the ordinary case, Jackson 363 calls this method when it has encountered an OBJECT_START, 364 and the method implementation must advance to the next token to 365 see the first field name. If the application configures 366 polymorphism via a field, then the object looks like the following. 367 <pre> 368 { 369 "@class": "class name", 370 ... 371 } 372 </pre> 373 Jackson consumes the two tokens (the <tt>@class</tt> field name 374 and its value) in order to learn the class and select the deserializer. 375 Thus, the stream is pointing to the FIELD_NAME for the first field 376 after the @class. Thus, if you want your method to work correctly 377 both with and without polymorphism, you must begin your method with: 378 <pre> 379 if (jp.getCurrentToken() == JsonToken.START_OBJECT) { 380 jp.nextToken(); 381 } 382 </pre> 383 This results in the stream pointing to the field name, so that 384 the two conditions align. 385 </p> 386 <p> 387 Post-condition is that the parser will point to the last 388 event that is part of deserialized value (or in case deserialization 389 fails, event that was not recognized or usable, which may be 390 the same event as the one it pointed to upon call). 391<p> 392 Note that this method is never called for JSON null literal, 393 and thus deserializers need (and should) not check for it.</div> 394<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - Parsed used for reading JSON content</dd><dd><code>ctxt</code> - Context that can be used to access information about 395 this deserialization activity.</dd> 396<dt><span class="strong">Returns:</span></dt><dd>Deserialized value</dd> 397<dt><span class="strong">Throws:</span></dt> 398<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> 399<dd><code>com.fasterxml.jackson.core.JsonProcessingException</code></dd></dl> 400</li> 401</ul> 402<a name="deserialize(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object)"> 403<!-- --> 404</a><a name="deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, T)"> 405<!-- --> 406</a> 407<ul class="blockList"> 408<li class="blockList"> 409<h4>deserialize</h4> 410<pre>public <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a> deserialize(com.fasterxml.jackson.core.JsonParser p, 411 <a href="../../../../com/fasterxml/jackson/databind/DeserializationContext.html" title="class in com.fasterxml.jackson.databind">DeserializationContext</a> ctxt, 412 <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a> intoValue) 413 throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, 414 com.fasterxml.jackson.core.JsonProcessingException</pre> 415<div class="block">Alternate deserialization method (compared to the most commonly 416 used, <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)"><code>deserialize(JsonParser, DeserializationContext)</code></a>), 417 which takes in initialized value instance, to be 418 configured and/or populated by deserializer. 419 Method is not necessarily used (or supported) by all types 420 (it will not work for immutable types, for obvious reasons): 421 most commonly it is used for Collections and Maps. 422 It may be used both with "updating readers" (for POJOs) and 423 when Collections and Maps use "getter as setter". 424<p> 425 Default implementation just throws 426 <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang"><code>UnsupportedOperationException</code></a>, to indicate that types 427 that do not explicitly add support do not necessarily support 428 update-existing-value operation (esp. immutable types)</div> 429<dl><dt><span class="strong">Throws:</span></dt> 430<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> 431<dd><code>com.fasterxml.jackson.core.JsonProcessingException</code></dd></dl> 432</li> 433</ul> 434<a name="deserializeWithType(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.jsontype.TypeDeserializer)"> 435<!-- --> 436</a> 437<ul class="blockList"> 438<li class="blockList"> 439<h4>deserializeWithType</h4> 440<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> deserializeWithType(com.fasterxml.jackson.core.JsonParser p, 441 <a href="../../../../com/fasterxml/jackson/databind/DeserializationContext.html" title="class in com.fasterxml.jackson.databind">DeserializationContext</a> ctxt, 442 <a href="../../../../com/fasterxml/jackson/databind/jsontype/TypeDeserializer.html" title="class in com.fasterxml.jackson.databind.jsontype">TypeDeserializer</a> typeDeserializer) 443 throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> 444<div class="block">Deserialization called when type being deserialized is defined to 445 contain additional type identifier, to allow for correctly 446 instantiating correct subtype. This can be due to annotation on 447 type (or its supertype), or due to global settings without 448 annotations. 449<p> 450 Default implementation may work for some types, but ideally subclasses 451 should not rely on current default implementation. 452 Implementation is mostly provided to avoid compilation errors with older 453 code.</div> 454<dl><dt><span class="strong">Parameters:</span></dt><dd><code>typeDeserializer</code> - Deserializer to use for handling type information</dd> 455<dt><span class="strong">Throws:</span></dt> 456<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd></dl> 457</li> 458</ul> 459<a name="unwrappingDeserializer(com.fasterxml.jackson.databind.util.NameTransformer)"> 460<!-- --> 461</a> 462<ul class="blockList"> 463<li class="blockList"> 464<h4>unwrappingDeserializer</h4> 465<pre>public <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><<a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a>> unwrappingDeserializer(<a href="../../../../com/fasterxml/jackson/databind/util/NameTransformer.html" title="class in com.fasterxml.jackson.databind.util">NameTransformer</a> unwrapper)</pre> 466<div class="block">Method that will return deserializer instance that is able 467 to handle "unwrapped" value instances 468 If no unwrapped instance can be constructed, will simply 469 return this object as-is. 470<p> 471 Default implementation just returns 'this' 472 indicating that no unwrapped variant exists</div> 473</li> 474</ul> 475<a name="replaceDelegatee(com.fasterxml.jackson.databind.JsonDeserializer)"> 476<!-- --> 477</a> 478<ul class="blockList"> 479<li class="blockList"> 480<h4>replaceDelegatee</h4> 481<pre>public <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?> replaceDelegatee(<a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?> delegatee)</pre> 482<div class="block">Method that can be called to try to replace deserializer this deserializer 483 delegates calls to. If not supported (either this deserializer does not 484 delegate anything; or it does not want any changes), should either 485 throw <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang"><code>UnsupportedOperationException</code></a> (if operation does not 486 make sense or is not allowed); or return this deserializer as is.</div> 487<dl><dt><span class="strong">Since:</span></dt> 488 <dd>2.1</dd></dl> 489</li> 490</ul> 491<a name="handledType()"> 492<!-- --> 493</a> 494<ul class="blockList"> 495<li class="blockList"> 496<h4>handledType</h4> 497<pre>public <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><?> handledType()</pre> 498<div class="block">Method for accessing type of values this deserializer produces. 499 Note that this information is not guaranteed to be exact -- it 500 may be a more generic (super-type) -- but it should not be 501 incorrect (return a non-related type). 502<p> 503 Default implementation will return null, which means almost same 504 same as returning <code>Object.class</code> would; that is, that 505 nothing is known about handled type. 506<p></div> 507<dl><dt><span class="strong">Since:</span></dt> 508 <dd>2.3</dd></dl> 509</li> 510</ul> 511<a name="getNullValue()"> 512<!-- --> 513</a> 514<ul class="blockList"> 515<li class="blockList"> 516<h4>getNullValue</h4> 517<pre>public <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a> getNullValue()</pre> 518<div class="block">Method that can be called to determine value to be used for 519 representing null values (values deserialized when JSON token 520 is <code>JsonToken.VALUE_NULL</code>). Usually this is simply 521 Java null, but for some types (especially primitives) it may be 522 necessary to use non-null values. 523<p> 524 Note that deserializers are allowed to call this just once and 525 then reuse returned value; that is, method is not guaranteed to 526 be called once for each conversion. 527<p> 528 Default implementation simply returns null.</div> 529</li> 530</ul> 531<a name="getEmptyValue()"> 532<!-- --> 533</a> 534<ul class="blockList"> 535<li class="blockList"> 536<h4>getEmptyValue</h4> 537<pre>public <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="type parameter in JsonDeserializer">T</a> getEmptyValue()</pre> 538<div class="block">Method called to determine value to be used for "empty" values 539 (most commonly when deserializing from empty JSON Strings). 540 Usually this is same as <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#getNullValue()"><code>getNullValue()</code></a> (which in turn 541 is usually simply Java null), but it can be overridden 542 for types. Or, if type should never be converted from empty 543 String, method can also throw an exception. 544<p> 545 Default implementation simple calls <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html#getNullValue()"><code>getNullValue()</code></a> and 546 returns value.</div> 547</li> 548</ul> 549<a name="getKnownPropertyNames()"> 550<!-- --> 551</a> 552<ul class="blockList"> 553<li class="blockList"> 554<h4>getKnownPropertyNames</h4> 555<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>> getKnownPropertyNames()</pre> 556<div class="block">Method that will 557 either return null to indicate that type being deserializers 558 has no concept of properties; or a collection of identifiers 559 for which <code>toString</code> will give external property 560 name. 561 This is only to be used for error reporting and diagnostics 562 purposes (most commonly, to accompany "unknown property" 563 exception).</div> 564<dl><dt><span class="strong">Since:</span></dt> 565 <dd>2.0</dd></dl> 566</li> 567</ul> 568<a name="isCachable()"> 569<!-- --> 570</a> 571<ul class="blockList"> 572<li class="blockList"> 573<h4>isCachable</h4> 574<pre>public boolean isCachable()</pre> 575<div class="block">Method called to see if deserializer instance is cachable and 576 usable for other properties of same type (type for which instance 577 was created). 578<p> 579 Note that cached instances are still resolved on per-property basis, 580 if instance implements <a href="../../../../com/fasterxml/jackson/databind/deser/ResolvableDeserializer.html" title="interface in com.fasterxml.jackson.databind.deser"><code>ResolvableDeserializer</code></a>: 581 cached instance is just as the base. This means that in most cases it is safe to 582 cache instances; however, it only makes sense to cache instances 583 if instantiation is expensive, or if instances are heavy-weight. 584<p> 585 Default implementation returns false, to indicate that no caching 586 is done.</div> 587</li> 588</ul> 589<a name="getObjectIdReader()"> 590<!-- --> 591</a> 592<ul class="blockList"> 593<li class="blockList"> 594<h4>getObjectIdReader</h4> 595<pre>public <a href="../../../../com/fasterxml/jackson/databind/deser/impl/ObjectIdReader.html" title="class in com.fasterxml.jackson.databind.deser.impl">ObjectIdReader</a> getObjectIdReader()</pre> 596<div class="block">Accessor that can be used to check whether this deserializer 597 is expecting to possibly get an Object Identifier value instead of full value 598 serialization, and if so, should be able to resolve it to actual 599 Object instance to return as deserialized value. 600<p> 601 Default implementation returns null, as support can not be implemented 602 generically. Some standard deserializers (most notably 603 <a href="../../../../com/fasterxml/jackson/databind/deser/BeanDeserializer.html" title="class in com.fasterxml.jackson.databind.deser"><code>BeanDeserializer</code></a>) 604 do implement this feature, and may return reader instance, depending on exact 605 configuration of instance (which is based on type, and referring property).</div> 606<dl><dt><span class="strong">Returns:</span></dt><dd>ObjectIdReader used for resolving possible Object Identifier 607 value, instead of full value serialization, if deserializer can do that; 608 null if no Object Id is expected.</dd><dt><span class="strong">Since:</span></dt> 609 <dd>2.0</dd></dl> 610</li> 611</ul> 612<a name="getDelegatee()"> 613<!-- --> 614</a> 615<ul class="blockList"> 616<li class="blockList"> 617<h4>getDelegatee</h4> 618<pre>public <a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.html" title="class in com.fasterxml.jackson.databind">JsonDeserializer</a><?> getDelegatee()</pre> 619<div class="block">Accessor that can be used to determine if this deserializer uses 620 another deserializer for actual deserialization, by delegating 621 calls. If so, will return immediate delegate (which itself may 622 delegate to further deserializers); otherwise will return null.</div> 623<dl><dt><span class="strong">Returns:</span></dt><dd>Deserializer this deserializer delegates calls to, if null; 624 null otherwise.</dd><dt><span class="strong">Since:</span></dt> 625 <dd>2.1</dd></dl> 626</li> 627</ul> 628<a name="findBackReference(java.lang.String)"> 629<!-- --> 630</a> 631<ul class="blockListLast"> 632<li class="blockList"> 633<h4>findBackReference</h4> 634<pre>public <a href="../../../../com/fasterxml/jackson/databind/deser/SettableBeanProperty.html" title="class in com.fasterxml.jackson.databind.deser">SettableBeanProperty</a> findBackReference(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> refName)</pre> 635<div class="block">Method needed by <a href="../../../../com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.html" title="class in com.fasterxml.jackson.databind.deser"><code>BeanDeserializerFactory</code></a> to properly link 636 managed- and back-reference pairs.</div> 637<dl><dt><span class="strong">Since:</span></dt> 638 <dd>2.2 (was moved out of <code>BeanDeserializerBase</code>)</dd></dl> 639</li> 640</ul> 641</li> 642</ul> 643</li> 644</ul> 645</div> 646</div> 647<!-- ========= END OF CLASS DATA ========= --> 648<!-- ======= START OF BOTTOM NAVBAR ====== --> 649<div class="bottomNav"><a name="navbar_bottom"> 650<!-- --> 651</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 652<!-- --> 653</a> 654<ul class="navList" title="Navigation"> 655<li><a href="../../../../overview-summary.html">Overview</a></li> 656<li><a href="package-summary.html">Package</a></li> 657<li class="navBarCell1Rev">Class</li> 658<li><a href="class-use/JsonDeserializer.html">Use</a></li> 659<li><a href="package-tree.html">Tree</a></li> 660<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 661<li><a href="../../../../index-all.html">Index</a></li> 662<li><a href="../../../../help-doc.html">Help</a></li> 663</ul> 664</div> 665<div class="subNav"> 666<ul class="navList"> 667<li><a href="../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Prev Class</span></a></li> 668<li><a href="../../../../com/fasterxml/jackson/databind/JsonDeserializer.None.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Next Class</span></a></li> 669</ul> 670<ul class="navList"> 671<li><a href="../../../../index.html?com/fasterxml/jackson/databind/JsonDeserializer.html" target="_top">Frames</a></li> 672<li><a href="JsonDeserializer.html" target="_top">No Frames</a></li> 673</ul> 674<ul class="navList" id="allclasses_navbar_bottom"> 675<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 676</ul> 677<div> 678<script type="text/javascript"><!-- 679 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 680 if(window==top) { 681 allClassesLink.style.display = "block"; 682 } 683 else { 684 allClassesLink.style.display = "none"; 685 } 686 //--> 687</script> 688</div> 689<div> 690<ul class="subNavList"> 691<li>Summary: </li> 692<li><a href="#nested_class_summary">Nested</a> | </li> 693<li>Field | </li> 694<li><a href="#constructor_summary">Constr</a> | </li> 695<li><a href="#method_summary">Method</a></li> 696</ul> 697<ul class="subNavList"> 698<li>Detail: </li> 699<li>Field | </li> 700<li><a href="#constructor_detail">Constr</a> | </li> 701<li><a href="#method_detail">Method</a></li> 702</ul> 703</div> 704<a name="skip-navbar_bottom"> 705<!-- --> 706</a></div> 707<!-- ======== END OF BOTTOM NAVBAR ======= --> 708<p class="legalCopy"><small>Copyright © 2014-2015 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p> 709</body> 710</html> 711