<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_35) on Tue Oct 09 17:08:10 PDT 2012 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> JsonDeserialize (jackson-databind 2.1.0 API) </TITLE> <META NAME="date" CONTENT="2012-10-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="JsonDeserialize (jackson-databind 2.1.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JsonDeserialize.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JacksonStdImpl.html" title="annotation in com.fasterxml.jackson.databind.annotation"><B>PREV CLASS</B></A> <A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonNaming.html" title="annotation in com.fasterxml.jackson.databind.annotation"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/fasterxml/jackson/databind/annotation/JsonDeserialize.html" target="_top"><B>FRAMES</B></A> <A HREF="JsonDeserialize.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.fasterxml.jackson.databind.annotation</FONT> <BR> Annotation Type JsonDeserialize</H2> <HR> <DL> <DT><PRE><FONT SIZE="-1"><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>}) <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>) </FONT>public @interface <B>JsonDeserialize</B></DL> </PRE> <P> Annotation use for configuring deserialization aspects, by attaching to "setter" methods or fields, or to value classes. When annotating value classes, configuration is used for instances of the value class but can be overridden by more specific annotations (ones that attach to methods or fields). <p> An example annotation would be: <pre> @JsonDeserialize(using=MySerializer.class, as=MyHashMap.class, keyAs=MyHashKey.class, contentAs=MyHashValue.class ) </pre> <p> <P> <P> <HR> <P> <!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> <A NAME="annotation_type_optional_element_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Optional Element Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#as()">as</A></B></CODE> <BR> Concrete type to deserialize values as, instead of type otherwise declared.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#builder()">builder</A></B></CODE> <BR> Annotation for specifying if an external Builder class is to be used for building up deserialized instances of annotated class.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#contentAs()">contentAs</A></B></CODE> <BR> Concrete type to deserialize content (elements of a Collection/array, values of Maps) values as, instead of type otherwise declared.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#contentUsing()">contentUsing</A></B></CODE> <BR> Deserializer class to use for deserializing contents (elements of a Collection/array, values of Maps) of annotated property.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#keyAs()">keyAs</A></B></CODE> <BR> 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, instead of type otherwise declared.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#keyUsing()">keyUsing</A></B></CODE> <BR> Deserializer class to use for deserializing Map keys of annotated property.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#using()">using</A></B></CODE> <BR> Deserializer class to use for deserializing associated value.</TD> </TR> </TABLE> <P> <A NAME="using()"><!-- --></A><H3> using</H3> <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><?>> <B>using</B></PRE> <DL> <DD>Deserializer class to use for deserializing associated value. Depending on what is annotated, value is either an instance of annotated class (used globablly anywhere where class deserializer is needed); or only used for deserializing property access via a setter method. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>Default:</B><DD>com.fasterxml.jackson.databind.JsonDeserializer.None.class</DD> </DL> </DL> <HR> <A NAME="contentUsing()"><!-- --></A><H3> contentUsing</H3> <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><?>> <B>contentUsing</B></PRE> <DL> <DD>Deserializer class to use for deserializing contents (elements of a Collection/array, values of Maps) of annotated property. Can only be used on instances (methods, fields, constructors), and not value classes themselves. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>Default:</B><DD>com.fasterxml.jackson.databind.JsonDeserializer.None.class</DD> </DL> </DL> <HR> <A NAME="keyUsing()"><!-- --></A><H3> keyUsing</H3> <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>> <B>keyUsing</B></PRE> <DL> <DD>Deserializer class to use for deserializing Map keys of annotated property. Can only be used on instances (methods, fields, constructors), and not value classes themselves. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>Default:</B><DD>com.fasterxml.jackson.databind.KeyDeserializer.None.class</DD> </DL> </DL> <HR> <A NAME="builder()"><!-- --></A><H3> builder</H3> <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><?> <B>builder</B></PRE> <DL> <DD>Annotation for specifying if an external Builder class is to be used for building up deserialized instances of annotated class. If so, an instance of referenced class is first constructed (possibly using a Creator method; or if none defined, using default constructor), and its "with-methods" are used for populating fields; and finally "build-method" is invoked to complete deserialization. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>Default:</B><DD>com.fasterxml.jackson.databind.annotation.NoClass.class</DD> </DL> </DL> <HR> <A NAME="as()"><!-- --></A><H3> as</H3> <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><?> <B>as</B></PRE> <DL> <DD>Concrete type to deserialize values as, instead of type otherwise declared. Must be a subtype of declared type; otherwise an exception may be thrown by deserializer. <p> Bogus type <A HREF="../../../../../com/fasterxml/jackson/databind/annotation/NoClass.html" title="class in com.fasterxml.jackson.databind.annotation"><CODE>NoClass</CODE></A> can be used to indicate that declared type is used as is (i.e. this annotation property has no setting); this since annotation properties are not allowed to have null value. <p> Note: if <A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonDeserialize.html#using()"><CODE>using()</CODE></A> is also used it has precedence (since it directly specified deserializer, whereas this would only be used to locate the deserializer) and value of this annotation property is ignored. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>Default:</B><DD>com.fasterxml.jackson.databind.annotation.NoClass.class</DD> </DL> </DL> <HR> <A NAME="keyAs()"><!-- --></A><H3> keyAs</H3> <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><?> <B>keyAs</B></PRE> <DL> <DD>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, instead of type otherwise declared. Must be a subtype of declared type; otherwise an exception may be thrown by deserializer. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>Default:</B><DD>com.fasterxml.jackson.databind.annotation.NoClass.class</DD> </DL> </DL> <HR> <A NAME="contentAs()"><!-- --></A><H3> contentAs</H3> <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><?> <B>contentAs</B></PRE> <DL> <DD>Concrete type to deserialize content (elements of a Collection/array, values of Maps) values as, instead of type otherwise declared. Must be a subtype of declared type; otherwise an exception may be thrown by deserializer. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>Default:</B><DD>com.fasterxml.jackson.databind.annotation.NoClass.class</DD> </DL> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JsonDeserialize.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JacksonStdImpl.html" title="annotation in com.fasterxml.jackson.databind.annotation"><B>PREV CLASS</B></A> <A HREF="../../../../../com/fasterxml/jackson/databind/annotation/JsonNaming.html" title="annotation in com.fasterxml.jackson.databind.annotation"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/fasterxml/jackson/databind/annotation/JsonDeserialize.html" target="_top"><B>FRAMES</B></A> <A HREF="JsonDeserialize.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright © 2012 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved. </BODY> </HTML>