• Home
  • History
  • Annotate
  • 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 (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>JsonMerge (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="JsonMerge (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/JsonMerge.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/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li>
40<li><a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.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/JsonMerge.html" target="_top">Frames</a></li>
44<li><a href="JsonMerge.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:&nbsp;</li>
64<li>Required&nbsp;|&nbsp;</li>
65<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
66</ul>
67<ul class="subNavList">
68<li>Detail:&nbsp;</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 JsonMerge" class="title">Annotation Type JsonMerge</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#FIELD" title="class or interface in java.lang.annotation">FIELD</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#PARAMETER" title="class or interface in java.lang.annotation">PARAMETER</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">JsonMerge</span></pre>
90<div class="block">Annotation to specify whether annotated property value should use "merging" approach,
91 in which current value is first accessed (with a getter or field) and then modified
92 with incoming data, or not: if not, assignment happens without considering current state.
93<p>
94 Merging is only option if there is a way to introspect current state:
95 if there is accessor (getter, field) to use.
96 Merging can not be enabled if no accessor exists
97 or if assignment occurs using a Creator setter (constructor
98 or factory method), since there is no instance with state to introspect.
99 Merging also only has actual effect for structured types where there is an
100 obvious way to update a state (for example, POJOs have default values for properties,
101 and <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 may have existing
102 elements; whereas scalar types do not such state: an <code>int</code> has a value,
103 but no obvious and non-ambiguous way to merge state.
104<p>
105 Merging is applied by using a deserialization method that accepts existing state
106 as an argument: it is then up to <code>JsonDeserializer</code> implementation
107 to use that base state in a way that makes sense without further configuration.
108 For structured types this is usually obvious; and for scalar types not -- if
109 no obvious method exists, merging is not allowed; deserializer may choose to
110 either quietly ignore it, or throw an exception.
111<p>
112 Note that use of merging usually adds some processing overhead since it adds
113 an extra step of accessing the current state before assignment.
114<p>
115 Note also that "root values" (values directly deserialized and not reached
116 via POJO properties) can not use this annotation; instead, <code>ObjectMapper</code>
117 and <code>Object</code> have "updating reader" operations.
118<p>
119 Default value is <a href="../../../../com/fasterxml/jackson/annotation/OptBoolean.html#TRUE"><code>OptBoolean.TRUE</code></a>, that is, merging <b>is enabled</b>.</div>
120<dl><dt><span class="strong">Since:</span></dt>
121  <dd>2.9</dd></dl>
122</li>
123</ul>
124</div>
125<div class="summary">
126<ul class="blockList">
127<li class="blockList">
128<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
129<ul class="blockList">
130<li class="blockList"><a name="annotation_type_optional_element_summary">
131<!--   -->
132</a>
133<h3>Optional Element Summary</h3>
134<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
135<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
136<tr>
137<th class="colFirst" scope="col">Modifier and Type</th>
138<th class="colLast" scope="col">Optional Element and Description</th>
139</tr>
140<tr class="altColor">
141<td class="colFirst"><code><a href="../../../../com/fasterxml/jackson/annotation/OptBoolean.html" title="enum in com.fasterxml.jackson.annotation">OptBoolean</a></code></td>
142<td class="colLast"><code><strong><a href="../../../../com/fasterxml/jackson/annotation/JsonMerge.html#value()">value</a></strong></code>
143<div class="block">Whether merging should or should not be enabled for the annotated property.</div>
144</td>
145</tr>
146</table>
147</li>
148</ul>
149</li>
150</ul>
151</div>
152<div class="details">
153<ul class="blockList">
154<li class="blockList">
155<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
156<ul class="blockList">
157<li class="blockList"><a name="annotation_type_element_detail">
158<!--   -->
159</a>
160<h3>Element Detail</h3>
161<a name="value()">
162<!--   -->
163</a>
164<ul class="blockListLast">
165<li class="blockList">
166<h4>value</h4>
167<pre>public abstract&nbsp;<a href="../../../../com/fasterxml/jackson/annotation/OptBoolean.html" title="enum in com.fasterxml.jackson.annotation">OptBoolean</a>&nbsp;value</pre>
168<div class="block">Whether merging should or should not be enabled for the annotated property.</div>
169<dl>
170<dt>Default:</dt>
171<dd>com.fasterxml.jackson.annotation.OptBoolean.TRUE</dd>
172</dl>
173</li>
174</ul>
175</li>
176</ul>
177</li>
178</ul>
179</div>
180</div>
181<!-- ========= END OF CLASS DATA ========= -->
182<!-- ======= START OF BOTTOM NAVBAR ====== -->
183<div class="bottomNav"><a name="navbar_bottom">
184<!--   -->
185</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
186<!--   -->
187</a>
188<ul class="navList" title="Navigation">
189<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li>
190<li class="navBarCell1Rev">Class</li>
191<li><a href="class-use/JsonMerge.html">Use</a></li>
192<li><a href="package-tree.html">Tree</a></li>
193<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
194<li><a href="../../../../index-all.html">Index</a></li>
195<li><a href="../../../../help-doc.html">Help</a></li>
196</ul>
197</div>
198<div class="subNav">
199<ul class="navList">
200<li><a href="../../../../com/fasterxml/jackson/annotation/JsonManagedReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li>
201<li><a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li>
202</ul>
203<ul class="navList">
204<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonMerge.html" target="_top">Frames</a></li>
205<li><a href="JsonMerge.html" target="_top">No Frames</a></li>
206</ul>
207<ul class="navList" id="allclasses_navbar_bottom">
208<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
209</ul>
210<div>
211<script type="text/javascript"><!--
212  allClassesLink = document.getElementById("allclasses_navbar_bottom");
213  if(window==top) {
214    allClassesLink.style.display = "block";
215  }
216  else {
217    allClassesLink.style.display = "none";
218  }
219  //-->
220</script>
221</div>
222<div>
223<ul class="subNavList">
224<li>Summary:&nbsp;</li>
225<li>Required&nbsp;|&nbsp;</li>
226<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
227</ul>
228<ul class="subNavList">
229<li>Detail:&nbsp;</li>
230<li><a href="#annotation_type_element_detail">Element</a></li>
231</ul>
232</div>
233<a name="skip-navbar_bottom">
234<!--   -->
235</a></div>
236<!-- ======== END OF BOTTOM NAVBAR ======= -->
237<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2018 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
238</body>
239</html>
240