Annotation Interface JsonPOJOBuilder
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:
- By default, setters are expected to have names like `withName()` (for property "name");
override by
withPrefix()
property.
In addition to configuration using this annotation, note that many other configuration
annotations are also applied to Builders, for example
JsonIgnoreProperties
can be used to ignore
"unknown" properties.
- Since:
- 2.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Simple value container for containing values read fromJsonPOJOBuilder
annotation instance. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionProperty 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.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). -
Field Summary
-
Field Details
-
DEFAULT_BUILD_METHOD
- Since:
- 2.9
- See Also:
-
DEFAULT_WITH_PREFIX
- Since:
- 2.9
- See Also:
-
-
Element Details
-
buildMethodName
String buildMethodNameProperty 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".
- Default:
- "build"
-
withPrefix
String withPrefixProperty 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 useJsonProperty
annotation to indicate "with-methods" (as well asJsonSetter
).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.
- Default:
- "with"
-