1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<!--NewPage--> 3<HTML> 4<HEAD> 5<!-- Generated by javadoc (build 1.6.0_29) on Mon Mar 26 18:49:10 PDT 2012 --> 6<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7<TITLE> 8JsonProperty (Jackson-annotations 2.0.0 API) 9</TITLE> 10 11<META NAME="date" CONTENT="2012-03-26"> 12 13<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> 14 15<SCRIPT type="text/javascript"> 16function windowTitle() 17{ 18 if (location.href.indexOf('is-external=true') == -1) { 19 parent.document.title="JsonProperty (Jackson-annotations 2.0.0 API)"; 20 } 21} 22</SCRIPT> 23<NOSCRIPT> 24</NOSCRIPT> 25 26</HEAD> 27 28<BODY BGCOLOR="white" onload="windowTitle();"> 29<HR> 30 31 32<!-- ========= START OF TOP NAVBAR ======= --> 33<A NAME="navbar_top"><!-- --></A> 34<A HREF="#skip-navbar_top" title="Skip navigation links"></A> 35<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 36<TR> 37<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 38<A NAME="navbar_top_firstrow"><!-- --></A> 39<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 40 <TR ALIGN="center" VALIGN="top"> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../com/fasterxml/jackson/annotation/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JsonProperty.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 48 </TR> 49</TABLE> 50</TD> 51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 52</EM> 53</TD> 54</TR> 55 56<TR> 57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 58 <A HREF="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><B>PREV CLASS</B></A> 59 <A HREF="../../../../com/fasterxml/jackson/annotation/JsonPropertyOrder.html" title="annotation in com.fasterxml.jackson.annotation"><B>NEXT CLASS</B></A></FONT></TD> 60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 61 <A HREF="../../../../index.html?com/fasterxml/jackson/annotation/JsonProperty.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="JsonProperty.html" target="_top"><B>NO FRAMES</B></A> 63 <SCRIPT type="text/javascript"> 64 <!-- 65 if(window==top) { 66 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 67 } 68 //--> 69</SCRIPT> 70<NOSCRIPT> 71 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 72</NOSCRIPT> 73 74 75</FONT></TD> 76</TR> 77<TR> 78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 79 SUMMARY: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> 80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> 82</TR> 83</TABLE> 84<A NAME="skip-navbar_top"></A> 85<!-- ========= END OF TOP NAVBAR ========= --> 86 87<HR> 88<!-- ======== START OF CLASS DATA ======== --> 89<H2> 90<FONT SIZE="-1"> 91com.fasterxml.jackson.annotation</FONT> 92<BR> 93Annotation Type JsonProperty</H2> 94<HR> 95<DL> 96<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#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#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#PARAMETER" title="class or interface in java.lang.annotation">PARAMETER</A>}) 97<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>) 98</FONT>public @interface <B>JsonProperty</B></DL> 99</PRE> 100 101<P> 102Marker annotation that can be used to define a non-static 103 method as a "setter" or "getter" for a logical property 104 (depending on its signature), 105 or non-static object field to be used (serialized, deserialized) as 106 a logical property. 107<p> 108 Default value ("") indicates that the field name is used 109 as the property name without any modifications, but it 110 can be specified to non-empty value to specify different 111 name. Property name refers to name used externally, as 112 the field name in JSON objects. 113<P> 114 115<P> 116<HR> 117 118<P> 119<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> 120 121<A NAME="annotation_type_optional_element_summary"><!-- --></A> 122<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 123<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 124<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 125<B>Optional Element Summary</B></FONT></TH> 126</TR> 127<TR BGCOLOR="white" CLASS="TableRowColor"> 128<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 129<CODE> boolean</CODE></FONT></TD> 130<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonProperty.html#required()">required</A></B></CODE> 131 132<BR> 133 Property that indicates whether a value (which may be explicit 134 null) is expected for property during deserialization or not.</TD> 135</TR> 136<TR BGCOLOR="white" CLASS="TableRowColor"> 137<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 138<CODE> <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></CODE></FONT></TD> 139<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonProperty.html#value()">value</A></B></CODE> 140 141<BR> 142 Defines name of the logical property, i.e.</TD> 143</TR> 144</TABLE> 145 146<P> 147<A NAME="value()"><!-- --></A><H3> 148value</H3> 149<PRE> 150public abstract <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> <B>value</B></PRE> 151<DL> 152<DD>Defines name of the logical property, i.e. Json object field 153 name to use for the property: if empty String (which is the 154 default), will use name of the field that is annotated. 155<P> 156<DD><DL> 157</DL> 158</DD> 159<DD><DL> 160</DL> 161<DL> 162<DT><B>Default:</B><DD>""</DD> 163</DL> 164</DL> 165<HR> 166 167<A NAME="required()"><!-- --></A><H3> 168required</H3> 169<PRE> 170public abstract boolean <B>required</B></PRE> 171<DL> 172<DD>Property that indicates whether a value (which may be explicit 173 null) is expected for property during deserialization or not. 174 If expected, <code>BeanDeserialized</code> should indicate 175 this as a validity problem (usually by throwing an exception, 176 but this may be sent via problem handlers that can try to 177 rectify the problem, for example, by supplying a default 178 value). 179<p> 180 Note that as of 2.0, this property is NOT used by 181 <code>BeanDeserializer</code>: support is expected to be 182 added for later minor versions. 183<P> 184<DD><DL> 185</DL> 186</DD> 187<DD><DL> 188<DT><B>Since:</B></DT> 189 <DD>2.0</DD> 190</DL> 191<DL> 192<DT><B>Default:</B><DD>false</DD> 193</DL> 194</DL> 195<!-- ========= END OF CLASS DATA ========= --> 196<HR> 197 198 199<!-- ======= START OF BOTTOM NAVBAR ====== --> 200<A NAME="navbar_bottom"><!-- --></A> 201<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 202<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 203<TR> 204<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 205<A NAME="navbar_bottom_firstrow"><!-- --></A> 206<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 207 <TR ALIGN="center" VALIGN="top"> 208 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../com/fasterxml/jackson/annotation/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 209 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 210 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JsonProperty.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 211 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 212 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 213 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 214 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 215 </TR> 216</TABLE> 217</TD> 218<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 219</EM> 220</TD> 221</TR> 222 223<TR> 224<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 225 <A HREF="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><B>PREV CLASS</B></A> 226 <A HREF="../../../../com/fasterxml/jackson/annotation/JsonPropertyOrder.html" title="annotation in com.fasterxml.jackson.annotation"><B>NEXT CLASS</B></A></FONT></TD> 227<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 228 <A HREF="../../../../index.html?com/fasterxml/jackson/annotation/JsonProperty.html" target="_top"><B>FRAMES</B></A> 229 <A HREF="JsonProperty.html" target="_top"><B>NO FRAMES</B></A> 230 <SCRIPT type="text/javascript"> 231 <!-- 232 if(window==top) { 233 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 234 } 235 //--> 236</SCRIPT> 237<NOSCRIPT> 238 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 239</NOSCRIPT> 240 241 242</FONT></TD> 243</TR> 244<TR> 245<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 246 SUMMARY: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> 247<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 248DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> 249</TR> 250</TABLE> 251<A NAME="skip-navbar_bottom"></A> 252<!-- ======== END OF BOTTOM NAVBAR ======= --> 253 254<HR> 255Copyright © 2012 <a href="http://fasterxml.com">fasterxml.com</a>. All Rights Reserved. 256</BODY> 257</HTML> 258