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_25) on Mon Jun 02 17:48:55 PDT 2014 --> 6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 7<title>JsonSerialize.Inclusion (jackson-databind 2.4.0 API)</title> 8<meta name="date" content="2014-06-02"> 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="JsonSerialize.Inclusion (jackson-databind 2.4.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/JsonSerialize.Inclusion.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/annotation/JsonSerialize.html" title="annotation in com.fasterxml.jackson.databind.annotation"><span class="strong">Prev Class</span></a></li> 41<li><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Typing.html" title="enum in com.fasterxml.jackson.databind.annotation"><span class="strong">Next Class</span></a></li> 42</ul> 43<ul class="navList"> 44<li><a href="../../../../../index.html?com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" target="_top">Frames</a></li> 45<li><a href="JsonSerialize.Inclusion.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: </li> 65<li>Nested | </li> 66<li><a href="#enum_constant_summary">Enum Constants</a> | </li> 67<li>Field | </li> 68<li><a href="#method_summary">Method</a></li> 69</ul> 70<ul class="subNavList"> 71<li>Detail: </li> 72<li><a href="#enum_constant_detail">Enum Constants</a> | </li> 73<li>Field | </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.annotation</div> 84<h2 title="Enum JsonSerialize.Inclusion" class="title">Enum JsonSerialize.Inclusion</h2> 85</div> 86<div class="contentContainer"> 87<ul class="inheritance"> 88<li><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></li> 89<li> 90<ul class="inheritance"> 91<li><a href="http://docs.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/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a>></li> 92<li> 93<ul class="inheritance"> 94<li>com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion</li> 95</ul> 96</li> 97</ul> 98</li> 99</ul> 100<div class="description"> 101<ul class="blockList"> 102<li class="blockList"> 103<dl> 104<dt>All Implemented Interfaces:</dt> 105<dd><a href="http://docs.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://docs.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/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a>></dd> 106</dl> 107<dl> 108<dt>Enclosing class:</dt> 109<dd><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.html" title="annotation in com.fasterxml.jackson.databind.annotation">JsonSerialize</a></dd> 110</dl> 111<hr> 112<br> 113<pre>public static enum <span class="strong">JsonSerialize.Inclusion</span> 114extends <a href="http://docs.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/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a>></pre> 115<div class="block">Enumeration used with <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.html#include()"><code>JsonSerialize.include()</code></a> property 116 to define which properties 117 of Java Beans are to be included in serialization</div> 118</li> 119</ul> 120</div> 121<div class="summary"> 122<ul class="blockList"> 123<li class="blockList"> 124<!-- =========== ENUM CONSTANT SUMMARY =========== --> 125<ul class="blockList"> 126<li class="blockList"><a name="enum_constant_summary"> 127<!-- --> 128</a> 129<h3>Enum Constant Summary</h3> 130<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation"> 131<caption><span>Enum Constants</span><span class="tabEnd"> </span></caption> 132<tr> 133<th class="colOne" scope="col">Enum Constant and Description</th> 134</tr> 135<tr class="altColor"> 136<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#ALWAYS">ALWAYS</a></strong></code> 137<div class="block">Value that indicates that properties are to be always included, 138 independent of value</div> 139</td> 140</tr> 141<tr class="rowColor"> 142<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#DEFAULT_INCLUSION">DEFAULT_INCLUSION</a></strong></code> 143<div class="block">Pseudo-value that is used to indicate 144 "use whatever is default used at higher level".</div> 145</td> 146</tr> 147<tr class="altColor"> 148<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#NON_DEFAULT">NON_DEFAULT</a></strong></code> 149<div class="block">Value that indicates that only properties that have values 150 that differ from default settings (meaning values they have 151 when Bean is constructed with its no-arguments constructor) 152 are to be included.</div> 153</td> 154</tr> 155<tr class="rowColor"> 156<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#NON_EMPTY">NON_EMPTY</a></strong></code> 157<div class="block">Value that indicates that only properties that have values 158 that values that are null or what is considered empty are 159 not to be included.</div> 160</td> 161</tr> 162<tr class="altColor"> 163<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#NON_NULL">NON_NULL</a></strong></code> 164<div class="block">Value that indicates that only properties with non-null 165 values are to be included.</div> 166</td> 167</tr> 168</table> 169</li> 170</ul> 171<!-- ========== METHOD SUMMARY =========== --> 172<ul class="blockList"> 173<li class="blockList"><a name="method_summary"> 174<!-- --> 175</a> 176<h3>Method Summary</h3> 177<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> 178<caption><span>Methods</span><span class="tabEnd"> </span></caption> 179<tr> 180<th class="colFirst" scope="col">Modifier and Type</th> 181<th class="colLast" scope="col">Method and Description</th> 182</tr> 183<tr class="altColor"> 184<td class="colFirst"><code>static <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a></code></td> 185<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#valueOf(java.lang.String)">valueOf</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> 186<div class="block">Returns the enum constant of this type with the specified name.</div> 187</td> 188</tr> 189<tr class="rowColor"> 190<td class="colFirst"><code>static <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a>[]</code></td> 191<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#values()">values</a></strong>()</code> 192<div class="block">Returns an array containing the constants of this enum type, in 193the order they are declared.</div> 194</td> 195</tr> 196</table> 197<ul class="blockList"> 198<li class="blockList"><a name="methods_inherited_from_class_java.lang.Enum"> 199<!-- --> 200</a> 201<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a></h3> 202<code><a href="http://docs.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://docs.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://docs.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://docs.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://docs.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://docs.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://docs.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://docs.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://docs.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://docs.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> 203</ul> 204<ul class="blockList"> 205<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> 206<!-- --> 207</a> 208<h3>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></h3> 209<code><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#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#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></li> 210</ul> 211</li> 212</ul> 213</li> 214</ul> 215</div> 216<div class="details"> 217<ul class="blockList"> 218<li class="blockList"> 219<!-- ============ ENUM CONSTANT DETAIL =========== --> 220<ul class="blockList"> 221<li class="blockList"><a name="enum_constant_detail"> 222<!-- --> 223</a> 224<h3>Enum Constant Detail</h3> 225<a name="ALWAYS"> 226<!-- --> 227</a> 228<ul class="blockList"> 229<li class="blockList"> 230<h4>ALWAYS</h4> 231<pre>public static final <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a> ALWAYS</pre> 232<div class="block">Value that indicates that properties are to be always included, 233 independent of value</div> 234</li> 235</ul> 236<a name="NON_NULL"> 237<!-- --> 238</a> 239<ul class="blockList"> 240<li class="blockList"> 241<h4>NON_NULL</h4> 242<pre>public static final <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a> NON_NULL</pre> 243<div class="block">Value that indicates that only properties with non-null 244 values are to be included.</div> 245</li> 246</ul> 247<a name="NON_DEFAULT"> 248<!-- --> 249</a> 250<ul class="blockList"> 251<li class="blockList"> 252<h4>NON_DEFAULT</h4> 253<pre>public static final <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a> NON_DEFAULT</pre> 254<div class="block">Value that indicates that only properties that have values 255 that differ from default settings (meaning values they have 256 when Bean is constructed with its no-arguments constructor) 257 are to be included. Value is generally not useful with 258 <a href="http://docs.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; 259 and if used, works same as <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#ALWAYS"><code>ALWAYS</code></a>.</div> 260</li> 261</ul> 262<a name="NON_EMPTY"> 263<!-- --> 264</a> 265<ul class="blockList"> 266<li class="blockList"> 267<h4>NON_EMPTY</h4> 268<pre>public static final <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a> NON_EMPTY</pre> 269<div class="block">Value that indicates that only properties that have values 270 that values that are null or what is considered empty are 271 not to be included. 272 Emptiness is defined for following type: 273<ul> 274 <li>For <a href="http://docs.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://docs.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://docs.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 <ul> 284 For other types, non-null values are to be included.</div> 285</li> 286</ul> 287<a name="DEFAULT_INCLUSION"> 288<!-- --> 289</a> 290<ul class="blockListLast"> 291<li class="blockList"> 292<h4>DEFAULT_INCLUSION</h4> 293<pre>public static final <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a> DEFAULT_INCLUSION</pre> 294<div class="block">Pseudo-value that is used to indicate 295 "use whatever is default used at higher level".</div> 296<dl><dt><span class="strong">Since:</span></dt> 297 <dd>2.3</dd></dl> 298</li> 299</ul> 300</li> 301</ul> 302<!-- ============ METHOD DETAIL ========== --> 303<ul class="blockList"> 304<li class="blockList"><a name="method_detail"> 305<!-- --> 306</a> 307<h3>Method Detail</h3> 308<a name="values()"> 309<!-- --> 310</a> 311<ul class="blockList"> 312<li class="blockList"> 313<h4>values</h4> 314<pre>public static <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a>[] values()</pre> 315<div class="block">Returns an array containing the constants of this enum type, in 316the order they are declared. This method may be used to iterate 317over the constants as follows: 318<pre> 319for (JsonSerialize.Inclusion c : JsonSerialize.Inclusion.values()) 320 System.out.println(c); 321</pre></div> 322<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in 323the order they are declared</dd></dl> 324</li> 325</ul> 326<a name="valueOf(java.lang.String)"> 327<!-- --> 328</a> 329<ul class="blockListLast"> 330<li class="blockList"> 331<h4>valueOf</h4> 332<pre>public static <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" title="enum in com.fasterxml.jackson.databind.annotation">JsonSerialize.Inclusion</a> valueOf(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> 333<div class="block">Returns the enum constant of this type with the specified name. 334The string must match <i>exactly</i> an identifier used to declare an 335enum constant in this type. (Extraneous whitespace characters are 336not permitted.)</div> 337<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd> 338<dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd> 339<dt><span class="strong">Throws:</span></dt> 340<dd><code><a href="http://docs.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 341with the specified name</dd> 342<dd><code><a href="http://docs.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> 343</li> 344</ul> 345</li> 346</ul> 347</li> 348</ul> 349</div> 350</div> 351<!-- ========= END OF CLASS DATA ========= --> 352<!-- ======= START OF BOTTOM NAVBAR ====== --> 353<div class="bottomNav"><a name="navbar_bottom"> 354<!-- --> 355</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 356<!-- --> 357</a> 358<ul class="navList" title="Navigation"> 359<li><a href="../../../../../overview-summary.html">Overview</a></li> 360<li><a href="package-summary.html">Package</a></li> 361<li class="navBarCell1Rev">Class</li> 362<li><a href="class-use/JsonSerialize.Inclusion.html">Use</a></li> 363<li><a href="package-tree.html">Tree</a></li> 364<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 365<li><a href="../../../../../index-all.html">Index</a></li> 366<li><a href="../../../../../help-doc.html">Help</a></li> 367</ul> 368</div> 369<div class="subNav"> 370<ul class="navList"> 371<li><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.html" title="annotation in com.fasterxml.jackson.databind.annotation"><span class="strong">Prev Class</span></a></li> 372<li><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Typing.html" title="enum in com.fasterxml.jackson.databind.annotation"><span class="strong">Next Class</span></a></li> 373</ul> 374<ul class="navList"> 375<li><a href="../../../../../index.html?com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" target="_top">Frames</a></li> 376<li><a href="JsonSerialize.Inclusion.html" target="_top">No Frames</a></li> 377</ul> 378<ul class="navList" id="allclasses_navbar_bottom"> 379<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> 380</ul> 381<div> 382<script type="text/javascript"><!-- 383 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 384 if(window==top) { 385 allClassesLink.style.display = "block"; 386 } 387 else { 388 allClassesLink.style.display = "none"; 389 } 390 //--> 391</script> 392</div> 393<div> 394<ul class="subNavList"> 395<li>Summary: </li> 396<li>Nested | </li> 397<li><a href="#enum_constant_summary">Enum Constants</a> | </li> 398<li>Field | </li> 399<li><a href="#method_summary">Method</a></li> 400</ul> 401<ul class="subNavList"> 402<li>Detail: </li> 403<li><a href="#enum_constant_detail">Enum Constants</a> | </li> 404<li>Field | </li> 405<li><a href="#method_detail">Method</a></li> 406</ul> 407</div> 408<a name="skip-navbar_bottom"> 409<!-- --> 410</a></div> 411<!-- ======== END OF BOTTOM NAVBAR ======= --> 412<p class="legalCopy"><small>Copyright © 2014 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p> 413</body> 414</html> 415