• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_35) on Fri Oct 05 20:53:29 PDT 2012 -->
6<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
7<TITLE>
8JsonProperty (Jackson-annotations 2.1.0 API)
9</TITLE>
10
11<META NAME="date" CONTENT="2012-10-05">
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.1.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>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/JsonProperty.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48  </TR>
49</TABLE>
50</TD>
51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><script type="text/javascript"><!--
52google_ad_client = "pub-1467773697956887";
53/* Jackson-ad-small */
54google_ad_slot = "6699487946";
55google_ad_width = 234;
56google_ad_height = 60;
57//-->
58</script>
59<script type="text/javascript"
60src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
61</script>
62</TD>
63</TR>
64
65<TR>
66<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
67&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><B>PREV CLASS</B></A>&nbsp;
68&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonPropertyOrder.html" title="annotation in com.fasterxml.jackson.annotation"><B>NEXT CLASS</B></A></FONT></TD>
69<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
70  <A HREF="../../../../index.html?com/fasterxml/jackson/annotation/JsonProperty.html" target="_top"><B>FRAMES</B></A>  &nbsp;
71&nbsp;<A HREF="JsonProperty.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
72&nbsp;<SCRIPT type="text/javascript">
73  <!--
74  if(window==top) {
75    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
76  }
77  //-->
78</SCRIPT>
79<NOSCRIPT>
80  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
81</NOSCRIPT>
82
83
84</FONT></TD>
85</TR>
86<TR>
87<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
88  SUMMARY:&nbsp;REQUIRED&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD>
89<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
90DETAIL:&nbsp;<A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD>
91</TR>
92</TABLE>
93<A NAME="skip-navbar_top"></A>
94<!-- ========= END OF TOP NAVBAR ========= -->
95
96<HR>
97<!-- ======== START OF CLASS DATA ======== -->
98<H2>
99<FONT SIZE="-1">
100com.fasterxml.jackson.annotation</FONT>
101<BR>
102Annotation Type JsonProperty</H2>
103<HR>
104<DL>
105<DT><PRE><FONT SIZE="-1"><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Target.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</A>={<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/ElementType.html?is-external=true#ANNOTATION_TYPE" title="class or interface in java.lang.annotation">ANNOTATION_TYPE</A>,<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/ElementType.html?is-external=true#FIELD" title="class or interface in java.lang.annotation">FIELD</A>,<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/ElementType.html?is-external=true#METHOD" title="class or interface in java.lang.annotation">METHOD</A>,<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/ElementType.html?is-external=true#PARAMETER" title="class or interface in java.lang.annotation">PARAMETER</A>})
106<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Retention.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</A>=<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</A>)
107</FONT>public @interface <B>JsonProperty</B></DL>
108</PRE>
109
110<P>
111Marker annotation that can be used to define a non-static
112 method as a "setter" or "getter" for a logical property
113 (depending on its signature),
114 or non-static object field to be used (serialized, deserialized) as
115 a logical property.
116<p>
117 Default value ("") indicates that the field name is used
118 as the property name without any modifications, but it
119 can be specified to non-empty value to specify different
120 name. Property name refers to name used externally, as
121 the field name in JSON objects.
122<P>
123
124<P>
125<HR>
126
127<P>
128<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
129
130<A NAME="annotation_type_optional_element_summary"><!-- --></A>
131<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
132<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
133<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
134<B>Optional Element Summary</B></FONT></TH>
135</TR>
136<TR BGCOLOR="white" CLASS="TableRowColor">
137<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
138<CODE>&nbsp;boolean</CODE></FONT></TD>
139<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonProperty.html#required()">required</A></B></CODE>
140
141<BR>
142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Property that indicates whether a value (which may be explicit
143 null) is expected for property during deserialization or not.</TD>
144</TR>
145<TR BGCOLOR="white" CLASS="TableRowColor">
146<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
147<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
148<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonProperty.html#value()">value</A></B></CODE>
149
150<BR>
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Defines name of the logical property, i.e.</TD>
152</TR>
153</TABLE>
154&nbsp;
155<P>
156<A NAME="value()"><!-- --></A><H3>
157value</H3>
158<PRE>
159public abstract <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>value</B></PRE>
160<DL>
161<DD>Defines name of the logical property, i.e. JSON object field
162 name to use for the property. If value is empty String (which is the
163 default), will try to use name of the field that is annotated.
164 Note that there is
165 <b>no default name available for constructor arguments</b>,
166 meaning that
167 <b>Empty String is not a valid value for constructor arguments</b>.
168<P>
169<DD><DL>
170</DL>
171</DD>
172<DD><DL>
173</DL>
174<DL>
175<DT><B>Default:</B><DD>""</DD>
176</DL>
177</DL>
178<HR>
179
180<A NAME="required()"><!-- --></A><H3>
181required</H3>
182<PRE>
183public abstract boolean <B>required</B></PRE>
184<DL>
185<DD>Property that indicates whether a value (which may be explicit
186 null) is expected for property during deserialization or not.
187 If expected, <code>BeanDeserialized</code> should indicate
188 this as a validity problem (usually by throwing an exception,
189 but this may be sent via problem handlers that can try to
190 rectify the problem, for example, by supplying a default
191 value).
192<p>
193 Note that as of 2.0, this property is NOT used by
194 <code>BeanDeserializer</code>: support is expected to be
195 added for a later minor version.
196<P>
197<DD><DL>
198</DL>
199</DD>
200<DD><DL>
201<DT><B>Since:</B></DT>
202  <DD>2.0</DD>
203</DL>
204<DL>
205<DT><B>Default:</B><DD>false</DD>
206</DL>
207</DL>
208<!-- ========= END OF CLASS DATA ========= -->
209<HR>
210
211
212<!-- ======= START OF BOTTOM NAVBAR ====== -->
213<A NAME="navbar_bottom"><!-- --></A>
214<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
215<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
216<TR><td rowspan='3'><script type="text/javascript"><!--
217google_ad_client = "pub-1467773697956887";
218/* Jackson-ad-small */
219google_ad_slot = "6699487946";
220google_ad_width = 234;
221google_ad_height = 60;
222//-->
223</script>
224<script type="text/javascript"
225src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
226</script>
227<!-- GA -->
228<script type="text/javascript">
229var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
230document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
231</script>
232<script type="text/javascript">
233try {
234var pageTracker = _gat._getTracker("UA-140287-6");
235pageTracker._trackPageview();
236} catch(err) {}
237</script>
238</td>
239<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
240<A NAME="navbar_bottom_firstrow"><!-- --></A>
241<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
242  <TR ALIGN="center" VALIGN="top">
243  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../com/fasterxml/jackson/annotation/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
244  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
245  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/JsonProperty.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
246  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
247  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
248  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
249  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
250  </TR>
251</TABLE>
252</TD>
253<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
254</EM>
255</TD>
256</TR>
257
258<TR>
259<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
260&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><B>PREV CLASS</B></A>&nbsp;
261&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonPropertyOrder.html" title="annotation in com.fasterxml.jackson.annotation"><B>NEXT CLASS</B></A></FONT></TD>
262<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
263  <A HREF="../../../../index.html?com/fasterxml/jackson/annotation/JsonProperty.html" target="_top"><B>FRAMES</B></A>  &nbsp;
264&nbsp;<A HREF="JsonProperty.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
265&nbsp;<SCRIPT type="text/javascript">
266  <!--
267  if(window==top) {
268    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
269  }
270  //-->
271</SCRIPT>
272<NOSCRIPT>
273  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
274</NOSCRIPT>
275
276
277</FONT></TD>
278</TR>
279<TR>
280<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
281  SUMMARY:&nbsp;REQUIRED&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD>
282<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
283DETAIL:&nbsp;<A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD>
284</TR>
285</TABLE>
286<A NAME="skip-navbar_bottom"></A>
287<!-- ======== END OF BOTTOM NAVBAR ======= -->
288
289<HR>
290Copyright &#169; 2012 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.
291</BODY>
292</HTML>
293