• 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 (1.8.0_162) on Wed Sep 25 19:26:34 PDT 2019 -->
6<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7<title>JsonIgnore (Jackson-annotations 2.10.0 API)</title>
8<meta name="date" content="2019-09-25">
9<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
10<script type="text/javascript" src="../../../../script.js"></script>
11</head>
12<body>
13<script type="text/javascript"><!--
14    try {
15        if (location.href.indexOf('is-external=true') == -1) {
16            parent.document.title="JsonIgnore (Jackson-annotations 2.10.0 API)";
17        }
18    }
19    catch(err) {
20    }
21//-->
22</script>
23<noscript>
24<div>JavaScript is disabled on your browser.</div>
25</noscript>
26<!-- ========= START OF TOP NAVBAR ======= -->
27<div class="topNav"><a name="navbar.top">
28<!--   -->
29</a>
30<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
31<a name="navbar.top.firstrow">
32<!--   -->
33</a>
34<ul class="navList" title="Navigation">
35<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li>
36<li class="navBarCell1Rev">Class</li>
37<li><a href="class-use/JsonIgnore.html">Use</a></li>
38<li><a href="package-tree.html">Tree</a></li>
39<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
40<li><a href="../../../../index-all.html">Index</a></li>
41<li><a href="../../../../help-doc.html">Help</a></li>
42</ul>
43</div>
44<div class="subNav">
45<ul class="navList">
46<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
47<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIgnoreProperties.html" title="annotation in com.fasterxml.jackson.annotation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
48</ul>
49<ul class="navList">
50<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonIgnore.html" target="_top">Frames</a></li>
51<li><a href="JsonIgnore.html" target="_top">No&nbsp;Frames</a></li>
52</ul>
53<ul class="navList" id="allclasses_navbar_top">
54<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
55</ul>
56<div>
57<script type="text/javascript"><!--
58  allClassesLink = document.getElementById("allclasses_navbar_top");
59  if(window==top) {
60    allClassesLink.style.display = "block";
61  }
62  else {
63    allClassesLink.style.display = "none";
64  }
65  //-->
66</script>
67</div>
68<div>
69<ul class="subNavList">
70<li>Summary:&nbsp;</li>
71<li>Field&nbsp;|&nbsp;</li>
72<li>Required&nbsp;|&nbsp;</li>
73<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
74</ul>
75<ul class="subNavList">
76<li>Detail:&nbsp;</li>
77<li>Field&nbsp;|&nbsp;</li>
78<li><a href="#annotation.type.element.detail">Element</a></li>
79</ul>
80</div>
81<a name="skip.navbar.top">
82<!--   -->
83</a></div>
84<!-- ========= END OF TOP NAVBAR ========= -->
85<!-- ======== START OF CLASS DATA ======== -->
86<div class="header">
87<div class="subTitle">com.fasterxml.jackson.annotation</div>
88<h2 title="Annotation Type JsonIgnore" class="title">Annotation Type JsonIgnore</h2>
89</div>
90<div class="contentContainer">
91<div class="description">
92<ul class="blockList">
93<li class="blockList">
94<hr>
95<br>
96<pre><a href="https://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="https://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="https://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="https://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="https://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="https://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>})
97 <a href="https://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="https://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="https://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>)
98public @interface <span class="memberNameLabel">JsonIgnore</span></pre>
99<div class="block">Marker annotation that indicates that the logical property that
100 the accessor (field, getter/setter method or Creator parameter
101 [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])
102 is to be ignored by introspection-based
103 serialization and deserialization functionality.
104<p>
105 Annotation only needs to be added to one of the accessors (often
106 getter method, but may be setter, field or creator parameter),
107 if the complete removal of the property is desired.
108 However: if only particular accessor is to be ignored (for example,
109 when ignoring one of potentially conflicting setter methods),
110 this can be done by annotating other not-to-be-ignored accessors
111 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
112 so-called "split property" case and allows definitions of
113 "read-only" (read from input into POJO) and "write-only" (write
114 in output but ignore on output)
115<br>
116 NOTE! As Jackson 2.6, there is a new and improved way to define
117 `read-only` and `write-only` properties, using
118 <a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html#access--"><code>JsonProperty.access()</code></a> annotation: this is recommended over
119 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>
120 annotations.
121<p>
122 For example, a "getter" method that would otherwise denote
123 a property (like, say, "getValue" to suggest property "value")
124 to serialize, would be ignored and no such property would
125 be output unless another annotation defines alternative method to use.
126<p>
127 When ignoring the whole property, the default behavior if encountering
128 such property in input is to ignore it without exception; but if there
129 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,
130 no exception will be thrown.
131<p>
132 Annotation is usually used just a like a marker annotation, that
133 is, without explicitly defining 'value' argument (which defaults
134 to <code>true</code>): but argument can be explicitly defined.
135 This can be done to override an existing `JsonIgnore` by explicitly
136 defining one with 'false' argument: either in a sub-class, or by
137 using "mix-in annotations".</div>
138</li>
139</ul>
140</div>
141<div class="summary">
142<ul class="blockList">
143<li class="blockList">
144<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
145<ul class="blockList">
146<li class="blockList"><a name="annotation.type.optional.element.summary">
147<!--   -->
148</a>
149<h3>Optional Element Summary</h3>
150<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
151<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
152<tr>
153<th class="colFirst" scope="col">Modifier and Type</th>
154<th class="colLast" scope="col">Optional Element and Description</th>
155</tr>
156<tr class="altColor">
157<td class="colFirst"><code>boolean</code></td>
158<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/fasterxml/jackson/annotation/JsonIgnore.html#value--">value</a></span></code>
159<div class="block">Optional argument that defines whether this annotation is active
160 or not.</div>
161</td>
162</tr>
163</table>
164</li>
165</ul>
166</li>
167</ul>
168</div>
169<div class="details">
170<ul class="blockList">
171<li class="blockList">
172<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
173<ul class="blockList">
174<li class="blockList"><a name="annotation.type.element.detail">
175<!--   -->
176</a>
177<h3>Element Detail</h3>
178<a name="value--">
179<!--   -->
180</a>
181<ul class="blockListLast">
182<li class="blockList">
183<h4>value</h4>
184<pre>public abstract&nbsp;boolean&nbsp;value</pre>
185<div class="block">Optional argument that defines whether this annotation is active
186 or not. The only use for value 'false' if for overriding purposes
187 (which is not needed often); most likely it is needed for use
188 with "mix-in annotations" (aka "annotation overrides").
189 For most cases, however, default value of "true" is just fine
190 and should be omitted.</div>
191<dl>
192<dt><span class="returnLabel">Returns:</span></dt>
193<dd>True if annotation is enabled (normal case); false if it is to
194   be ignored (only useful for mix-in annotations to "mask" annotation)</dd>
195</dl>
196<dl>
197<dt>Default:</dt>
198<dd>true</dd>
199</dl>
200</li>
201</ul>
202</li>
203</ul>
204</li>
205</ul>
206</div>
207</div>
208<!-- ========= END OF CLASS DATA ========= -->
209<!-- ======= START OF BOTTOM NAVBAR ====== -->
210<div class="bottomNav"><a name="navbar.bottom">
211<!--   -->
212</a>
213<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
214<a name="navbar.bottom.firstrow">
215<!--   -->
216</a>
217<ul class="navList" title="Navigation">
218<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li>
219<li class="navBarCell1Rev">Class</li>
220<li><a href="class-use/JsonIgnore.html">Use</a></li>
221<li><a href="package-tree.html">Tree</a></li>
222<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
223<li><a href="../../../../index-all.html">Index</a></li>
224<li><a href="../../../../help-doc.html">Help</a></li>
225</ul>
226</div>
227<div class="subNav">
228<ul class="navList">
229<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIdentityReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
230<li><a href="../../../../com/fasterxml/jackson/annotation/JsonIgnoreProperties.html" title="annotation in com.fasterxml.jackson.annotation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
231</ul>
232<ul class="navList">
233<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonIgnore.html" target="_top">Frames</a></li>
234<li><a href="JsonIgnore.html" target="_top">No&nbsp;Frames</a></li>
235</ul>
236<ul class="navList" id="allclasses_navbar_bottom">
237<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
238</ul>
239<div>
240<script type="text/javascript"><!--
241  allClassesLink = document.getElementById("allclasses_navbar_bottom");
242  if(window==top) {
243    allClassesLink.style.display = "block";
244  }
245  else {
246    allClassesLink.style.display = "none";
247  }
248  //-->
249</script>
250</div>
251<div>
252<ul class="subNavList">
253<li>Summary:&nbsp;</li>
254<li>Field&nbsp;|&nbsp;</li>
255<li>Required&nbsp;|&nbsp;</li>
256<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
257</ul>
258<ul class="subNavList">
259<li>Detail:&nbsp;</li>
260<li>Field&nbsp;|&nbsp;</li>
261<li><a href="#annotation.type.element.detail">Element</a></li>
262</ul>
263</div>
264<a name="skip.navbar.bottom">
265<!--   -->
266</a></div>
267<!-- ======== END OF BOTTOM NAVBAR ======= -->
268<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2019 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
269</body>
270</html>
271