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:50:33 PDT 2013 --> 6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 7<title>JsonSerialize.Inclusion (jackson-databind 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="JsonSerialize.Inclusion (jackson-databind 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="../../../../../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#NON_DEFAULT">NON_DEFAULT</a></strong></code> 143<div class="block">Value that indicates that only properties that have values 144 that differ from default settings (meaning values they have 145 when Bean is constructed with its no-arguments constructor) 146 are to be included.</div> 147</td> 148</tr> 149<tr class="altColor"> 150<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#NON_EMPTY">NON_EMPTY</a></strong></code> 151<div class="block">Value that indicates that only properties that have values 152 that values that are null or what is considered empty are 153 not to be included.</div> 154</td> 155</tr> 156<tr class="rowColor"> 157<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#NON_NULL">NON_NULL</a></strong></code> 158<div class="block">Value that indicates that only properties with non-null 159 values are to be included.</div> 160</td> 161</tr> 162</table> 163</li> 164</ul> 165<!-- ========== METHOD SUMMARY =========== --> 166<ul class="blockList"> 167<li class="blockList"><a name="method_summary"> 168<!-- --> 169</a> 170<h3>Method Summary</h3> 171<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> 172<caption><span>Methods</span><span class="tabEnd"> </span></caption> 173<tr> 174<th class="colFirst" scope="col">Modifier and Type</th> 175<th class="colLast" scope="col">Method and Description</th> 176</tr> 177<tr class="altColor"> 178<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> 179<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> 180<div class="block">Returns the enum constant of this type with the specified name.</div> 181</td> 182</tr> 183<tr class="rowColor"> 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#values()">values</a></strong>()</code> 186<div class="block">Returns an array containing the constants of this enum type, in 187the order they are declared.</div> 188</td> 189</tr> 190</table> 191<ul class="blockList"> 192<li class="blockList"><a name="methods_inherited_from_class_java.lang.Enum"> 193<!-- --> 194</a> 195<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> 196<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> 197</ul> 198<ul class="blockList"> 199<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> 200<!-- --> 201</a> 202<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> 203<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> 204</ul> 205</li> 206</ul> 207</li> 208</ul> 209</div> 210<div class="details"> 211<ul class="blockList"> 212<li class="blockList"> 213<!-- ============ ENUM CONSTANT DETAIL =========== --> 214<ul class="blockList"> 215<li class="blockList"><a name="enum_constant_detail"> 216<!-- --> 217</a> 218<h3>Enum Constant Detail</h3> 219<a name="ALWAYS"> 220<!-- --> 221</a> 222<ul class="blockList"> 223<li class="blockList"> 224<h4>ALWAYS</h4> 225<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> 226<div class="block">Value that indicates that properties are to be always included, 227 independent of value</div> 228</li> 229</ul> 230<a name="NON_NULL"> 231<!-- --> 232</a> 233<ul class="blockList"> 234<li class="blockList"> 235<h4>NON_NULL</h4> 236<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> 237<div class="block">Value that indicates that only properties with non-null 238 values are to be included.</div> 239</li> 240</ul> 241<a name="NON_DEFAULT"> 242<!-- --> 243</a> 244<ul class="blockList"> 245<li class="blockList"> 246<h4>NON_DEFAULT</h4> 247<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> 248<div class="block">Value that indicates that only properties that have values 249 that differ from default settings (meaning values they have 250 when Bean is constructed with its no-arguments constructor) 251 are to be included. Value is generally not useful with 252 <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; 253 and if used, works same as <a href="../../../../../com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html#ALWAYS"><code>ALWAYS</code></a>.</div> 254</li> 255</ul> 256<a name="NON_EMPTY"> 257<!-- --> 258</a> 259<ul class="blockListLast"> 260<li class="blockList"> 261<h4>NON_EMPTY</h4> 262<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> 263<div class="block">Value that indicates that only properties that have values 264 that values that are null or what is considered empty are 265 not to be included. 266 Emptiness is defined for following type: 267<ul> 268 <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, 269 method <code>isEmpty()</code> is called; 270 </li> 271 <li>For Java arrays, empty arrays are ones with length of 0 272 </li> 273 <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, 274 and return value of 0 indicates empty String (note that <code>String.isEmpty()</code> 275 was added in Java 1.6 and as such can not be used by Jackson 276 </li> 277 <ul> 278 For other types, non-null values are to be included.</div> 279</li> 280</ul> 281</li> 282</ul> 283<!-- ============ METHOD DETAIL ========== --> 284<ul class="blockList"> 285<li class="blockList"><a name="method_detail"> 286<!-- --> 287</a> 288<h3>Method Detail</h3> 289<a name="values()"> 290<!-- --> 291</a> 292<ul class="blockList"> 293<li class="blockList"> 294<h4>values</h4> 295<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> 296<div class="block">Returns an array containing the constants of this enum type, in 297the order they are declared. This method may be used to iterate 298over the constants as follows: 299<pre> 300for (JsonSerialize.Inclusion c : JsonSerialize.Inclusion.values()) 301 System.out.println(c); 302</pre></div> 303<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in 304the order they are declared</dd></dl> 305</li> 306</ul> 307<a name="valueOf(java.lang.String)"> 308<!-- --> 309</a> 310<ul class="blockListLast"> 311<li class="blockList"> 312<h4>valueOf</h4> 313<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> 314<div class="block">Returns the enum constant of this type with the specified name. 315The string must match <i>exactly</i> an identifier used to declare an 316enum constant in this type. (Extraneous whitespace characters are 317not permitted.)</div> 318<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd> 319<dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd> 320<dt><span class="strong">Throws:</span></dt> 321<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 322with the specified name</dd> 323<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> 324</li> 325</ul> 326</li> 327</ul> 328</li> 329</ul> 330</div> 331</div> 332<!-- ========= END OF CLASS DATA ========= --> 333<!-- ======= START OF BOTTOM NAVBAR ====== --> 334<div class="bottomNav"><a name="navbar_bottom"> 335<!-- --> 336</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 337<!-- --> 338</a> 339<ul class="navList" title="Navigation"> 340<li><a href="../../../../../overview-summary.html">Overview</a></li> 341<li><a href="package-summary.html">Package</a></li> 342<li class="navBarCell1Rev">Class</li> 343<li><a href="class-use/JsonSerialize.Inclusion.html">Use</a></li> 344<li><a href="package-tree.html">Tree</a></li> 345<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 346<li><a href="../../../../../index-all.html">Index</a></li> 347<li><a href="../../../../../help-doc.html">Help</a></li> 348</ul> 349</div> 350<div class="subNav"> 351<ul class="navList"> 352<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> 353<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> 354</ul> 355<ul class="navList"> 356<li><a href="../../../../../index.html?com/fasterxml/jackson/databind/annotation/JsonSerialize.Inclusion.html" target="_top">Frames</a></li> 357<li><a href="JsonSerialize.Inclusion.html" target="_top">No Frames</a></li> 358</ul> 359<ul class="navList" id="allclasses_navbar_bottom"> 360<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> 361</ul> 362<div> 363<script type="text/javascript"><!-- 364 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 365 if(window==top) { 366 allClassesLink.style.display = "block"; 367 } 368 else { 369 allClassesLink.style.display = "none"; 370 } 371 //--> 372</script> 373</div> 374<div> 375<ul class="subNavList"> 376<li>Summary: </li> 377<li>Nested | </li> 378<li><a href="#enum_constant_summary">Enum Constants</a> | </li> 379<li>Field | </li> 380<li><a href="#method_summary">Method</a></li> 381</ul> 382<ul class="subNavList"> 383<li>Detail: </li> 384<li><a href="#enum_constant_detail">Enum Constants</a> | </li> 385<li>Field | </li> 386<li><a href="#method_detail">Method</a></li> 387</ul> 388</div> 389<a name="skip-navbar_bottom"> 390<!-- --> 391</a></div> 392<!-- ======== END OF BOTTOM NAVBAR ======= --> 393<p class="legalCopy"><small>Copyright © 2012-2013 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p> 394</body> 395</html> 396