• 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 (version 1.7.0_10-ea) on Sun Jul 14 20:03:21 PDT 2013 -->
6<title>JsonValue (Jackson JSON Processor)</title>
7<meta name="date" content="2013-07-14">
8<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
9</head>
10<body>
11<script type="text/javascript"><!--
12    if (location.href.indexOf('is-external=true') == -1) {
13        parent.document.title="JsonValue (Jackson JSON Processor)";
14    }
15//-->
16</script>
17<noscript>
18<div>JavaScript is disabled on your browser.</div>
19</noscript>
20<!-- ========= START OF TOP NAVBAR ======= -->
21<div class="topNav"><a name="navbar_top">
22<!--   -->
23</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
24<!--   -->
25</a>
26<ul class="navList" title="Navigation">
27<li><a href="../../../../overview-summary.html">Overview</a></li>
28<li><a href="package-summary.html">Package</a></li>
29<li class="navBarCell1Rev">Class</li>
30<li><a href="class-use/JsonValue.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="../../../../org/codehaus/jackson/annotate/JsonUnwrapped.html" title="annotation in org.codehaus.jackson.annotate"><span class="strong">Prev Class</span></a></li>
40<li><a href="../../../../org/codehaus/jackson/annotate/JsonWriteNullProperties.html" title="annotation in org.codehaus.jackson.annotate"><span class="strong">Next Class</span></a></li>
41</ul>
42<ul class="navList">
43<li><a href="../../../../index.html?org/codehaus/jackson/annotate/JsonValue.html" target="_top">Frames</a></li>
44<li><a href="JsonValue.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">org.codehaus.jackson.annotate</div>
79<h2 title="Annotation Type JsonValue" class="title">Annotation Type JsonValue</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#METHOD" title="class or interface in java.lang.annotation">METHOD</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">JsonValue</span></pre>
90<div class="block">Marker annotation similar to
91 <a href="http://docs.oracle.com/javase/6/docs/api/javax/xml/bind/annotation/XmlValue.html?is-external=true" title="class or interface in javax.xml.bind.annotation"><code>XmlValue</code></a>
92 that indicates that results of the annotated "getter" method
93 (which means signature must be that of getters; non-void return
94 type, no args) is to be used as the single value to serialize
95 for the instance. Usually value will be of a simple scalar type
96 (String or Number), but it can be any serializable type (Collection,
97 Map or Bean).
98<p>
99 At most one method of a Class can be annotated with this annotation;
100 if more than one is found, an exception may be thrown.
101 Also, if method signature is not compatible with Getters, an exception
102 may be thrown.
103 Whether exception is thrown or not is an implementation detail (due
104 to filtering during introspection, some annotations may be skipped)
105 and applications should not rely on specific behavior.
106<p>
107 A typical use case is that of annotating <code>toString()</code>
108 method so that returned String value is Object's Json serialization.
109<p>
110 Boolean argument is only used so that sub-classes can "disable"
111 annotation if necessary.</div>
112</li>
113</ul>
114</div>
115<div class="summary">
116<ul class="blockList">
117<li class="blockList">
118<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
119<ul class="blockList">
120<li class="blockList"><a name="annotation_type_optional_element_summary">
121<!--   -->
122</a>
123<h3>Optional Element Summary</h3>
124<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
125<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
126<tr>
127<th class="colFirst" scope="col">Modifier and Type</th>
128<th class="colLast" scope="col">Optional Element and Description</th>
129</tr>
130<tr class="altColor">
131<td class="colFirst"><code>boolean</code></td>
132<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/annotate/JsonValue.html#value()">value</a></strong></code>
133<div class="block">Optional argument that defines whether this annotation is active
134 or not.</div>
135</td>
136</tr>
137</table>
138</li>
139</ul>
140</li>
141</ul>
142</div>
143<div class="details">
144<ul class="blockList">
145<li class="blockList">
146<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
147<ul class="blockList">
148<li class="blockList"><a name="annotation_type_element_detail">
149<!--   -->
150</a>
151<h3>Element Detail</h3>
152<a name="value()">
153<!--   -->
154</a>
155<ul class="blockListLast">
156<li class="blockList">
157<h4>value</h4>
158<pre>public abstract&nbsp;boolean&nbsp;value</pre>
159<div class="block">Optional argument that defines whether this annotation is active
160 or not. The only use for value 'false' if for overriding purposes.
161 Overriding may be necessary when used
162 with "mix-in annotations" (aka "annotation overrides").
163 For most cases, however, default value of "true" is just fine
164 and should be omitted.</div>
165<dl>
166<dt>Default:</dt>
167<dd>true</dd>
168</dl>
169</li>
170</ul>
171</li>
172</ul>
173</li>
174</ul>
175</div>
176</div>
177<!-- ========= END OF CLASS DATA ========= -->
178<!-- ======= START OF BOTTOM NAVBAR ====== -->
179<div class="bottomNav"><a name="navbar_bottom">
180<!--   -->
181</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
182<!--   -->
183</a>
184<ul class="navList" title="Navigation">
185<li><a href="../../../../overview-summary.html">Overview</a></li>
186<li><a href="package-summary.html">Package</a></li>
187<li class="navBarCell1Rev">Class</li>
188<li><a href="class-use/JsonValue.html">Use</a></li>
189<li><a href="package-tree.html">Tree</a></li>
190<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
191<li><a href="../../../../index-all.html">Index</a></li>
192<li><a href="../../../../help-doc.html">Help</a></li>
193</ul>
194</div>
195<div class="subNav">
196<ul class="navList">
197<li><a href="../../../../org/codehaus/jackson/annotate/JsonUnwrapped.html" title="annotation in org.codehaus.jackson.annotate"><span class="strong">Prev Class</span></a></li>
198<li><a href="../../../../org/codehaus/jackson/annotate/JsonWriteNullProperties.html" title="annotation in org.codehaus.jackson.annotate"><span class="strong">Next Class</span></a></li>
199</ul>
200<ul class="navList">
201<li><a href="../../../../index.html?org/codehaus/jackson/annotate/JsonValue.html" target="_top">Frames</a></li>
202<li><a href="JsonValue.html" target="_top">No Frames</a></li>
203</ul>
204<ul class="navList" id="allclasses_navbar_bottom">
205<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
206</ul>
207<div>
208<script type="text/javascript"><!--
209  allClassesLink = document.getElementById("allclasses_navbar_bottom");
210  if(window==top) {
211    allClassesLink.style.display = "block";
212  }
213  else {
214    allClassesLink.style.display = "none";
215  }
216  //-->
217</script>
218</div>
219<div>
220<ul class="subNavList">
221<li>Summary:&nbsp;</li>
222<li>Required&nbsp;|&nbsp;</li>
223<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
224</ul>
225<ul class="subNavList">
226<li>Detail:&nbsp;</li>
227<li><a href="#annotation_type_element_detail">Element</a></li>
228</ul>
229</div>
230<a name="skip-navbar_bottom">
231<!--   -->
232</a></div>
233<!-- ======== END OF BOTTOM NAVBAR ======= -->
234</body>
235</html>
236