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 Tue Oct 09 17:08:07 PDT 2012 -->
6<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
7<TITLE>
8JsonSerializer (jackson-databind 2.1.0 API)
9</TITLE>
10
11<META NAME="date" CONTENT="2012-10-09">
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="JsonSerializer (jackson-databind 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="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
43  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/JsonSerializer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
48  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
49  </TR>
50</TABLE>
51</TD>
52<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
53</EM>
54</TD>
55</TR>
56
57<TR>
58<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
59&nbsp;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializable.html" title="interface in com.fasterxml.jackson.databind"><B>PREV CLASS</B></A>&nbsp;
60&nbsp;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind"><B>NEXT CLASS</B></A></FONT></TD>
61<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
62  <A HREF="../../../../index.html?com/fasterxml/jackson/databind/JsonSerializer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
63&nbsp;<A HREF="JsonSerializer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
64&nbsp;<SCRIPT type="text/javascript">
65  <!--
66  if(window==top) {
67    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
68  }
69  //-->
70</SCRIPT>
71<NOSCRIPT>
72  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
73</NOSCRIPT>
74
75
76</FONT></TD>
77</TR>
78<TR>
79<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
80  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
81<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
82DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
83</TR>
84</TABLE>
85<A NAME="skip-navbar_top"></A>
86<!-- ========= END OF TOP NAVBAR ========= -->
87
88<HR>
89<!-- ======== START OF CLASS DATA ======== -->
90<H2>
91<FONT SIZE="-1">
92com.fasterxml.jackson.databind</FONT>
93<BR>
94Class JsonSerializer&lt;T&gt;</H2>
95<PRE>
96<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>
97  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.fasterxml.jackson.databind.JsonSerializer&lt;T&gt;</B>
98</PRE>
99<DL>
100<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitable</A></DD>
101</DL>
102<DL>
103<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind">JsonSerializer.None</A>, <A HREF="../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std">StdSerializer</A>, <A HREF="../../../../com/fasterxml/jackson/databind/ser/impl/TypeWrappedSerializer.html" title="class in com.fasterxml.jackson.databind.ser.impl">TypeWrappedSerializer</A></DD>
104</DL>
105<HR>
106<DL>
107<DT><PRE>public abstract class <B>JsonSerializer&lt;T&gt;</B><DT>extends <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><DT>implements <A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitable</A></DL>
108</PRE>
109
110<P>
111Abstract 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
112 other chained <A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind"><CODE>JsonSerializer</CODE></A>s too) to serialize Objects of
113 arbitrary types into JSON, using provided <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core"><CODE>JsonGenerator</CODE></A>.
114<p>
115 NOTE: it is recommended that custom serializers extend
116 <A HREF="../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std"><CODE>StdSerializer</CODE></A> instead
117 of this class, since it will implement many of optional
118 methods of this class.
119<p>
120 If serializer is an aggregate one -- meaning it delegates handling of some
121 of its contents by using other serializer(s) -- it typically also needs
122 to implement <A HREF="../../../../com/fasterxml/jackson/databind/ser/ResolvableSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><CODE>ResolvableSerializer</CODE></A>,
123 which can locate secondary serializers needed. This is important to allow dynamic
124 overrides of serializers; separate call interface is needed to separate
125 resolution of secondary serializers (which may have cyclic link back
126 to serializer itself, directly or indirectly).
127<p>
128 In addition, to support per-property annotations (to configure aspects
129 of serialization on per-property basis), serializers may want
130 to implement
131 <A HREF="../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><CODE>ContextualSerializer</CODE></A>,
132 which allows specialization of serializers: call to
133 <A HREF="../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html#createContextual(com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.BeanProperty)"><CODE>ContextualSerializer.createContextual(com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.BeanProperty)</CODE></A>
134 is passed information on property, and can create a newly configured
135 serializer for handling that particular property.
136<p>
137 If both
138 <A HREF="../../../../com/fasterxml/jackson/databind/ser/ResolvableSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><CODE>ResolvableSerializer</CODE></A> and
139 <A HREF="../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><CODE>ContextualSerializer</CODE></A>
140 are implemented, resolution of serializers occurs before
141 contextualization.
142<P>
143
144<P>
145<HR>
146
147<P>
148<!-- ======== NESTED CLASS SUMMARY ======== -->
149
150<A NAME="nested_class_summary"><!-- --></A>
151<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
152<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
153<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
154<B>Nested Class Summary</B></FONT></TH>
155</TR>
156<TR BGCOLOR="white" CLASS="TableRowColor">
157<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
158<CODE>static&nbsp;class</CODE></FONT></TD>
159<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind">JsonSerializer.None</A></B></CODE>
160
161<BR>
162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This marker class is only to be used with annotations, to
163 indicate that <b>no serializer is configured</b>.</TD>
164</TR>
165</TABLE>
166&nbsp;
167<!-- ======== CONSTRUCTOR SUMMARY ======== -->
168
169<A NAME="constructor_summary"><!-- --></A>
170<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
171<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
172<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
173<B>Constructor Summary</B></FONT></TH>
174</TR>
175<TR BGCOLOR="white" CLASS="TableRowColor">
176<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#JsonSerializer()">JsonSerializer</A></B>()</CODE>
177
178<BR>
179&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
180</TR>
181</TABLE>
182&nbsp;
183<!-- ========== METHOD SUMMARY =========== -->
184
185<A NAME="method_summary"><!-- --></A>
186<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
187<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
188<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
189<B>Method Summary</B></FONT></TH>
190</TR>
191<TR BGCOLOR="white" CLASS="TableRowColor">
192<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
193<CODE>&nbsp;void</CODE></FONT></TD>
194<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, com.fasterxml.jackson.databind.JavaType)">acceptJsonFormatVisitor</A></B>(<A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitorWrapper</A>&nbsp;visitor,
195                        <A HREF="../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;type)</CODE>
196
197<BR>
198&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default implementation simply calls <A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html#expectAnyFormat(com.fasterxml.jackson.databind.JavaType)"><CODE>JsonFormatVisitorWrapper.expectAnyFormat(JavaType)</CODE></A>.</TD>
199</TR>
200<TR BGCOLOR="white" CLASS="TableRowColor">
201<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
202<CODE>&nbsp;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;?&gt;</CODE></FONT></TD>
203<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#getDelegatee()">getDelegatee</A></B>()</CODE>
204
205<BR>
206&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Accessor that can be used to determine if this serializer uses
207 another serializer for actual serialization, by delegating
208 calls.</TD>
209</TR>
210<TR BGCOLOR="white" CLASS="TableRowColor">
211<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
212<CODE>&nbsp;<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>&lt;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&gt;</CODE></FONT></TD>
213<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#handledType()">handledType</A></B>()</CODE>
214
215<BR>
216&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for accessing type of Objects this serializer can handle.</TD>
217</TR>
218<TR BGCOLOR="white" CLASS="TableRowColor">
219<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
220<CODE>&nbsp;boolean</CODE></FONT></TD>
221<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty(T)">isEmpty</A></B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&nbsp;value)</CODE>
222
223<BR>
224&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called to check whether given serializable value is
225 considered "empty" value (for purposes of suppressing serialization
226 of empty values).</TD>
227</TR>
228<TR BGCOLOR="white" CLASS="TableRowColor">
229<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
230<CODE>&nbsp;boolean</CODE></FONT></TD>
231<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isUnwrappingSerializer()">isUnwrappingSerializer</A></B>()</CODE>
232
233<BR>
234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Accessor for checking whether this serializer is an
235 "unwrapping" serializer; this is necessary to know since
236 it may also require caller to suppress writing of the
237 leading property name.</TD>
238</TR>
239<TR BGCOLOR="white" CLASS="TableRowColor">
240<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
241<CODE>&nbsp;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&gt;</CODE></FONT></TD>
242<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#replaceDelegatee(com.fasterxml.jackson.databind.JsonSerializer)">replaceDelegatee</A></B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;?&gt;&nbsp;delegatee)</CODE>
243
244<BR>
245&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method that can be called to try to replace serializer this serializer
246 delegates calls to.</TD>
247</TR>
248<TR BGCOLOR="white" CLASS="TableRowColor">
249<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
250<CODE>abstract &nbsp;void</CODE></FONT></TD>
251<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#serialize(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)">serialize</A></B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&nbsp;value,
252          <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</A>&nbsp;jgen,
253          <A HREF="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</A>&nbsp;provider)</CODE>
254
255<BR>
256&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method that can be called to ask implementation to serialize
257 values of type this serializer handles.</TD>
258</TR>
259<TR BGCOLOR="white" CLASS="TableRowColor">
260<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
261<CODE>&nbsp;void</CODE></FONT></TD>
262<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#serializeWithType(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer)">serializeWithType</A></B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&nbsp;value,
263                  <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</A>&nbsp;jgen,
264                  <A HREF="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</A>&nbsp;provider,
265                  <A HREF="../../../../com/fasterxml/jackson/databind/jsontype/TypeSerializer.html" title="class in com.fasterxml.jackson.databind.jsontype">TypeSerializer</A>&nbsp;typeSer)</CODE>
266
267<BR>
268&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method that can be called to ask implementation to serialize
269 values of type this serializer handles, using specified type serializer
270 for embedding necessary type information.</TD>
271</TR>
272<TR BGCOLOR="white" CLASS="TableRowColor">
273<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
274<CODE>&nbsp;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&gt;</CODE></FONT></TD>
275<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#unwrappingSerializer(com.fasterxml.jackson.databind.util.NameTransformer)">unwrappingSerializer</A></B>(<A HREF="../../../../com/fasterxml/jackson/databind/util/NameTransformer.html" title="class in com.fasterxml.jackson.databind.util">NameTransformer</A>&nbsp;unwrapper)</CODE>
276
277<BR>
278&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method that will return serializer instance that produces
279 "unwrapped" serialization, if applicable for type being
280 serialized (which is the case for some serializers
281 that produce JSON Objects as output).</TD>
282</TR>
283<TR BGCOLOR="white" CLASS="TableRowColor">
284<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
285<CODE>&nbsp;boolean</CODE></FONT></TD>
286<TD><CODE><B><A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#usesObjectId()">usesObjectId</A></B>()</CODE>
287
288<BR>
289&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method that can be called to see whether this serializer instance
290 will use Object Id to handle cyclic references.</TD>
291</TR>
292</TABLE>
293&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
294<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
295<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
296<TH ALIGN="left"><B>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></B></TH>
297</TR>
298<TR BGCOLOR="white" CLASS="TableRowColor">
299<TD><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></TD>
300</TR>
301</TABLE>
302&nbsp;
303<P>
304
305<!-- ========= CONSTRUCTOR DETAIL ======== -->
306
307<A NAME="constructor_detail"><!-- --></A>
308<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
309<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
310<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
311<B>Constructor Detail</B></FONT></TH>
312</TR>
313</TABLE>
314
315<A NAME="JsonSerializer()"><!-- --></A><H3>
316JsonSerializer</H3>
317<PRE>
318public <B>JsonSerializer</B>()</PRE>
319<DL>
320</DL>
321
322<!-- ============ METHOD DETAIL ========== -->
323
324<A NAME="method_detail"><!-- --></A>
325<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
326<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
327<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
328<B>Method Detail</B></FONT></TH>
329</TR>
330</TABLE>
331
332<A NAME="unwrappingSerializer(com.fasterxml.jackson.databind.util.NameTransformer)"><!-- --></A><H3>
333unwrappingSerializer</H3>
334<PRE>
335public <A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&gt; <B>unwrappingSerializer</B>(<A HREF="../../../../com/fasterxml/jackson/databind/util/NameTransformer.html" title="class in com.fasterxml.jackson.databind.util">NameTransformer</A>&nbsp;unwrapper)</PRE>
336<DL>
337<DD>Method that will return serializer instance that produces
338 "unwrapped" serialization, if applicable for type being
339 serialized (which is the case for some serializers
340 that produce JSON Objects as output).
341 If no unwrapped serializer can be constructed, will simply
342 return serializer as-is.
343<p>
344 Default implementation just returns serializer as-is,
345 indicating that no unwrapped variant exists
346<P>
347<DD><DL>
348</DL>
349</DD>
350<DD><DL>
351<DT><B>Parameters:</B><DD><CODE>unwrapper</CODE> - Name transformation to use to convert between names
352   of unwrapper properties</DL>
353</DD>
354</DL>
355<HR>
356
357<A NAME="replaceDelegatee(com.fasterxml.jackson.databind.JsonSerializer)"><!-- --></A><H3>
358replaceDelegatee</H3>
359<PRE>
360public <A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&gt; <B>replaceDelegatee</B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;?&gt;&nbsp;delegatee)</PRE>
361<DL>
362<DD>Method that can be called to try to replace serializer this serializer
363 delegates calls to. If not supported (either this serializer does not
364 delegate anything; or it does not want any changes), should either
365 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
366 make sense or is not allowed); or return this serializer as is.
367<P>
368<DD><DL>
369</DL>
370</DD>
371<DD><DL>
372<DT><B>Since:</B></DT>
373  <DD>2.1</DD>
374</DL>
375</DD>
376</DL>
377<HR>
378
379<A NAME="serialize(java.lang.Object,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider)"><!-- --></A><A NAME="serialize(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)"><!-- --></A><H3>
380serialize</H3>
381<PRE>
382public abstract void <B>serialize</B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&nbsp;value,
383                               <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</A>&nbsp;jgen,
384                               <A HREF="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</A>&nbsp;provider)
385                        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>,
386                               <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonProcessingException.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonProcessingException</A></PRE>
387<DL>
388<DD>Method that can be called to ask implementation to serialize
389 values of type this serializer handles.
390<P>
391<DD><DL>
392</DL>
393</DD>
394<DD><DL>
395<DT><B>Parameters:</B><DD><CODE>value</CODE> - Value to serialize; can <b>not</b> be null.<DD><CODE>jgen</CODE> - Generator used to output resulting Json content<DD><CODE>provider</CODE> - Provider that can be used to get serializers for
396   serializing Objects value contains, if any.
397<DT><B>Throws:</B>
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>
399<DD><CODE><A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonProcessingException.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonProcessingException</A></CODE></DL>
400</DD>
401</DL>
402<HR>
403
404<A NAME="serializeWithType(java.lang.Object,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider,com.fasterxml.jackson.databind.jsontype.TypeSerializer)"><!-- --></A><A NAME="serializeWithType(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer)"><!-- --></A><H3>
405serializeWithType</H3>
406<PRE>
407public void <B>serializeWithType</B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&nbsp;value,
408                              <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</A>&nbsp;jgen,
409                              <A HREF="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</A>&nbsp;provider,
410                              <A HREF="../../../../com/fasterxml/jackson/databind/jsontype/TypeSerializer.html" title="class in com.fasterxml.jackson.databind.jsontype">TypeSerializer</A>&nbsp;typeSer)
411                       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>,
412                              <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonProcessingException.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonProcessingException</A></PRE>
413<DL>
414<DD>Method that can be called to ask implementation to serialize
415 values of type this serializer handles, using specified type serializer
416 for embedding necessary type information.
417<p>
418 Default implementation will 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>
419 to indicate that proper type handling needs to be implemented.
420<p>
421 For simple datatypes written as a single scalar value (JSON String, Number, Boolean),
422 implementation would look like:
423<pre>
424  // note: method to call depends on whether this type is serialized as JSON scalar, object or Array!
425  typeSer.writeTypePrefixForScalar(value, jgen);
426  serialize(value, jgen, provider);
427  typeSer.writeTypeSuffixForScalar(value, jgen);
428</pre>
429 and implementations for type serialized as JSON Arrays or Objects would differ slightly,
430 as <code>START-ARRAY>/<code>END-ARRAY</code> and
431 <code>START-OBJECT>/<code>END-OBJECT</code> pairs
432 need to be properly handled with respect to serializing of contents.
433<P>
434<DD><DL>
435</DL>
436</DD>
437<DD><DL>
438<DT><B>Parameters:</B><DD><CODE>value</CODE> - Value to serialize; can <b>not</b> be null.<DD><CODE>jgen</CODE> - Generator used to output resulting Json content<DD><CODE>provider</CODE> - Provider that can be used to get serializers for
439   serializing Objects value contains, if any.<DD><CODE>typeSer</CODE> - Type serializer to use for including type information
440<DT><B>Throws:</B>
441<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>
442<DD><CODE><A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonProcessingException.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonProcessingException</A></CODE></DL>
443</DD>
444</DL>
445<HR>
446
447<A NAME="handledType()"><!-- --></A><H3>
448handledType</H3>
449<PRE>
450public <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>&lt;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&gt; <B>handledType</B>()</PRE>
451<DL>
452<DD>Method for accessing type of Objects this serializer can handle.
453 Note that this information is not guaranteed to be exact -- it
454 may be a more generic (super-type) -- but it should not be
455 incorrect (return a non-related type).
456<p>
457 Default implementation will return null, which essentially means
458 same as returning <code>Object.class</code> would; that is, that
459 nothing is known about handled type.
460<p>
461<P>
462<DD><DL>
463</DL>
464</DD>
465<DD><DL>
466</DL>
467</DD>
468</DL>
469<HR>
470
471<A NAME="isEmpty(java.lang.Object)"><!-- --></A><A NAME="isEmpty(T)"><!-- --></A><H3>
472isEmpty</H3>
473<PRE>
474public boolean <B>isEmpty</B>(<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</A>&nbsp;value)</PRE>
475<DL>
476<DD>Method called to check whether given serializable value is
477 considered "empty" value (for purposes of suppressing serialization
478 of empty values).
479<p>
480 Default implementation will consider only null values to be empty.
481<P>
482<DD><DL>
483</DL>
484</DD>
485<DD><DL>
486<DT><B>Since:</B></DT>
487  <DD>2.0</DD>
488</DL>
489</DD>
490</DL>
491<HR>
492
493<A NAME="usesObjectId()"><!-- --></A><H3>
494usesObjectId</H3>
495<PRE>
496public boolean <B>usesObjectId</B>()</PRE>
497<DL>
498<DD>Method that can be called to see whether this serializer instance
499 will use Object Id to handle cyclic references.
500<P>
501<DD><DL>
502</DL>
503</DD>
504<DD><DL>
505</DL>
506</DD>
507</DL>
508<HR>
509
510<A NAME="isUnwrappingSerializer()"><!-- --></A><H3>
511isUnwrappingSerializer</H3>
512<PRE>
513public boolean <B>isUnwrappingSerializer</B>()</PRE>
514<DL>
515<DD>Accessor for checking whether this serializer is an
516 "unwrapping" serializer; this is necessary to know since
517 it may also require caller to suppress writing of the
518 leading property name.
519<P>
520<DD><DL>
521</DL>
522</DD>
523<DD><DL>
524</DL>
525</DD>
526</DL>
527<HR>
528
529<A NAME="getDelegatee()"><!-- --></A><H3>
530getDelegatee</H3>
531<PRE>
532public <A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</A>&lt;?&gt; <B>getDelegatee</B>()</PRE>
533<DL>
534<DD>Accessor that can be used to determine if this serializer uses
535 another serializer for actual serialization, by delegating
536 calls. If so, will return immediate delegate (which itself may
537 delegate to further serializers); otherwise will return null.
538<P>
539<DD><DL>
540</DL>
541</DD>
542<DD><DL>
543
544<DT><B>Returns:</B><DD>Serializer this serializer delegates calls to, if null;
545   null otherwise.<DT><B>Since:</B></DT>
546  <DD>2.1</DD>
547</DL>
548</DD>
549</DL>
550<HR>
551
552<A NAME="acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, com.fasterxml.jackson.databind.JavaType)"><!-- --></A><H3>
553acceptJsonFormatVisitor</H3>
554<PRE>
555public void <B>acceptJsonFormatVisitor</B>(<A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitorWrapper</A>&nbsp;visitor,
556                                    <A HREF="../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;type)
557                             throws <A HREF="../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</A></PRE>
558<DL>
559<DD>Default implementation simply calls <A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html#expectAnyFormat(com.fasterxml.jackson.databind.JavaType)"><CODE>JsonFormatVisitorWrapper.expectAnyFormat(JavaType)</CODE></A>.
560<P>
561<DD><DL>
562<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html#acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, com.fasterxml.jackson.databind.JavaType)">acceptJsonFormatVisitor</A></CODE> in interface <CODE><A HREF="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitable</A></CODE></DL>
563</DD>
564<DD><DL>
565<DD><CODE>type</CODE> - Type of element (entity like property) being visited
566<DT><B>Throws:</B>
567<DD><CODE><A HREF="../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</A></CODE><DT><B>Since:</B></DT>
568  <DD>2.1</DD>
569</DL>
570</DD>
571</DL>
572<!-- ========= END OF CLASS DATA ========= -->
573<HR>
574
575
576<!-- ======= START OF BOTTOM NAVBAR ====== -->
577<A NAME="navbar_bottom"><!-- --></A>
578<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
579<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
580<TR>
581<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
582<A NAME="navbar_bottom_firstrow"><!-- --></A>
583<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
584  <TR ALIGN="center" VALIGN="top">
585  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
586  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
587  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
588  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/JsonSerializer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
589  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
590  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
591  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
592  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
593  </TR>
594</TABLE>
595</TD>
596<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
597</EM>
598</TD>
599</TR>
600
601<TR>
602<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
603&nbsp;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializable.html" title="interface in com.fasterxml.jackson.databind"><B>PREV CLASS</B></A>&nbsp;
604&nbsp;<A HREF="../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind"><B>NEXT CLASS</B></A></FONT></TD>
605<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
606  <A HREF="../../../../index.html?com/fasterxml/jackson/databind/JsonSerializer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
607&nbsp;<A HREF="JsonSerializer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
608&nbsp;<SCRIPT type="text/javascript">
609  <!--
610  if(window==top) {
611    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
612  }
613  //-->
614</SCRIPT>
615<NOSCRIPT>
616  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
617</NOSCRIPT>
618
619
620</FONT></TD>
621</TR>
622<TR>
623<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
624  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
625<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
626DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
627</TR>
628</TABLE>
629<A NAME="skip-navbar_bottom"></A>
630<!-- ======== END OF BOTTOM NAVBAR ======= -->
631
632<HR>
633Copyright &#169; 2012 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.
634</BODY>
635</HTML>
636