Top Description Fields Constructors Methods
tools.jackson.databind.deser

public Class CreatorProperty

extends SettableBeanProperty
Class Inheritance
Imports
java.lang.annotation.Annotation, com.fasterxml.jackson.annotation.JacksonInject, tools.jackson.core.JacksonException, .JsonParser, tools.jackson.databind.*, tools.jackson.databind.exc.InvalidDefinitionException, tools.jackson.databind.introspect.AnnotatedMember, .AnnotatedParameter, tools.jackson.databind.jsontype.TypeDeserializer, tools.jackson.databind.util.Annotations, .ClassUtil

This concrete sub-class implements property that is passed via Creator (constructor or static factory method). It is not a full-featured implementation in that its set method should usually not be called for primary mutation -- instead, value must separately passed -- but some aspects are still needed (specifically, injection).

Note on injectable values: unlike with other mutators, where deserializer and injecting are separate, here we treat the two as related things. This is necessary to add proper priority, as well as to simplify coordination.

Field Summary

Modifier and TypeField and Description
protected final AnnotatedParameter
_annotated

Placeholder that represents constructor parameter, when it is created from actual constructor.

protected final int
protected SettableBeanProperty
_fallbackSetter

In special cases, when implementing "updateValue", we cannot use constructors or factory methods, but have to fall back on using a setter (or mutable field property).

protected boolean
_ignorable

Marker flag that may have to be set during construction, to indicate that although property may have been constructed and added as a placeholder, it represents something that should be ignored during deserialization.

protected final JacksonInject.Value
_injectableValue

Id of value to inject, if value injection should be used for this parameter (in addition to, or instead of, regular deserialization).

Inherited from tools.jackson.databind.deser.SettableBeanProperty:
_contextAnnotations_managedReferenceName_nullProvider_objectIdInfo_propertyIndex_propName_type_valueDeserializer_valueTypeDeserializer_viewMatcher_wrapperNameMISSING_VALUE_DESERIALIZER

Constructor Summary

AccessConstructor and Description
protected
CreatorProperty(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, JacksonInject.Value injectable, PropertyMetadata metadata)

protected
protected
protected

Method Summary

Modifier and TypeMethod and Description
private void
private final void
public static CreatorProperty
construct(PropertyName
Name of the logical property
name
,
JavaType
Type of the property, used to find deserializer
type
,
PropertyName
Possible wrapper to use for logical property, if any
wrapperName
,
TypeDeserializer
Type deserializer to use for handling polymorphic type information, if one is needed
typeDeser
,
Annotations
Contextual annotations (usually by class that declares creator [constructor, factory method] that includes this property)
contextAnnotations
,
AnnotatedParameter
Representation of property, constructor or factory method parameter; used for accessing annotations of the property
param
,
int
Index of this property within creator invocation
index
,
JacksonInject.Value
Information about injectable value, if any
injectable
,
PropertyMetadata metadata)

Factory method for creating CreatorProperty instances

public void
deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.deserializeAndSet.

Method called to deserialize appropriate value, given parser (and context), and set it using appropriate mechanism.

public Object
deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.deserializeSetAndReturn.

Alternative to deserializeAndSet that returns either return value of setter method called (if one is), or null to indicate that no return value is available.

public void
fixAccess(DeserializationConfig config)

Overrides tools.jackson.databind.deser.SettableBeanProperty.fixAccess.

Method called to ensure that the mutator has proper access rights to be called, as per configuration.

public <A extends Annotation> A
getAnnotation(Class<A> acls)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.getAnnotation.

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

public int
getCreatorIndex()

Overrides tools.jackson.databind.deser.SettableBeanProperty.getCreatorIndex.

Method for accessing index of the creator property: for other types of properties will simply return -1.

public Object
getInjectableValueId()

Overrides tools.jackson.databind.deser.SettableBeanProperty.getInjectableValueId.

Accessor for id of injectable value, if this bean property supports value injection.

public AnnotatedMember
getMember()

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.getMember.

Implements tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

public PropertyMetadata
getMetadata()

Overrides tools.jackson.databind.introspect.ConcreteBeanPropertyBase.getMetadata.

Implements tools.jackson.databind.BeanProperty.getMetadata.

Accessor for additional optional information about property.

public boolean
public boolean
isInjectionOnly()

Overrides tools.jackson.databind.deser.SettableBeanProperty.isInjectionOnly.

Accessor for checking whether this property is injectable, and if so, ONLY injectable (will not bind from input).

public void
public void
set(DeserializationContext ctxt, Object instance, Object value)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.set.

Method called to assign given value to this property, on specified Object.

public Object
setAndReturn(DeserializationContext ctxt, Object instance, Object value)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.setAndReturn.

Method called to assign given value to this property, on specified Object, and return whatever delegating accessor returned (if anything)

Note

this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.

public void
setFallbackSetter(SettableBeanProperty fallbackSetter)

Note

one exception to immutability, due to problems with CreatorProperty instances being shared between Bean, separate PropertyBasedCreator

public String
toString()

Overrides tools.jackson.databind.deser.SettableBeanProperty.toString.

Returns a string representation of the object.

public SettableBeanProperty
withName(PropertyName newName)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.withName.

Fluent factory method for constructing and returning a new instance with specified property name.

public SettableBeanProperty
public SettableBeanProperty
withValueDeserializer(ValueDeserializer<?> deser)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.withValueDeserializer.

Fluent factory method for constructing and returning a new instance with specified value deserializer.

public SettableBeanProperty
Inherited from tools.jackson.databind.deser.SettableBeanProperty:
_throwAsJacksonE_throwAsJacksonEassignIndexdepositSchemaPropertydeserializedeserializeWithgetContextAnnotationgetDeclaringClassgetFullNamegetManagedReferenceNamegetNamegetNullValueProvidergetObjectIdInfogetPropertyIndexgetTypegetValueDeserializergetValueTypeDeserializergetWrapperNamehasValueDeserializerhasValueTypeDeserializerhasViewsisMergingsetManagedReferenceNamesetObjectIdInfosetViewsunwrappedvisibleInViewwithSimpleName

Field Detail

_annotatedback to summary
protected final AnnotatedParameter _annotated

Placeholder that represents constructor parameter, when it is created from actual constructor. May be null when a synthetic instance is created.

_creatorIndexback to summary
protected final int _creatorIndex
_fallbackSetterback to summary
protected SettableBeanProperty _fallbackSetter

In special cases, when implementing "updateValue", we cannot use constructors or factory methods, but have to fall back on using a setter (or mutable field property). If so, this refers to that fallback accessor.

Mutable only to allow setting after construction, but must be strictly set before any use.

_ignorableback to summary
protected boolean _ignorable

Marker flag that may have to be set during construction, to indicate that although property may have been constructed and added as a placeholder, it represents something that should be ignored during deserialization. This mostly concerns Creator properties which may not be easily deleted during processing.

_injectableValueback to summary
protected final JacksonInject.Value _injectableValue

Id of value to inject, if value injection should be used for this parameter (in addition to, or instead of, regular deserialization).

Constructor Detail

CreatorPropertyback to summary
protected CreatorProperty(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, JacksonInject.Value injectable, PropertyMetadata metadata)
CreatorPropertyback to summary
protected CreatorProperty(CreatorProperty src, PropertyName newName)
CreatorPropertyback to summary
protected CreatorProperty(CreatorProperty src, ValueDeserializer<?> deser, NullValueProvider nva)
CreatorPropertyback to summary
protected CreatorProperty(CreatorProperty src, TypeDeserializer typeDeser)

Method Detail

_reportMissingSetterback to summary
private void _reportMissingSetter(JsonParser p, DeserializationContext ctxt) throws JacksonException
_verifySetterback to summary
private final void _verifySetter() throws JacksonException
constructback to summary
public static CreatorProperty construct(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, JacksonInject.Value injectable, PropertyMetadata metadata)

Factory method for creating CreatorProperty instances

Parameters
name:PropertyName

Name of the logical property

type:JavaType

Type of the property, used to find deserializer

wrapperName:PropertyName

Possible wrapper to use for logical property, if any

typeDeser:TypeDeserializer

Type deserializer to use for handling polymorphic type information, if one is needed

contextAnnotations:Annotations

Contextual annotations (usually by class that declares creator [constructor, factory method] that includes this property)

param:AnnotatedParameter

Representation of property, constructor or factory method parameter; used for accessing annotations of the property

index:int

Index of this property within creator invocation

injectable:JacksonInject.Value

Information about injectable value, if any

deserializeAndSetback to summary
public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws JacksonException

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.deserializeAndSet.

Doc from tools.jackson.databind.deser.SettableBeanProperty.deserializeAndSet.

Method called to deserialize appropriate value, given parser (and context), and set it using appropriate mechanism. Pre-condition is that passed parser must point to the first token that should be consumed to produce the value (the only value for scalars, multiple for Objects and Arrays).

Annotations
@Override
deserializeSetAndReturnback to summary
public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws JacksonException

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.deserializeSetAndReturn.

Doc from tools.jackson.databind.deser.SettableBeanProperty.deserializeSetAndReturn.

Alternative to deserializeAndSet that returns either return value of setter method called (if one is), or null to indicate that no return value is available. Mostly used to support Builder style deserialization.

Annotations
@Override
fixAccessback to summary
public void fixAccess(DeserializationConfig config)

Overrides tools.jackson.databind.deser.SettableBeanProperty.fixAccess.

Doc from tools.jackson.databind.deser.SettableBeanProperty.fixAccess.

Method called to ensure that the mutator has proper access rights to be called, as per configuration. Overridden by implementations that have mutators that require access, fields and setters.

Annotations
@Override
getAnnotationback to summary
public <A extends Annotation> A getAnnotation(Class<A> acls)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.getAnnotation.

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Doc from tools.jackson.databind.BeanProperty.getAnnotation.

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate AnnotationIntrospectors) should be accessed through AnnotationIntrospector.

Annotations
@Override
getCreatorIndexback to summary
public int getCreatorIndex()

Overrides tools.jackson.databind.deser.SettableBeanProperty.getCreatorIndex.

Doc from tools.jackson.databind.deser.SettableBeanProperty.getCreatorIndex.

Method for accessing index of the creator property: for other types of properties will simply return -1.

Annotations
@Override
getInjectableValueIdback to summary
public Object getInjectableValueId()

Overrides tools.jackson.databind.deser.SettableBeanProperty.getInjectableValueId.

Doc from tools.jackson.databind.deser.SettableBeanProperty.getInjectableValueId.

Accessor for id of injectable value, if this bean property supports value injection.

Annotations
@Override
getMemberback to summary
public AnnotatedMember getMember()

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.getMember.

Implements tools.jackson.databind.BeanProperty.getMember.

Doc from tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

Annotations
@Override
getMetadataback to summary
public PropertyMetadata getMetadata()

Overrides tools.jackson.databind.introspect.ConcreteBeanPropertyBase.getMetadata.

Implements tools.jackson.databind.BeanProperty.getMetadata.

Doc from tools.jackson.databind.BeanProperty.getMetadata.

Accessor for additional optional information about property.

Annotations
@Override
isIgnorableback to summary
public boolean isIgnorable()

Overrides tools.jackson.databind.deser.SettableBeanProperty.isIgnorable.

Annotations
@Override
isInjectionOnlyback to summary
public boolean isInjectionOnly()

Overrides tools.jackson.databind.deser.SettableBeanProperty.isInjectionOnly.

Doc from tools.jackson.databind.deser.SettableBeanProperty.isInjectionOnly.

Accessor for checking whether this property is injectable, and if so, ONLY injectable (will not bind from input). Currently (2.11) can only return true for Creator-backed properties.

Annotations
@Override
markAsIgnorableback to summary
public void markAsIgnorable()

Overrides tools.jackson.databind.deser.SettableBeanProperty.markAsIgnorable.

Annotations
@Override
setback to summary
public void set(DeserializationContext ctxt, Object instance, Object value)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.set.

Doc from tools.jackson.databind.deser.SettableBeanProperty.set.

Method called to assign given value to this property, on specified Object.

Note

this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.

Annotations
@Override
setAndReturnback to summary
public Object setAndReturn(DeserializationContext ctxt, Object instance, Object value)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.setAndReturn.

Doc from tools.jackson.databind.deser.SettableBeanProperty.setAndReturn.

Method called to assign given value to this property, on specified Object, and return whatever delegating accessor returned (if anything)

Note

this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.

Annotations
@Override
setFallbackSetterback to summary
public void setFallbackSetter(SettableBeanProperty fallbackSetter)

Note

one exception to immutability, due to problems with CreatorProperty instances being shared between Bean, separate PropertyBasedCreator

toStringback to summary
public String toString()

Overrides tools.jackson.databind.deser.SettableBeanProperty.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
withNameback to summary
public SettableBeanProperty withName(PropertyName newName)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.withName.

Doc from tools.jackson.databind.deser.SettableBeanProperty.withName.

Fluent factory method for constructing and returning a new instance with specified property name. Note that this method should NOT change configuration of this instance.

Annotations
@Override
withNullProviderback to summary
public SettableBeanProperty withNullProvider(NullValueProvider nva)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.withNullProvider.

Annotations
@Override
withValueDeserializerback to summary
public SettableBeanProperty withValueDeserializer(ValueDeserializer<?> deser)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.withValueDeserializer.

Doc from tools.jackson.databind.deser.SettableBeanProperty.withValueDeserializer.

Fluent factory method for constructing and returning a new instance with specified value deserializer. Note that this method should NOT change configuration of this instance.

Annotations
@Override
withValueTypeDeserializerback to summary
public SettableBeanProperty withValueTypeDeserializer(TypeDeserializer typeDeser)