• Home
  • History
  • Annotate
  • 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_29) on Mon Mar 26 18:49:10 PDT 2012 -->
6<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
7<TITLE>
8JsonFormat (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="JsonFormat (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>&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/JsonFormat.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><EM>
52</EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonFilter.html" title="annotation in com.fasterxml.jackson.annotation"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.Shape.html" title="enum 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/JsonFormat.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="JsonFormat.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<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:&nbsp;REQUIRED&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;<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 JsonFormat</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>JsonFormat</B></DL>
99</PRE>
100
101<P>
102General-purpose annotation used for configuring details of how
103 values of properties are to be serialized.
104 Unlike most other Jackson annotations, annotation does not
105 have specific universal interpretation: instead, effect depends on datatype
106 of property being annotated (or more specifically, deserializer
107 and serializer being used).
108<p>
109 Common uses include choosing between alternate representations -- for example,
110 whether <A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><CODE>Date</CODE></A> is to be serialized as number (Java timestamp)
111 or String (such as ISO-8601 compatible time value) -- as well as configuring
112 exact details with <A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.html#pattern()"><CODE>pattern()</CODE></A> property.
113<p>
114 As of Jackson 2.0, known special handling include:
115<ul>
116 <li><A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><CODE>Date</CODE></A>: Shape can  be <A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.Shape.html#STRING"><CODE>JsonFormat.Shape.STRING</CODE></A> or <A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.Shape.html#NUMBER"><CODE>JsonFormat.Shape.NUMBER</CODE></A>;
117    pattern may contain <A HREF="http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html?is-external=true" title="class or interface in java.text"><CODE>SimpleDateFormat</CODE></A>-compatible pattern definition.
118   </li>
119</ul>
120<P>
121
122<P>
123<DL>
124<DT><B>Since:</B></DT>
125  <DD>2.0</DD>
126</DL>
127<HR>
128
129<P>
130<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
131
132<A NAME="annotation_type_optional_element_summary"><!-- --></A>
133<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
134<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
135<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
136<B>Optional Element Summary</B></FONT></TH>
137</TR>
138<TR BGCOLOR="white" CLASS="TableRowColor">
139<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
140<CODE>&nbsp;<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>
141<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.html#locale()">locale</A></B></CODE>
142
143<BR>
144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><CODE>Locale</CODE></A> to use for serialization (if needed).</TD>
145</TR>
146<TR BGCOLOR="white" CLASS="TableRowColor">
147<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
148<CODE>&nbsp;<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>
149<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.html#pattern()">pattern</A></B></CODE>
150
151<BR>
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Datatype-specific additional piece of configuration that may be used
153 to further refine formatting aspects.</TD>
154</TR>
155<TR BGCOLOR="white" CLASS="TableRowColor">
156<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
157<CODE>&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.Shape.html" title="enum in com.fasterxml.jackson.annotation">JsonFormat.Shape</A></CODE></FONT></TD>
158<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.html#shape()">shape</A></B></CODE>
159
160<BR>
161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Structure to use for serialization: definition of mapping depends on datatype,
162 but usually has straight-forward counterpart in data format (JSON).</TD>
163</TR>
164<TR BGCOLOR="white" CLASS="TableRowColor">
165<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
166<CODE>&nbsp;<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>
167<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.html#timezone()">timezone</A></B></CODE>
168
169<BR>
170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><CODE>TimeZone</CODE></A> to use for serialization (if needed).</TD>
171</TR>
172</TABLE>
173&nbsp;
174<P>
175<A NAME="pattern()"><!-- --></A><H3>
176pattern</H3>
177<PRE>
178public 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>pattern</B></PRE>
179<DL>
180<DD>Datatype-specific additional piece of configuration that may be used
181 to further refine formatting aspects. This may, for example, determine
182 low-level format String used for <A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><CODE>Date</CODE></A> serialization;
183 however, exact use is determined by specific <code>JsonSerializer</code>
184<P>
185<DD><DL>
186</DL>
187</DD>
188<DD><DL>
189</DL>
190<DL>
191<DT><B>Default:</B><DD>""</DD>
192</DL>
193</DL>
194<HR>
195
196<A NAME="shape()"><!-- --></A><H3>
197shape</H3>
198<PRE>
199public abstract <A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.Shape.html" title="enum in com.fasterxml.jackson.annotation">JsonFormat.Shape</A> <B>shape</B></PRE>
200<DL>
201<DD>Structure to use for serialization: definition of mapping depends on datatype,
202 but usually has straight-forward counterpart in data format (JSON).
203 Note that commonly only a subset of shapes is available; and if 'invalid' value
204 is chosen, defaults are usually used.
205<P>
206<DD><DL>
207</DL>
208</DD>
209<DD><DL>
210</DL>
211<DL>
212<DT><B>Default:</B><DD>com.fasterxml.jackson.annotation.JsonFormat.Shape.ANY</DD>
213</DL>
214</DL>
215<HR>
216
217<A NAME="locale()"><!-- --></A><H3>
218locale</H3>
219<PRE>
220public 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>locale</B></PRE>
221<DL>
222<DD><A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><CODE>Locale</CODE></A> to use for serialization (if needed).
223 Special value of <A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.html#DEFAULT_LOCALE"><CODE>DEFAULT_LOCALE</CODE></A>
224 can be used to mean "just use the default", where default is specified
225 by the serialization context, which in turn defaults to system
226 defaults (<A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Locale.html?is-external=true#getDefault()" title="class or interface in java.util"><CODE>Locale.getDefault()</CODE></A>) unless explicitly
227 set to another locale.
228<P>
229<DD><DL>
230</DL>
231</DD>
232<DD><DL>
233</DL>
234<DL>
235<DT><B>Default:</B><DD>"##default"</DD>
236</DL>
237</DL>
238<HR>
239
240<A NAME="timezone()"><!-- --></A><H3>
241timezone</H3>
242<PRE>
243public 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>timezone</B></PRE>
244<DL>
245<DD><A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><CODE>TimeZone</CODE></A> to use for serialization (if needed).
246 Special value of <A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.html#DEFAULT_TIMEZONE"><CODE>DEFAULT_TIMEZONE</CODE></A>
247 can be used to mean "just use the default", where default is specified
248 by the serialization context, which in turn defaults to system
249 defaults (<A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true#getDefault()" title="class or interface in java.util"><CODE>TimeZone.getDefault()</CODE></A>) unless explicitly
250 set to another locale.
251<P>
252<DD><DL>
253</DL>
254</DD>
255<DD><DL>
256</DL>
257<DL>
258<DT><B>Default:</B><DD>"##default"</DD>
259</DL>
260</DL>
261<!-- ========= END OF CLASS DATA ========= -->
262<HR>
263
264
265<!-- ======= START OF BOTTOM NAVBAR ====== -->
266<A NAME="navbar_bottom"><!-- --></A>
267<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
268<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
269<TR>
270<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
271<A NAME="navbar_bottom_firstrow"><!-- --></A>
272<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
273  <TR ALIGN="center" VALIGN="top">
274  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../com/fasterxml/jackson/annotation/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
275  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
276  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/JsonFormat.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
277  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
278  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
279  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
280  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
281  </TR>
282</TABLE>
283</TD>
284<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
285</EM>
286</TD>
287</TR>
288
289<TR>
290<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
291&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonFilter.html" title="annotation in com.fasterxml.jackson.annotation"><B>PREV CLASS</B></A>&nbsp;
292&nbsp;<A HREF="../../../../com/fasterxml/jackson/annotation/JsonFormat.Shape.html" title="enum in com.fasterxml.jackson.annotation"><B>NEXT CLASS</B></A></FONT></TD>
293<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
294  <A HREF="../../../../index.html?com/fasterxml/jackson/annotation/JsonFormat.html" target="_top"><B>FRAMES</B></A>  &nbsp;
295&nbsp;<A HREF="JsonFormat.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
296&nbsp;<SCRIPT type="text/javascript">
297  <!--
298  if(window==top) {
299    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
300  }
301  //-->
302</SCRIPT>
303<NOSCRIPT>
304  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
305</NOSCRIPT>
306
307
308</FONT></TD>
309</TR>
310<TR>
311<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
312  SUMMARY:&nbsp;REQUIRED&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD>
313<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
314DETAIL:&nbsp;<A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD>
315</TR>
316</TABLE>
317<A NAME="skip-navbar_bottom"></A>
318<!-- ======== END OF BOTTOM NAVBAR ======= -->
319
320<HR>
321Copyright &#169; 2012 <a href="http://fasterxml.com">fasterxml.com</a>. All Rights Reserved.
322</BODY>
323</HTML>
324