• 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_10-ea) on Mon Apr 22 19:34:31 PDT 2013 -->
6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
7<title>JsonInclude.Include (Jackson-annotations 2.2.0 API)</title>
8<meta name="date" content="2013-04-22">
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="JsonInclude.Include (Jackson-annotations 2.2.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="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li>
29<li class="navBarCell1Rev">Class</li>
30<li><a href="class-use/JsonInclude.Include.html">Use</a></li>
31<li><a href="package-tree.html">Tree</a></li>
32<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
33<li><a href="../../../../index-all.html">Index</a></li>
34<li><a href="../../../../help-doc.html">Help</a></li>
35</ul>
36</div>
37<div class="subNav">
38<ul class="navList">
39<li><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li>
40<li><a href="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li>
41</ul>
42<ul class="navList">
43<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonInclude.Include.html" target="_top">Frames</a></li>
44<li><a href="JsonInclude.Include.html" target="_top">No Frames</a></li>
45</ul>
46<ul class="navList" id="allclasses_navbar_top">
47<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
48</ul>
49<div>
50<script type="text/javascript"><!--
51  allClassesLink = document.getElementById("allclasses_navbar_top");
52  if(window==top) {
53    allClassesLink.style.display = "block";
54  }
55  else {
56    allClassesLink.style.display = "none";
57  }
58  //-->
59</script>
60</div>
61<div>
62<ul class="subNavList">
63<li>Summary:&nbsp;</li>
64<li>Nested&nbsp;|&nbsp;</li>
65<li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li>
66<li>Field&nbsp;|&nbsp;</li>
67<li><a href="#method_summary">Method</a></li>
68</ul>
69<ul class="subNavList">
70<li>Detail:&nbsp;</li>
71<li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li>
72<li>Field&nbsp;|&nbsp;</li>
73<li><a href="#method_detail">Method</a></li>
74</ul>
75</div>
76<a name="skip-navbar_top">
77<!--   -->
78</a></div>
79<!-- ========= END OF TOP NAVBAR ========= -->
80<!-- ======== START OF CLASS DATA ======== -->
81<div class="header">
82<div class="subTitle">com.fasterxml.jackson.annotation</div>
83<h2 title="Enum JsonInclude.Include" class="title">Enum JsonInclude.Include</h2>
84</div>
85<div class="contentContainer">
86<ul class="inheritance">
87<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
88<li>
89<ul class="inheritance">
90<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">java.lang.Enum</a>&lt;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>&gt;</li>
91<li>
92<ul class="inheritance">
93<li>com.fasterxml.jackson.annotation.JsonInclude.Include</li>
94</ul>
95</li>
96</ul>
97</li>
98</ul>
99<div class="description">
100<ul class="blockList">
101<li class="blockList">
102<dl>
103<dt>All Implemented Interfaces:</dt>
104<dd><a href="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>&gt;</dd>
105</dl>
106<dl>
107<dt>Enclosing class:</dt>
108<dd><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.html" title="annotation in com.fasterxml.jackson.annotation">JsonInclude</a></dd>
109</dl>
110<hr>
111<br>
112<pre>public static enum <span class="strong">JsonInclude.Include</span>
113extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>&gt;</pre>
114<div class="block">Enumeration used with <a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonInclude</code></a>
115 to define which properties
116 of Java Beans are to be included in serialization.
117<p>
118 Note: Jackson 1.x had similarly named ("Inclusion") enumeration included
119 in <code>JsonSerialize</code> annotation: it is not deprecated
120 and this value used instead.</div>
121</li>
122</ul>
123</div>
124<div class="summary">
125<ul class="blockList">
126<li class="blockList">
127<!-- =========== ENUM CONSTANT SUMMARY =========== -->
128<ul class="blockList">
129<li class="blockList"><a name="enum_constant_summary">
130<!--   -->
131</a>
132<h3>Enum Constant Summary</h3>
133<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation">
134<caption><span>Enum Constants</span><span class="tabEnd">&nbsp;</span></caption>
135<tr>
136<th class="colOne" scope="col">Enum Constant and Description</th>
137</tr>
138<tr class="altColor">
139<td class="colOne"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html#ALWAYS">ALWAYS</a></strong></code>
140<div class="block">Value that indicates that property is to be always included,
141 independent of value of the property.</div>
142</td>
143</tr>
144<tr class="rowColor">
145<td class="colOne"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html#NON_DEFAULT">NON_DEFAULT</a></strong></code>
146<div class="block">Value that indicates that only properties that have values
147 that differ from default settings (meaning values they have
148 when Bean is constructed with its no-arguments constructor)
149 are to be included.</div>
150</td>
151</tr>
152<tr class="altColor">
153<td class="colOne"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html#NON_EMPTY">NON_EMPTY</a></strong></code>
154<div class="block">Value that indicates that only properties that have values
155 that values that are null or what is considered empty are
156 not to be included.</div>
157</td>
158</tr>
159<tr class="rowColor">
160<td class="colOne"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html#NON_NULL">NON_NULL</a></strong></code>
161<div class="block">Value that indicates that only properties with non-null
162 values are to be included.</div>
163</td>
164</tr>
165</table>
166</li>
167</ul>
168<!-- ========== METHOD SUMMARY =========== -->
169<ul class="blockList">
170<li class="blockList"><a name="method_summary">
171<!--   -->
172</a>
173<h3>Method Summary</h3>
174<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
175<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
176<tr>
177<th class="colFirst" scope="col">Modifier and Type</th>
178<th class="colLast" scope="col">Method and Description</th>
179</tr>
180<tr class="altColor">
181<td class="colFirst"><code>static <a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a></code></td>
182<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html#valueOf(java.lang.String)">valueOf</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
183<div class="block">Returns the enum constant of this type with the specified name.</div>
184</td>
185</tr>
186<tr class="rowColor">
187<td class="colFirst"><code>static <a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>[]</code></td>
188<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html#values()">values</a></strong>()</code>
189<div class="block">Returns an array containing the constants of this enum type, in
190the order they are declared.</div>
191</td>
192</tr>
193</table>
194<ul class="blockList">
195<li class="blockList"><a name="methods_inherited_from_class_java.lang.Enum">
196<!--   -->
197</a>
198<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a></h3>
199<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#compareTo(E)" title="class or interface in java.lang">compareTo</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#getDeclaringClass()" title="class or interface in java.lang">getDeclaringClass</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#name()" title="class or interface in java.lang">name</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#ordinal()" title="class or interface in java.lang">ordinal</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#valueOf(java.lang.Class, java.lang.String)" title="class or interface in java.lang">valueOf</a></code></li>
200</ul>
201<ul class="blockList">
202<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
203<!--   -->
204</a>
205<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
206<code><a href="http://download.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://download.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://download.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://download.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://download.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://download.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></li>
207</ul>
208</li>
209</ul>
210</li>
211</ul>
212</div>
213<div class="details">
214<ul class="blockList">
215<li class="blockList">
216<!-- ============ ENUM CONSTANT DETAIL =========== -->
217<ul class="blockList">
218<li class="blockList"><a name="enum_constant_detail">
219<!--   -->
220</a>
221<h3>Enum Constant Detail</h3>
222<a name="ALWAYS">
223<!--   -->
224</a>
225<ul class="blockList">
226<li class="blockList">
227<h4>ALWAYS</h4>
228<pre>public static final&nbsp;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a> ALWAYS</pre>
229<div class="block">Value that indicates that property is to be always included,
230 independent of value of the property.</div>
231</li>
232</ul>
233<a name="NON_NULL">
234<!--   -->
235</a>
236<ul class="blockList">
237<li class="blockList">
238<h4>NON_NULL</h4>
239<pre>public static final&nbsp;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a> NON_NULL</pre>
240<div class="block">Value that indicates that only properties with non-null
241 values are to be included.</div>
242</li>
243</ul>
244<a name="NON_DEFAULT">
245<!--   -->
246</a>
247<ul class="blockList">
248<li class="blockList">
249<h4>NON_DEFAULT</h4>
250<pre>public static final&nbsp;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a> NON_DEFAULT</pre>
251<div class="block">Value that indicates that only properties that have values
252 that differ from default settings (meaning values they have
253 when Bean is constructed with its no-arguments constructor)
254 are to be included. Value is generally not useful with
255 <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><code>Map</code></a>s, since they have no default values;
256 and if used, works same as <a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html#ALWAYS"><code>ALWAYS</code></a>.</div>
257</li>
258</ul>
259<a name="NON_EMPTY">
260<!--   -->
261</a>
262<ul class="blockListLast">
263<li class="blockList">
264<h4>NON_EMPTY</h4>
265<pre>public static final&nbsp;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a> NON_EMPTY</pre>
266<div class="block">Value that indicates that only properties that have values
267 that values that are null or what is considered empty are
268 not to be included.
269<p>
270 Default emptiness is defined for following type:
271<ul>
272 <li>For <a href="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util"><code>Collection</code></a>s and <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><code>Map</code></a>s,
273    method <code>isEmpty()</code> is called;
274   </li>
275 <li>For Java arrays, empty arrays are ones with length of 0
276   </li>
277 <li>For Java <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a>s, <code>length()</code> is called,
278   and return value of 0 indicates empty String (note that <code>String.isEmpty()</code>
279   was added in Java 1.6 and as such can not be used by Jackson
280   </li>
281 <ul>
282  and for other types, non-null values are to be included.
283<p>
284 Note that this default handling can be overridden by custom
285 <code>JsonSerializer</code> implementation: if method <code>isEmpty()</code>
286 is overridden, it will be called to see if non-null values are
287 considered empty (null is always considered empty).</div>
288</li>
289</ul>
290</li>
291</ul>
292<!-- ============ METHOD DETAIL ========== -->
293<ul class="blockList">
294<li class="blockList"><a name="method_detail">
295<!--   -->
296</a>
297<h3>Method Detail</h3>
298<a name="values()">
299<!--   -->
300</a>
301<ul class="blockList">
302<li class="blockList">
303<h4>values</h4>
304<pre>public static&nbsp;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>[]&nbsp;values()</pre>
305<div class="block">Returns an array containing the constants of this enum type, in
306the order they are declared.  This method may be used to iterate
307over the constants as follows:
308<pre>
309for (JsonInclude.Include c : JsonInclude.Include.values())
310&nbsp;   System.out.println(c);
311</pre></div>
312<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in
313the order they are declared</dd></dl>
314</li>
315</ul>
316<a name="valueOf(java.lang.String)">
317<!--   -->
318</a>
319<ul class="blockListLast">
320<li class="blockList">
321<h4>valueOf</h4>
322<pre>public static&nbsp;<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>&nbsp;valueOf(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
323<div class="block">Returns the enum constant of this type with the specified name.
324The string must match <i>exactly</i> an identifier used to declare an
325enum constant in this type.  (Extraneous whitespace characters are
326not permitted.)</div>
327<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd>
328<dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd>
329<dt><span class="strong">Throws:</span></dt>
330<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if this enum type has no constant
331with the specified name</dd>
332<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the argument is null</dd></dl>
333</li>
334</ul>
335</li>
336</ul>
337</li>
338</ul>
339</div>
340</div>
341<!-- ========= END OF CLASS DATA ========= -->
342<!-- ======= START OF BOTTOM NAVBAR ====== -->
343<div class="bottomNav"><a name="navbar_bottom">
344<!--   -->
345</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
346<!--   -->
347</a>
348<ul class="navList" title="Navigation">
349<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li>
350<li class="navBarCell1Rev">Class</li>
351<li><a href="class-use/JsonInclude.Include.html">Use</a></li>
352<li><a href="package-tree.html">Tree</a></li>
353<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
354<li><a href="../../../../index-all.html">Index</a></li>
355<li><a href="../../../../help-doc.html">Help</a></li>
356</ul>
357</div>
358<div class="subNav">
359<ul class="navList">
360<li><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li>
361<li><a href="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li>
362</ul>
363<ul class="navList">
364<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonInclude.Include.html" target="_top">Frames</a></li>
365<li><a href="JsonInclude.Include.html" target="_top">No Frames</a></li>
366</ul>
367<ul class="navList" id="allclasses_navbar_bottom">
368<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
369</ul>
370<div>
371<script type="text/javascript"><!--
372  allClassesLink = document.getElementById("allclasses_navbar_bottom");
373  if(window==top) {
374    allClassesLink.style.display = "block";
375  }
376  else {
377    allClassesLink.style.display = "none";
378  }
379  //-->
380</script>
381</div>
382<div>
383<ul class="subNavList">
384<li>Summary:&nbsp;</li>
385<li>Nested&nbsp;|&nbsp;</li>
386<li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li>
387<li>Field&nbsp;|&nbsp;</li>
388<li><a href="#method_summary">Method</a></li>
389</ul>
390<ul class="subNavList">
391<li>Detail:&nbsp;</li>
392<li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li>
393<li>Field&nbsp;|&nbsp;</li>
394<li><a href="#method_detail">Method</a></li>
395</ul>
396</div>
397<a name="skip-navbar_bottom">
398<!--   -->
399</a></div>
400<!-- ======== END OF BOTTOM NAVBAR ======= -->
401<p class="legalCopy"><small>Copyright &#169; 2012-2013 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p>
402</body>
403</html>
404