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 Tue Jan 23 20:10:06 PST 2018 --> 6<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7<title>JsonIgnore (Jackson-annotations 2.9.0 API)</title> 8<meta name="date" content="2018-01-23"> 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="JsonIgnore (Jackson-annotations 2.9.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/JsonIgnore.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/JsonIdentityReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li> 40<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIgnoreProperties.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/JsonIgnore.html" target="_top">Frames</a></li> 44<li><a href="JsonIgnore.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>Required | </li> 65<li><a href="#annotation_type_optional_element_summary">Optional</a></li> 66</ul> 67<ul class="subNavList"> 68<li>Detail: </li> 69<li><a href="#annotation_type_element_detail">Element</a></li> 70</ul> 71</div> 72<a name="skip-navbar_top"> 73<!-- --> 74</a></div> 75<!-- ========= END OF TOP NAVBAR ========= --> 76<!-- ======== START OF CLASS DATA ======== --> 77<div class="header"> 78<div class="subTitle">com.fasterxml.jackson.annotation</div> 79<h2 title="Annotation Type JsonIgnore" class="title">Annotation Type JsonIgnore</h2> 80</div> 81<div class="contentContainer"> 82<div class="description"> 83<ul class="blockList"> 84<li class="blockList"> 85<hr> 86<br> 87<pre><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/Target.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</a>={<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#ANNOTATION_TYPE" title="class or interface in java.lang.annotation">ANNOTATION_TYPE</a>,<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#METHOD" title="class or interface in java.lang.annotation">METHOD</a>,<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#CONSTRUCTOR" title="class or interface in java.lang.annotation">CONSTRUCTOR</a>,<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#FIELD" title="class or interface in java.lang.annotation">FIELD</a>}) 88<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/Retention.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</a>=<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</a>) 89public @interface <span class="strong">JsonIgnore</span></pre> 90<div class="block">Marker annotation that indicates that the logical property that 91 the accessor (field, getter/setter method or Creator parameter 92 [of <a href="../../../../com/fasterxml/jackson/annotation/JsonCreator.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonCreator</code></a>-annotated constructor or factory method]) 93 is to be ignored by introspection-based 94 serialization and deserialization functionality. 95<p> 96 Annotation only needs to be added to one of the accessors (often 97 getter method, but may be setter, field or creator parameter), 98 if the complete removal of the property is desired. 99 However: if only particular accessor is to be ignored (for example, 100 when ignoring one of potentially conflicting setter methods), 101 this can be done by annotating other not-to-be-ignored accessors 102 with <a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonProperty</code></a> (or its equivalents). This is considered 103 so-called "split property" case and allows definitions of 104 "read-only" (read from input into POJO) and "write-only" (write 105 in output but ignore on output) 106<br> 107 NOTE! As Jackson 2.6, there is a new and improved way to define 108 `read-only` and `write-only` properties, using 109 <a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html#access()"><code>JsonProperty.access()</code></a> annotation: this is recommended over 110 use of separate <code>JsonIgnore</code> and <a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonProperty</code></a> 111 annotations. 112<p> 113 For example, a "getter" method that would otherwise denote 114 a property (like, say, "getValue" to suggest property "value") 115 to serialize, would be ignored and no such property would 116 be output unless another annotation defines alternative method to use. 117<p> 118 When ignoring the whole property, the default behavior if encountering 119 such property in input is to ignore it without exception; but if there 120 is a <a href="../../../../com/fasterxml/jackson/annotation/JsonAnySetter.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonAnySetter</code></a> it will be called instead. Either way, 121 no exception will be thrown. 122<p> 123 Annotation is usually used just a like a marker annotation, that 124 is, without explicitly defining 'value' argument (which defaults 125 to <code>true</code>): but argument can be explicitly defined. 126 This can be done to override an existing `JsonIgnore` by explicitly 127 defining one with 'false' argument: either in a sub-class, or by 128 using "mix-in annotations".</div> 129</li> 130</ul> 131</div> 132<div class="summary"> 133<ul class="blockList"> 134<li class="blockList"> 135<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> 136<ul class="blockList"> 137<li class="blockList"><a name="annotation_type_optional_element_summary"> 138<!-- --> 139</a> 140<h3>Optional Element Summary</h3> 141<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation"> 142<caption><span>Optional Elements</span><span class="tabEnd"> </span></caption> 143<tr> 144<th class="colFirst" scope="col">Modifier and Type</th> 145<th class="colLast" scope="col">Optional Element and Description</th> 146</tr> 147<tr class="altColor"> 148<td class="colFirst"><code>boolean</code></td> 149<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonIgnore.html#value()">value</a></strong></code> 150<div class="block">Optional argument that defines whether this annotation is active 151 or not.</div> 152</td> 153</tr> 154</table> 155</li> 156</ul> 157</li> 158</ul> 159</div> 160<div class="details"> 161<ul class="blockList"> 162<li class="blockList"> 163<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== --> 164<ul class="blockList"> 165<li class="blockList"><a name="annotation_type_element_detail"> 166<!-- --> 167</a> 168<h3>Element Detail</h3> 169<a name="value()"> 170<!-- --> 171</a> 172<ul class="blockListLast"> 173<li class="blockList"> 174<h4>value</h4> 175<pre>public abstract boolean value</pre> 176<div class="block">Optional argument that defines whether this annotation is active 177 or not. The only use for value 'false' if for overriding purposes 178 (which is not needed often); most likely it is needed for use 179 with "mix-in annotations" (aka "annotation overrides"). 180 For most cases, however, default value of "true" is just fine 181 and should be omitted.</div> 182<dl> 183<dt>Default:</dt> 184<dd>true</dd> 185</dl> 186</li> 187</ul> 188</li> 189</ul> 190</li> 191</ul> 192</div> 193</div> 194<!-- ========= END OF CLASS DATA ========= --> 195<!-- ======= START OF BOTTOM NAVBAR ====== --> 196<div class="bottomNav"><a name="navbar_bottom"> 197<!-- --> 198</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 199<!-- --> 200</a> 201<ul class="navList" title="Navigation"> 202<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li> 203<li class="navBarCell1Rev">Class</li> 204<li><a href="class-use/JsonIgnore.html">Use</a></li> 205<li><a href="package-tree.html">Tree</a></li> 206<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 207<li><a href="../../../../index-all.html">Index</a></li> 208<li><a href="../../../../help-doc.html">Help</a></li> 209</ul> 210</div> 211<div class="subNav"> 212<ul class="navList"> 213<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li> 214<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIgnoreProperties.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li> 215</ul> 216<ul class="navList"> 217<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonIgnore.html" target="_top">Frames</a></li> 218<li><a href="JsonIgnore.html" target="_top">No Frames</a></li> 219</ul> 220<ul class="navList" id="allclasses_navbar_bottom"> 221<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 222</ul> 223<div> 224<script type="text/javascript"><!-- 225 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 226 if(window==top) { 227 allClassesLink.style.display = "block"; 228 } 229 else { 230 allClassesLink.style.display = "none"; 231 } 232 //--> 233</script> 234</div> 235<div> 236<ul class="subNavList"> 237<li>Summary: </li> 238<li>Required | </li> 239<li><a href="#annotation_type_optional_element_summary">Optional</a></li> 240</ul> 241<ul class="subNavList"> 242<li>Detail: </li> 243<li><a href="#annotation_type_element_detail">Element</a></li> 244</ul> 245</div> 246<a name="skip-navbar_bottom"> 247<!-- --> 248</a></div> 249<!-- ======== END OF BOTTOM NAVBAR ======= --> 250<p class="legalCopy"><small>Copyright © 2008–2018 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p> 251</body> 252</html> 253