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_25) on Thu May 29 09:45:52 PDT 2014 --> 6<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 7<title>JsonCreator (Jackson-annotations 2.4.0 API)</title> 8<meta name="date" content="2014-05-29"> 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="JsonCreator (Jackson-annotations 2.4.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/JsonCreator.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/JsonBackReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li> 40<li><a href="../../../../com/fasterxml/jackson/annotation/JsonFilter.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/JsonCreator.html" target="_top">Frames</a></li> 44<li><a href="JsonCreator.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>Optional</li> 66</ul> 67<ul class="subNavList"> 68<li>Detail: </li> 69<li>Element</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 JsonCreator" class="title">Annotation Type JsonCreator</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://download.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://download.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://download.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://download.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://download.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>}) 88<a href="http://download.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://download.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://download.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">JsonCreator</span></pre> 90<div class="block">Marker annotation that can be used to define constructors and factory 91 methods as one to use for instantiating new instances of the associated 92 class. 93<p> 94 NOTE: when annotating creator methods (constructors, factory methods), 95 method must either be: 96<ul> 97 <li>Single-argument constructor/factory method without <a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonProperty</code></a> 98 annotation for the argument: if so, this is so-called "delegate creator", 99 in which case Jackson first binds JSON into type of the argument, and 100 then calls creator 101 </li> 102 <li>Constructor/factory method where <b>every argument</b> is annotated with 103 either <a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonProperty</code></a> or <a href="../../../../com/fasterxml/jackson/annotation/JacksonInject.html" title="annotation in com.fasterxml.jackson.annotation"><code>JacksonInject</code></a>, to indicate name 104 of property to bind to 105 </li> 106 </ul> 107 Also note that all <a href="../../../../com/fasterxml/jackson/annotation/JsonProperty.html" title="annotation in com.fasterxml.jackson.annotation"><code>JsonProperty</code></a> annotations MUST use actual name 108 (NOT empty String for "default"): this because Java bytecode does not 109 retain names of method or constructor arguments.</div> 110</li> 111</ul> 112</div> 113</div> 114<!-- ========= END OF CLASS DATA ========= --> 115<!-- ======= START OF BOTTOM NAVBAR ====== --> 116<div class="bottomNav"><a name="navbar_bottom"> 117<!-- --> 118</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 119<!-- --> 120</a> 121<ul class="navList" title="Navigation"> 122<li><a href="../../../../com/fasterxml/jackson/annotation/package-summary.html">Package</a></li> 123<li class="navBarCell1Rev">Class</li> 124<li><a href="class-use/JsonCreator.html">Use</a></li> 125<li><a href="package-tree.html">Tree</a></li> 126<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 127<li><a href="../../../../index-all.html">Index</a></li> 128<li><a href="../../../../help-doc.html">Help</a></li> 129</ul> 130</div> 131<div class="subNav"> 132<ul class="navList"> 133<li><a href="../../../../com/fasterxml/jackson/annotation/JsonBackReference.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Prev Class</span></a></li> 134<li><a href="../../../../com/fasterxml/jackson/annotation/JsonFilter.html" title="annotation in com.fasterxml.jackson.annotation"><span class="strong">Next Class</span></a></li> 135</ul> 136<ul class="navList"> 137<li><a href="../../../../index.html?com/fasterxml/jackson/annotation/JsonCreator.html" target="_top">Frames</a></li> 138<li><a href="JsonCreator.html" target="_top">No Frames</a></li> 139</ul> 140<ul class="navList" id="allclasses_navbar_bottom"> 141<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 142</ul> 143<div> 144<script type="text/javascript"><!-- 145 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 146 if(window==top) { 147 allClassesLink.style.display = "block"; 148 } 149 else { 150 allClassesLink.style.display = "none"; 151 } 152 //--> 153</script> 154</div> 155<div> 156<ul class="subNavList"> 157<li>Summary: </li> 158<li>Required | </li> 159<li>Optional</li> 160</ul> 161<ul class="subNavList"> 162<li>Detail: </li> 163<li>Element</li> 164</ul> 165</div> 166<a name="skip-navbar_bottom"> 167<!-- --> 168</a></div> 169<!-- ======== END OF BOTTOM NAVBAR ======= --> 170<p class="legalCopy"><small>Copyright © 2014 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved.</small></p> 171</body> 172</html> 173