Top Description Inners Fields Methods
com.fasterxml.jackson.databind.annotation

public @Interface JsonPOJOBuilder

extends Annotation
Annotations
@Target:ANNOTATION_TYPE, TYPE
@Retention:RUNTIME
@JacksonAnnotation
Imports
java.lang.annotation.*

Annotation used to configure details of a Builder class: instances of which are used as Builders for deserialized POJO values, instead of POJOs being instantiated using constructors or factory methods. Note that this annotation is NOT used to define what is the Builder class for a POJO: rather, this is determined by JsonDeserialize#builder property of JsonDeserialize.

Annotation is typically used if the naming convention of a Builder class is different from defaults:

In addition to configuration using this annotation, note that many other configuration annotations are also applied to Builders, for example com.fasterxml.jackson.annotation.JsonIgnoreProperties can be used to ignore "unknown" properties.

Since
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
JsonPOJOBuilder.Value

Simple value container for containing values read from JsonPOJOBuilder annotation instance.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String

Method Summary

Modifier and TypeMethod and Description
public String
buildMethodName()

Property to use for re-defining which zero-argument method is considered the actual "build-method": method called after all data has been bound, and the actual instance needs to be instantiated.

public String
withPrefix()

Property used for (re)defining name prefix to use for auto-detecting "with-methods": methods that are similar to "set-methods" (in that they take an argument), but that may also return the new builder instance to use (which may be 'this', or a new modified builder instance).

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Field Detail

DEFAULT_BUILD_METHODback to summary
public static final String DEFAULT_BUILD_METHOD
Since
2.9
DEFAULT_WITH_PREFIXback to summary
public static final String DEFAULT_WITH_PREFIX
Since
2.9

Method Detail

buildMethodNameback to summary
public String buildMethodName()

Property to use for re-defining which zero-argument method is considered the actual "build-method": method called after all data has been bound, and the actual instance needs to be instantiated.

Default value is "build".

withPrefixback to summary
public String withPrefix()

Property used for (re)defining name prefix to use for auto-detecting "with-methods": methods that are similar to "set-methods" (in that they take an argument), but that may also return the new builder instance to use (which may be 'this', or a new modified builder instance). Note that in addition to this prefix, it is also possible to use com.fasterxml.jackson.annotation.JsonProperty annotation to indicate "with-methods" (as well as com.fasterxml.jackson.annotation.JsonSetter).

Default value is "with", so that method named "withValue()" would be used for binding JSON property "value" (using type indicated by the argument; or one defined with annotations.

com.fasterxml.jackson.databind.annotation back to summary

public Class JsonPOJOBuilder.Value

extends Object
Class Inheritance
  • java.lang.Object
  • com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder.Value

Simple value container for containing values read from JsonPOJOBuilder annotation instance.

Field Summary

Modifier and TypeField and Description
public final String
public final String

Constructor Summary

AccessConstructor and Description
public
public
Value(String buildMethodName, String withPrefix)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buildMethodNameback to summary
public final String buildMethodName
withPrefixback to summary
public final String withPrefix

Constructor Detail

Valueback to summary
public Value(JsonPOJOBuilder ann)
Valueback to summary
public Value(String buildMethodName, String withPrefix)