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_55) on Thu Jan 01 15:31:15 PST 2015 --> 6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 7<title>JsonInclude.Include (Jackson-annotations 2.5.0 API)</title> 8<meta name="date" content="2015-01-01"> 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.5.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: </li> 64<li>Nested | </li> 65<li><a href="#enum_constant_summary">Enum Constants</a> | </li> 66<li>Field | </li> 67<li><a href="#method_summary">Method</a></li> 68</ul> 69<ul class="subNavList"> 70<li>Detail: </li> 71<li><a href="#enum_constant_detail">Enum Constants</a> | </li> 72<li>Field | </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><<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>></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><<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>></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><<a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>></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 now 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"> </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"> </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> 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 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 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 <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 <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 <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 <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 Definition of emptiness is data type specific; see below 270 for details on actual handling. 271<p> 272 Default emptiness is defined for following type: 273<ul> 274 <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, 275 method <code>isEmpty()</code> is called; 276 </li> 277 <li>For Java arrays, empty arrays are ones with length of 0 278 </li> 279 <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, 280 and return value of 0 indicates empty String (note that <code>String.isEmpty()</code> 281 was added in Java 1.6 and as such can not be used by Jackson 282 </li> 283 <li>For date/time types, if timestamp from Epoch is zero (January 1st, 1970, UTC), 284 value is considered empty. 285 </li> 286 <ul> 287 and for other types, null values are excluded but other exclusions (if any). 288<p> 289 Note that this default handling can be overridden by custom 290 <code>JsonSerializer</code> implementation: if method <code>isEmpty()</code> 291 is overridden, it will be called to see if non-null values are 292 considered empty (null is always considered empty).</div> 293</li> 294</ul> 295</li> 296</ul> 297<!-- ============ METHOD DETAIL ========== --> 298<ul class="blockList"> 299<li class="blockList"><a name="method_detail"> 300<!-- --> 301</a> 302<h3>Method Detail</h3> 303<a name="values()"> 304<!-- --> 305</a> 306<ul class="blockList"> 307<li class="blockList"> 308<h4>values</h4> 309<pre>public static <a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a>[] values()</pre> 310<div class="block">Returns an array containing the constants of this enum type, in 311the order they are declared. This method may be used to iterate 312over the constants as follows: 313<pre> 314for (JsonInclude.Include c : JsonInclude.Include.values()) 315 System.out.println(c); 316</pre></div> 317<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in 318the order they are declared</dd></dl> 319</li> 320</ul> 321<a name="valueOf(java.lang.String)"> 322<!-- --> 323</a> 324<ul class="blockListLast"> 325<li class="blockList"> 326<h4>valueOf</h4> 327<pre>public static <a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.Include.html" title="enum in com.fasterxml.jackson.annotation">JsonInclude.Include</a> 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> name)</pre> 328<div class="block">Returns the enum constant of this type with the specified name. 329The string must match <i>exactly</i> an identifier used to declare an 330enum constant in this type. (Extraneous whitespace characters are 331not permitted.)</div> 332<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd> 333<dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd> 334<dt><span class="strong">Throws:</span></dt> 335<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 336with the specified name</dd> 337<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> 338</li> 339</ul> 340</li> 341</ul> 342</li> 343</ul> 344</div> 345</div> 346<!-- ========= END OF CLASS DATA ========= --> 347<!-- ======= START OF BOTTOM NAVBAR ====== --> 348<div class="bottomNav"><a name="navbar_bottom"> 349<!-- --> 350</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 351<!-- --> 352</a> 353<ul class="navList" title="Navigation"> 354<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li> 355<li class="navBarCell1Rev">Class</li> 356<li><a href="class-use/JsonInclude.Include.html">Use</a></li> 357<li><a href="package-tree.html">Tree</a></li> 358<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 359<li><a href="../../../../index-all.html">Index</a></li> 360<li><a href="../../../../help-doc.html">Help</a></li> 361</ul> 362</div> 363<div class="subNav"> 364<ul class="navList"> 365<li><a href="../../../../com/fasterxml/jackson/annotation/JsonInclude.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li> 366<li><a href="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li> 367</ul> 368<ul class="navList"> 369<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonInclude.Include.html" target="_top">Frames</a></li> 370<li><a href="JsonInclude.Include.html" target="_top">No Frames</a></li> 371</ul> 372<ul class="navList" id="allclasses_navbar_bottom"> 373<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 374</ul> 375<div> 376<script type="text/javascript"><!-- 377 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 378 if(window==top) { 379 allClassesLink.style.display = "block"; 380 } 381 else { 382 allClassesLink.style.display = "none"; 383 } 384 //--> 385</script> 386</div> 387<div> 388<ul class="subNavList"> 389<li>Summary: </li> 390<li>Nested | </li> 391<li><a href="#enum_constant_summary">Enum Constants</a> | </li> 392<li>Field | </li> 393<li><a href="#method_summary">Method</a></li> 394</ul> 395<ul class="subNavList"> 396<li>Detail: </li> 397<li><a href="#enum_constant_detail">Enum Constants</a> | </li> 398<li>Field | </li> 399<li><a href="#method_detail">Method</a></li> 400</ul> 401</div> 402<a name="skip-navbar_bottom"> 403<!-- --> 404</a></div> 405<!-- ======== END OF BOTTOM NAVBAR ======= --> 406<p class="legalCopy"><small>Copyright © 2014-2015 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p> 407</body> 408</html> 409