• 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 lang="en">
4<head>
5<!-- Generated by javadoc (version 1.7.0_79) on Fri Jan 15 20:28:40 PST 2016 -->
6<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7<title>JsonSerializer (jackson-databind 2.7.0 API)</title>
8<meta name="date" content="2016-01-15">
9<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
10</head>
11<body>
12<script type="text/javascript"><!--
13    if (location.href.indexOf('is-external=true') == -1) {
14        parent.document.title="JsonSerializer (jackson-databind 2.7.0 API)";
15    }
16//-->
17</script>
18<noscript>
19<div>JavaScript is disabled on your browser.</div>
20</noscript>
21<!-- ========= START OF TOP NAVBAR ======= -->
22<div class="topNav"><a name="navbar_top">
23<!--   -->
24</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
25<!--   -->
26</a>
27<ul class="navList" title="Navigation">
28<li><a href="../../../../overview-summary.html">Overview</a></li>
29<li><a href="package-summary.html">Package</a></li>
30<li class="navBarCell1Rev">Class</li>
31<li><a href="class-use/JsonSerializer.html">Use</a></li>
32<li><a href="package-tree.html">Tree</a></li>
33<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
34<li><a href="../../../../index-all.html">Index</a></li>
35<li><a href="../../../../help-doc.html">Help</a></li>
36</ul>
37</div>
38<div class="subNav">
39<ul class="navList">
40<li><a href="../../../../com/fasterxml/jackson/databind/JsonSerializable.Base.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Prev Class</span></a></li>
41<li><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Next Class</span></a></li>
42</ul>
43<ul class="navList">
44<li><a href="../../../../index.html?com/fasterxml/jackson/databind/JsonSerializer.html" target="_top">Frames</a></li>
45<li><a href="JsonSerializer.html" target="_top">No Frames</a></li>
46</ul>
47<ul class="navList" id="allclasses_navbar_top">
48<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
49</ul>
50<div>
51<script type="text/javascript"><!--
52  allClassesLink = document.getElementById("allclasses_navbar_top");
53  if(window==top) {
54    allClassesLink.style.display = "block";
55  }
56  else {
57    allClassesLink.style.display = "none";
58  }
59  //-->
60</script>
61</div>
62<div>
63<ul class="subNavList">
64<li>Summary:&nbsp;</li>
65<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
66<li>Field&nbsp;|&nbsp;</li>
67<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
68<li><a href="#method_summary">Method</a></li>
69</ul>
70<ul class="subNavList">
71<li>Detail:&nbsp;</li>
72<li>Field&nbsp;|&nbsp;</li>
73<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
74<li><a href="#method_detail">Method</a></li>
75</ul>
76</div>
77<a name="skip-navbar_top">
78<!--   -->
79</a></div>
80<!-- ========= END OF TOP NAVBAR ========= -->
81<!-- ======== START OF CLASS DATA ======== -->
82<div class="header">
83<div class="subTitle">com.fasterxml.jackson.databind</div>
84<h2 title="Class JsonSerializer" class="title">Class JsonSerializer&lt;T&gt;</h2>
85</div>
86<div class="contentContainer">
87<ul class="inheritance">
88<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
89<li>
90<ul class="inheritance">
91<li>com.fasterxml.jackson.databind.JsonSerializer&lt;T&gt;</li>
92</ul>
93</li>
94</ul>
95<div class="description">
96<ul class="blockList">
97<li class="blockList">
98<dl>
99<dt>All Implemented Interfaces:</dt>
100<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>Direct Known Subclasses:</dt>
104<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>
105</dl>
106<hr>
107<br>
108<pre>public abstract class <span class="strong">JsonSerializer&lt;T&gt;</span>
109extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
110implements <a href="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitable</a></pre>
111<div class="block">Abstract 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.7/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core"><code>JsonGenerator</code></a>.
114 <a href="../../../../com/fasterxml/jackson/databind/ser/std/StdSerializer.html" title="class in com.fasterxml.jackson.databind.ser.std"><code>StdSerializer</code></a> instead
115 of this class, since it will implement many of optional
116 methods of this class.
117<p>
118 NOTE: various <code>serialize</code> methods are never (to be) called
119 with null values -- caller <b>must</b> handle null values, usually
120 by calling <a href="../../../../com/fasterxml/jackson/databind/SerializerProvider.html#findNullValueSerializer(com.fasterxml.jackson.databind.BeanProperty)"><code>SerializerProvider.findNullValueSerializer(com.fasterxml.jackson.databind.BeanProperty)</code></a> to obtain
121 serializer to use.
122 This also means that custom serializers can not be directly used to change
123 the output to produce when serializing null values.
124<p>
125 If serializer is an aggregate one -- meaning it delegates handling of some
126 of its contents by using other serializer(s) -- it typically also needs
127 to implement <a href="../../../../com/fasterxml/jackson/databind/ser/ResolvableSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><code>ResolvableSerializer</code></a>,
128 which can locate secondary serializers needed. This is important to allow dynamic
129 overrides of serializers; separate call interface is needed to separate
130 resolution of secondary serializers (which may have cyclic link back
131 to serializer itself, directly or indirectly).
132<p>
133 In addition, to support per-property annotations (to configure aspects
134 of serialization on per-property basis), serializers may want
135 to implement
136 <a href="../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><code>ContextualSerializer</code></a>,
137 which allows specialization of serializers: call to
138 <a href="../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html#createContextual(com.fasterxml.jackson.databind.SerializerProvider,%20com.fasterxml.jackson.databind.BeanProperty)"><code>ContextualSerializer.createContextual(com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.BeanProperty)</code></a>
139 is passed information on property, and can create a newly configured
140 serializer for handling that particular property.
141<p>
142 If both
143 <a href="../../../../com/fasterxml/jackson/databind/ser/ResolvableSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><code>ResolvableSerializer</code></a> and
144 <a href="../../../../com/fasterxml/jackson/databind/ser/ContextualSerializer.html" title="interface in com.fasterxml.jackson.databind.ser"><code>ContextualSerializer</code></a>
145 are implemented, resolution of serializers occurs before
146 contextualization.</div>
147</li>
148</ul>
149</div>
150<div class="summary">
151<ul class="blockList">
152<li class="blockList">
153<!-- ======== NESTED CLASS SUMMARY ======== -->
154<ul class="blockList">
155<li class="blockList"><a name="nested_class_summary">
156<!--   -->
157</a>
158<h3>Nested Class Summary</h3>
159<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
160<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
161<tr>
162<th class="colFirst" scope="col">Modifier and Type</th>
163<th class="colLast" scope="col">Class and Description</th>
164</tr>
165<tr class="altColor">
166<td class="colFirst"><code>static class&nbsp;</code></td>
167<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind">JsonSerializer.None</a></strong></code>
168<div class="block">This marker class is only to be used with annotations, to
169 indicate that <b>no serializer is configured</b>.</div>
170</td>
171</tr>
172</table>
173</li>
174</ul>
175<!-- ======== CONSTRUCTOR SUMMARY ======== -->
176<ul class="blockList">
177<li class="blockList"><a name="constructor_summary">
178<!--   -->
179</a>
180<h3>Constructor Summary</h3>
181<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
182<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
183<tr>
184<th class="colOne" scope="col">Constructor and Description</th>
185</tr>
186<tr class="altColor">
187<td class="colOne"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#JsonSerializer()">JsonSerializer</a></strong>()</code>&nbsp;</td>
188</tr>
189</table>
190</li>
191</ul>
192<!-- ========== METHOD SUMMARY =========== -->
193<ul class="blockList">
194<li class="blockList"><a name="method_summary">
195<!--   -->
196</a>
197<h3>Method Summary</h3>
198<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
199<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
200<tr>
201<th class="colFirst" scope="col">Modifier and Type</th>
202<th class="colLast" scope="col">Method and Description</th>
203</tr>
204<tr class="altColor">
205<td class="colFirst"><code>void</code></td>
206<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper,%20com.fasterxml.jackson.databind.JavaType)">acceptJsonFormatVisitor</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitorWrapper</a>&nbsp;visitor,
207                       <a href="../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a>&nbsp;type)</code>
208<div class="block">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>.</div>
209</td>
210</tr>
211<tr class="rowColor">
212<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a>&lt;?&gt;</code></td>
213<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#getDelegatee()">getDelegatee</a></strong>()</code>
214<div class="block">Accessor that can be used to determine if this serializer uses
215 another serializer for actual serialization, by delegating
216 calls.</div>
217</td>
218</tr>
219<tr class="altColor">
220<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/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></td>
221<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#handledType()">handledType</a></strong>()</code>
222<div class="block">Method for accessing type of Objects this serializer can handle.</div>
223</td>
224</tr>
225<tr class="rowColor">
226<td class="colFirst"><code>boolean</code></td>
227<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty(com.fasterxml.jackson.databind.SerializerProvider,%20T)">isEmpty</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a>&nbsp;provider,
228       <a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value)</code>
229<div class="block">Method called to check whether given serializable value is
230 considered "empty" value (for purposes of suppressing serialization
231 of empty values).</div>
232</td>
233</tr>
234<tr class="altColor">
235<td class="colFirst"><code>boolean</code></td>
236<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty(T)">isEmpty</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value)</code>
237<div class="block"><strong>Deprecated.</strong>&nbsp;
238<div class="block"><i>Since 2.5 Use <a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty(com.fasterxml.jackson.databind.SerializerProvider,%20T)"><code>isEmpty(SerializerProvider, Object)</code></a> instead;
239   will be removed from 2.8</i></div>
240</div>
241</td>
242</tr>
243<tr class="rowColor">
244<td class="colFirst"><code>boolean</code></td>
245<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isUnwrappingSerializer()">isUnwrappingSerializer</a></strong>()</code>
246<div class="block">Accessor for checking whether this serializer is an
247 "unwrapping" serializer; this is necessary to know since
248 it may also require caller to suppress writing of the
249 leading property name.</div>
250</td>
251</tr>
252<tr class="altColor">
253<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a>&lt;<a href="../../../../com/fasterxml/jackson/databind/ser/PropertyWriter.html" title="class in com.fasterxml.jackson.databind.ser">PropertyWriter</a>&gt;</code></td>
254<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#properties()">properties</a></strong>()</code>
255<div class="block">Accessor for iterating over logical properties that the type
256 handled by this serializer has, from serialization perspective.</div>
257</td>
258</tr>
259<tr class="rowColor">
260<td class="colFirst"><code><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></td>
261<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#replaceDelegatee(com.fasterxml.jackson.databind.JsonSerializer)">replaceDelegatee</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a>&lt;?&gt;&nbsp;delegatee)</code>
262<div class="block">Method that can be called to try to replace serializer this serializer
263 delegates calls to.</div>
264</td>
265</tr>
266<tr class="altColor">
267<td class="colFirst"><code>abstract void</code></td>
268<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#serialize(T,%20com.fasterxml.jackson.core.JsonGenerator,%20com.fasterxml.jackson.databind.SerializerProvider)">serialize</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value,
269         <a href="http://fasterxml.github.com/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</a>&nbsp;gen,
270         <a href="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a>&nbsp;serializers)</code>
271<div class="block">Method that can be called to ask implementation to serialize
272 values of type this serializer handles.</div>
273</td>
274</tr>
275<tr class="rowColor">
276<td class="colFirst"><code>void</code></td>
277<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#serializeWithType(T,%20com.fasterxml.jackson.core.JsonGenerator,%20com.fasterxml.jackson.databind.SerializerProvider,%20com.fasterxml.jackson.databind.jsontype.TypeSerializer)">serializeWithType</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value,
278                 <a href="http://fasterxml.github.com/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</a>&nbsp;gen,
279                 <a href="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a>&nbsp;serializers,
280                 <a href="../../../../com/fasterxml/jackson/databind/jsontype/TypeSerializer.html" title="class in com.fasterxml.jackson.databind.jsontype">TypeSerializer</a>&nbsp;typeSer)</code>
281<div class="block">Method that can be called to ask implementation to serialize
282 values of type this serializer handles, using specified type serializer
283 for embedding necessary type information.</div>
284</td>
285</tr>
286<tr class="altColor">
287<td class="colFirst"><code><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></td>
288<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#unwrappingSerializer(com.fasterxml.jackson.databind.util.NameTransformer)">unwrappingSerializer</a></strong>(<a href="../../../../com/fasterxml/jackson/databind/util/NameTransformer.html" title="class in com.fasterxml.jackson.databind.util">NameTransformer</a>&nbsp;unwrapper)</code>
289<div class="block">Method that will return serializer instance that produces
290 "unwrapped" serialization, if applicable for type being
291 serialized (which is the case for some serializers
292 that produce JSON Objects as output).</div>
293</td>
294</tr>
295<tr class="rowColor">
296<td class="colFirst"><code>boolean</code></td>
297<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#usesObjectId()">usesObjectId</a></strong>()</code>
298<div class="block">Method that can be called to see whether this serializer instance
299 will use Object Id to handle cyclic references.</div>
300</td>
301</tr>
302<tr class="altColor">
303<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a>&lt;?&gt;</code></td>
304<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#withFilterId(java.lang.Object)">withFilterId</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;filterId)</code>
305<div class="block">Mutant factory method that is called if contextual configuration indicates that
306 a specific filter (as specified by <code>filterId</code>) is to be used for
307 serialization.</div>
308</td>
309</tr>
310</table>
311<ul class="blockList">
312<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
313<!--   -->
314</a>
315<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
316<code><a href="http://docs.oracle.com/javase/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
317</ul>
318</li>
319</ul>
320</li>
321</ul>
322</div>
323<div class="details">
324<ul class="blockList">
325<li class="blockList">
326<!-- ========= CONSTRUCTOR DETAIL ======== -->
327<ul class="blockList">
328<li class="blockList"><a name="constructor_detail">
329<!--   -->
330</a>
331<h3>Constructor Detail</h3>
332<a name="JsonSerializer()">
333<!--   -->
334</a>
335<ul class="blockListLast">
336<li class="blockList">
337<h4>JsonSerializer</h4>
338<pre>public&nbsp;JsonSerializer()</pre>
339</li>
340</ul>
341</li>
342</ul>
343<!-- ============ METHOD DETAIL ========== -->
344<ul class="blockList">
345<li class="blockList"><a name="method_detail">
346<!--   -->
347</a>
348<h3>Method Detail</h3>
349<a name="unwrappingSerializer(com.fasterxml.jackson.databind.util.NameTransformer)">
350<!--   -->
351</a>
352<ul class="blockList">
353<li class="blockList">
354<h4>unwrappingSerializer</h4>
355<pre>public&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;&nbsp;unwrappingSerializer(<a href="../../../../com/fasterxml/jackson/databind/util/NameTransformer.html" title="class in com.fasterxml.jackson.databind.util">NameTransformer</a>&nbsp;unwrapper)</pre>
356<div class="block">Method that will return serializer instance that produces
357 "unwrapped" serialization, if applicable for type being
358 serialized (which is the case for some serializers
359 that produce JSON Objects as output).
360 If no unwrapped serializer can be constructed, will simply
361 return serializer as-is.
362<p>
363 Default implementation just returns serializer as-is,
364 indicating that no unwrapped variant exists</div>
365<dl><dt><span class="strong">Parameters:</span></dt><dd><code>unwrapper</code> - Name transformation to use to convert between names
366   of unwrapper properties</dd></dl>
367</li>
368</ul>
369<a name="replaceDelegatee(com.fasterxml.jackson.databind.JsonSerializer)">
370<!--   -->
371</a>
372<ul class="blockList">
373<li class="blockList">
374<h4>replaceDelegatee</h4>
375<pre>public&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;&nbsp;replaceDelegatee(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a>&lt;?&gt;&nbsp;delegatee)</pre>
376<div class="block">Method that can be called to try to replace serializer this serializer
377 delegates calls to. If not supported (either this serializer does not
378 delegate anything; or it does not want any changes), should either
379 throw <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang"><code>UnsupportedOperationException</code></a> (if operation does not
380 make sense or is not allowed); or return this serializer as is.</div>
381<dl><dt><span class="strong">Since:</span></dt>
382  <dd>2.1</dd></dl>
383</li>
384</ul>
385<a name="withFilterId(java.lang.Object)">
386<!--   -->
387</a>
388<ul class="blockList">
389<li class="blockList">
390<h4>withFilterId</h4>
391<pre>public&nbsp;<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a>&lt;?&gt;&nbsp;withFilterId(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;filterId)</pre>
392<div class="block">Mutant factory method that is called if contextual configuration indicates that
393 a specific filter (as specified by <code>filterId</code>) is to be used for
394 serialization.
395<p>
396 Default implementation simply returns <code>this</code>; sub-classes that do support
397 filtering will need to create and return new instance if filter changes.</div>
398<dl><dt><span class="strong">Since:</span></dt>
399  <dd>2.6</dd></dl>
400</li>
401</ul>
402<a name="serialize(java.lang.Object,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider)">
403<!--   -->
404</a><a name="serialize(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)">
405<!--   -->
406</a>
407<ul class="blockList">
408<li class="blockList">
409<h4>serialize</h4>
410<pre>public abstract&nbsp;void&nbsp;serialize(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value,
411             <a href="http://fasterxml.github.com/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</a>&nbsp;gen,
412             <a href="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a>&nbsp;serializers)
413                        throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
414                               <a href="http://fasterxml.github.com/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonProcessingException.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonProcessingException</a></pre>
415<div class="block">Method that can be called to ask implementation to serialize
416 values of type this serializer handles.</div>
417<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - Value to serialize; can <b>not</b> be null.</dd><dd><code>gen</code> - Generator used to output resulting Json content</dd><dd><code>serializers</code> - Provider that can be used to get serializers for
418   serializing Objects value contains, if any.</dd>
419<dt><span class="strong">Throws:</span></dt>
420<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
421<dd><code><a href="http://fasterxml.github.com/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonProcessingException.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonProcessingException</a></code></dd></dl>
422</li>
423</ul>
424<a name="serializeWithType(java.lang.Object,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider,com.fasterxml.jackson.databind.jsontype.TypeSerializer)">
425<!--   -->
426</a><a name="serializeWithType(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer)">
427<!--   -->
428</a>
429<ul class="blockList">
430<li class="blockList">
431<h4>serializeWithType</h4>
432<pre>public&nbsp;void&nbsp;serializeWithType(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value,
433                     <a href="http://fasterxml.github.com/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonGenerator.html?is-external=true" title="class or interface in com.fasterxml.jackson.core">JsonGenerator</a>&nbsp;gen,
434                     <a href="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a>&nbsp;serializers,
435                     <a href="../../../../com/fasterxml/jackson/databind/jsontype/TypeSerializer.html" title="class in com.fasterxml.jackson.databind.jsontype">TypeSerializer</a>&nbsp;typeSer)
436                       throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
437<div class="block">Method that can be called to ask implementation to serialize
438 values of type this serializer handles, using specified type serializer
439 for embedding necessary type information.
440<p>
441 Default implementation will throw <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang"><code>UnsupportedOperationException</code></a>
442 to indicate that proper type handling needs to be implemented.
443<p>
444 For simple datatypes written as a single scalar value (JSON String, Number, Boolean),
445 implementation would look like:
446<pre>
447  // note: method to call depends on whether this type is serialized as JSON scalar, object or Array!
448  typeSer.writeTypePrefixForScalar(value, gen);
449  serialize(value, gen, provider);
450  typeSer.writeTypeSuffixForScalar(value, gen);
451</pre>
452 and implementations for type serialized as JSON Arrays or Objects would differ slightly,
453 as <code>START-ARRAY</code>/<code>END-ARRAY</code> and
454 <code>START-OBJECT</code>/<code>END-OBJECT</code> pairs
455 need to be properly handled with respect to serializing of contents.</div>
456<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - Value to serialize; can <b>not</b> be null.</dd><dd><code>gen</code> - Generator used to output resulting Json content</dd><dd><code>serializers</code> - Provider that can be used to get serializers for
457   serializing Objects value contains, if any.</dd><dd><code>typeSer</code> - Type serializer to use for including type information</dd>
458<dt><span class="strong">Throws:</span></dt>
459<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd></dl>
460</li>
461</ul>
462<a name="handledType()">
463<!--   -->
464</a>
465<ul class="blockList">
466<li class="blockList">
467<h4>handledType</h4>
468<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/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;&nbsp;handledType()</pre>
469<div class="block">Method for accessing type of Objects this serializer can handle.
470 Note that this information is not guaranteed to be exact -- it
471 may be a more generic (super-type) -- but it should not be
472 incorrect (return a non-related type).
473<p>
474 Default implementation will return null, which essentially means
475 same as returning <code>Object.class</code> would; that is, that
476 nothing is known about handled type.
477<p></div>
478</li>
479</ul>
480<a name="isEmpty(java.lang.Object)">
481<!--   -->
482</a><a name="isEmpty(T)">
483<!--   -->
484</a>
485<ul class="blockList">
486<li class="blockList">
487<h4>isEmpty</h4>
488<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
489public&nbsp;boolean&nbsp;isEmpty(<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value)</pre>
490<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>Since 2.5 Use <a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty(com.fasterxml.jackson.databind.SerializerProvider,%20T)"><code>isEmpty(SerializerProvider, Object)</code></a> instead;
491   will be removed from 2.8</i></div>
492<div class="block">Method called to check whether given serializable value is
493 considered "empty" value (for purposes of suppressing serialization
494 of empty values).
495<p>
496 Default implementation will consider only null values to be empty.</div>
497<dl><dt><span class="strong">Since:</span></dt>
498  <dd>2.0</dd></dl>
499</li>
500</ul>
501<a name="isEmpty(com.fasterxml.jackson.databind.SerializerProvider,java.lang.Object)">
502<!--   -->
503</a><a name="isEmpty(com.fasterxml.jackson.databind.SerializerProvider, T)">
504<!--   -->
505</a>
506<ul class="blockList">
507<li class="blockList">
508<h4>isEmpty</h4>
509<pre>public&nbsp;boolean&nbsp;isEmpty(<a href="../../../../com/fasterxml/jackson/databind/SerializerProvider.html" title="class in com.fasterxml.jackson.databind">SerializerProvider</a>&nbsp;provider,
510              <a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="type parameter in JsonSerializer">T</a>&nbsp;value)</pre>
511<div class="block">Method called to check whether given serializable value is
512 considered "empty" value (for purposes of suppressing serialization
513 of empty values).
514<p>
515 Default implementation will consider only null values to be empty.
516<p>
517 NOTE: replaces <a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html#isEmpty(T)"><code>isEmpty(Object)</code></a>, deprecated in 2.5</div>
518<dl><dt><span class="strong">Since:</span></dt>
519  <dd>2.5</dd></dl>
520</li>
521</ul>
522<a name="usesObjectId()">
523<!--   -->
524</a>
525<ul class="blockList">
526<li class="blockList">
527<h4>usesObjectId</h4>
528<pre>public&nbsp;boolean&nbsp;usesObjectId()</pre>
529<div class="block">Method that can be called to see whether this serializer instance
530 will use Object Id to handle cyclic references.</div>
531</li>
532</ul>
533<a name="isUnwrappingSerializer()">
534<!--   -->
535</a>
536<ul class="blockList">
537<li class="blockList">
538<h4>isUnwrappingSerializer</h4>
539<pre>public&nbsp;boolean&nbsp;isUnwrappingSerializer()</pre>
540<div class="block">Accessor for checking whether this serializer is an
541 "unwrapping" serializer; this is necessary to know since
542 it may also require caller to suppress writing of the
543 leading property name.</div>
544</li>
545</ul>
546<a name="getDelegatee()">
547<!--   -->
548</a>
549<ul class="blockList">
550<li class="blockList">
551<h4>getDelegatee</h4>
552<pre>public&nbsp;<a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.html" title="class in com.fasterxml.jackson.databind">JsonSerializer</a>&lt;?&gt;&nbsp;getDelegatee()</pre>
553<div class="block">Accessor that can be used to determine if this serializer uses
554 another serializer for actual serialization, by delegating
555 calls. If so, will return immediate delegate (which itself may
556 delegate to further serializers); otherwise will return null.</div>
557<dl><dt><span class="strong">Returns:</span></dt><dd>Serializer this serializer delegates calls to, if null;
558   null otherwise.</dd><dt><span class="strong">Since:</span></dt>
559  <dd>2.1</dd></dl>
560</li>
561</ul>
562<a name="properties()">
563<!--   -->
564</a>
565<ul class="blockList">
566<li class="blockList">
567<h4>properties</h4>
568<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a>&lt;<a href="../../../../com/fasterxml/jackson/databind/ser/PropertyWriter.html" title="class in com.fasterxml.jackson.databind.ser">PropertyWriter</a>&gt;&nbsp;properties()</pre>
569<div class="block">Accessor for iterating over logical properties that the type
570 handled by this serializer has, from serialization perspective.
571 Actual type of properties, if any, will be
572 <a href="../../../../com/fasterxml/jackson/databind/ser/BeanPropertyWriter.html" title="class in com.fasterxml.jackson.databind.ser"><code>BeanPropertyWriter</code></a>.
573 Of standard Jackson serializers, only <a href="../../../../com/fasterxml/jackson/databind/ser/BeanSerializer.html" title="class in com.fasterxml.jackson.databind.ser"><code>BeanSerializer</code></a>
574 exposes properties.</div>
575<dl><dt><span class="strong">Since:</span></dt>
576  <dd>2.6</dd></dl>
577</li>
578</ul>
579<a name="acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, com.fasterxml.jackson.databind.JavaType)">
580<!--   -->
581</a>
582<ul class="blockListLast">
583<li class="blockList">
584<h4>acceptJsonFormatVisitor</h4>
585<pre>public&nbsp;void&nbsp;acceptJsonFormatVisitor(<a href="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitorWrapper.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitorWrapper</a>&nbsp;visitor,
586                           <a href="../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a>&nbsp;type)
587                             throws <a href="../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</a></pre>
588<div class="block">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>.</div>
589<dl>
590<dt><strong>Specified by:</strong></dt>
591<dd><code><a href="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html#acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper,%20com.fasterxml.jackson.databind.JavaType)">acceptJsonFormatVisitor</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../com/fasterxml/jackson/databind/jsonFormatVisitors/JsonFormatVisitable.html" title="interface in com.fasterxml.jackson.databind.jsonFormatVisitors">JsonFormatVisitable</a></code></dd>
592<dd><code>type</code> - Type of element (entity like property) being visited</dd>
593<dt><span class="strong">Throws:</span></dt>
594<dd><code><a href="../../../../com/fasterxml/jackson/databind/JsonMappingException.html" title="class in com.fasterxml.jackson.databind">JsonMappingException</a></code></dd><dt><span class="strong">Since:</span></dt>
595  <dd>2.1</dd></dl>
596</li>
597</ul>
598</li>
599</ul>
600</li>
601</ul>
602</div>
603</div>
604<!-- ========= END OF CLASS DATA ========= -->
605<!-- ======= START OF BOTTOM NAVBAR ====== -->
606<div class="bottomNav"><a name="navbar_bottom">
607<!--   -->
608</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
609<!--   -->
610</a>
611<ul class="navList" title="Navigation">
612<li><a href="../../../../overview-summary.html">Overview</a></li>
613<li><a href="package-summary.html">Package</a></li>
614<li class="navBarCell1Rev">Class</li>
615<li><a href="class-use/JsonSerializer.html">Use</a></li>
616<li><a href="package-tree.html">Tree</a></li>
617<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
618<li><a href="../../../../index-all.html">Index</a></li>
619<li><a href="../../../../help-doc.html">Help</a></li>
620</ul>
621</div>
622<div class="subNav">
623<ul class="navList">
624<li><a href="../../../../com/fasterxml/jackson/databind/JsonSerializable.Base.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Prev Class</span></a></li>
625<li><a href="../../../../com/fasterxml/jackson/databind/JsonSerializer.None.html" title="class in com.fasterxml.jackson.databind"><span class="strong">Next Class</span></a></li>
626</ul>
627<ul class="navList">
628<li><a href="../../../../index.html?com/fasterxml/jackson/databind/JsonSerializer.html" target="_top">Frames</a></li>
629<li><a href="JsonSerializer.html" target="_top">No Frames</a></li>
630</ul>
631<ul class="navList" id="allclasses_navbar_bottom">
632<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
633</ul>
634<div>
635<script type="text/javascript"><!--
636  allClassesLink = document.getElementById("allclasses_navbar_bottom");
637  if(window==top) {
638    allClassesLink.style.display = "block";
639  }
640  else {
641    allClassesLink.style.display = "none";
642  }
643  //-->
644</script>
645</div>
646<div>
647<ul class="subNavList">
648<li>Summary:&nbsp;</li>
649<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
650<li>Field&nbsp;|&nbsp;</li>
651<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
652<li><a href="#method_summary">Method</a></li>
653</ul>
654<ul class="subNavList">
655<li>Detail:&nbsp;</li>
656<li>Field&nbsp;|&nbsp;</li>
657<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
658<li><a href="#method_detail">Method</a></li>
659</ul>
660</div>
661<a name="skip-navbar_bottom">
662<!--   -->
663</a></div>
664<!-- ======== END OF BOTTOM NAVBAR ======= -->
665<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2016 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
666</body>
667</html>
668