Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.deser

public Class CreatorProperty

extends SettableBeanProperty
Class Inheritance
Imports
java.io.IOException, java.lang.annotation.Annotation, com.fasterxml.jackson.annotation.JacksonInject, com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.exc.InvalidDefinitionException, com.fasterxml.jackson.databind.introspect.AnnotatedMember, .AnnotatedParameter, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.fasterxml.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).

private static final long
Inherited from com.fasterxml.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)

public
CreatorProperty(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, Object injectableValueId, PropertyMetadata metadata)

Deprecated Since 2.11 use factory method instead
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 com.fasterxml.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 com.fasterxml.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 Object
findInjectableValue(DeserializationContext context, Object beanInstance)

Deprecated
public void
fixAccess(DeserializationConfig config)

Overrides com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.getAnnotation.

Implements com.fasterxml.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 com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.getInjectableValueId.

Accessor for id of injectable value, if this bean property supports value injection.
public AnnotatedMember
getMember()

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.getMember.

Implements com.fasterxml.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.
public PropertyMetadata
public void
inject(DeserializationContext context, Object beanInstance)

Deprecated
public boolean
public boolean
isInjectionOnly()

Overrides com.fasterxml.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(Object instance, Object value)

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.set.

Method called to assign given value to this property, on specified Object.
public Object
setAndReturn(Object instance, Object value)

Implements abstract com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.toString.

Returns a string representation of the object.
public SettableBeanProperty
withName(PropertyName
Name to use for the new instance.
newName
)

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.withName.

Fluent factory method for constructing and returning a new instance with specified property name.
public SettableBeanProperty
public SettableBeanProperty
withValueDeserializer(JsonDeserializer<?>
Deserializer to assign to the new property instance
deser
)

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.withValueDeserializer.

Fluent factory method for constructing and returning a new instance with specified value deserializer.
Inherited from com.fasterxml.jackson.databind.deser.SettableBeanProperty:
_throwAsIOE_throwAsIOE_throwAsIOE_throwAsIOEassignIndexdepositSchemaPropertydeserializedeserializeWithgetContextAnnotationgetDeclaringClassgetFullNamegetManagedReferenceNamegetNamegetNullValueProvidergetObjectIdInfogetPropertyIndexgetTypegetValueDeserializergetValueTypeDeserializergetWrapperNamehasValueDeserializerhasValueTypeDeserializerhasViewssetManagedReferenceNamesetObjectIdInfosetViewsvisibleInViewwithSimpleName

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
Since
2.1
_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.

Since
2.3
_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.

Since
2.9.4
_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).

Since
2.11
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase.serialVersionUID.

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)
Since
2.11
CreatorPropertyback to summary
public CreatorProperty(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, Object injectableValueId, PropertyMetadata metadata)

Deprecated

Since 2.11 use factory method instead

Annotations
@Deprecated
CreatorPropertyback to summary
protected CreatorProperty(CreatorProperty src, PropertyName newName)
Since
2.3
CreatorPropertyback to summary
protected CreatorProperty(CreatorProperty src, JsonDeserializer<?> deser, NullValueProvider nva)

Method Detail

_reportMissingSetterback to summary
private void _reportMissingSetter(JsonParser p, DeserializationContext ctxt) throws IOException
_verifySetterback to summary
private final void _verifySetter() throws IOException
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

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

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserializeAndSet.

Doc from com.fasterxml.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 IOException

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserializeSetAndReturn.

Doc from com.fasterxml.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
findInjectableValueback to summary
public Object findInjectableValue(DeserializationContext context, Object beanInstance) throws JsonMappingException

Deprecated

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

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.fixAccess.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.getAnnotation.

Implements com.fasterxml.jackson.databind.BeanProperty.getAnnotation.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.getCreatorIndex.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.getInjectableValueId.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.getMember.

Implements com.fasterxml.jackson.databind.BeanProperty.getMember.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase.getMetadata.

Implements com.fasterxml.jackson.databind.BeanProperty.getMetadata.

Doc from com.fasterxml.jackson.databind.BeanProperty.getMetadata.

Accessor for additional optional information about property.

Returns:PropertyMetadata

Metadata about property; never null.

Annotations
@Override
injectback to summary
public void inject(DeserializationContext context, Object beanInstance) throws IOException

Deprecated

Annotations
@Deprecated
isIgnorableback to summary
public boolean isIgnorable()

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.isIgnorable.

Annotations
@Override
isInjectionOnlyback to summary
public boolean isInjectionOnly()

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.isInjectionOnly.

Doc from com.fasterxml.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.

Returns:boolean

True if (and only if) property has injector that is also defined NOT to bind from input.

Annotations
@Override
markAsIgnorableback to summary
public void markAsIgnorable()

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.markAsIgnorable.

Annotations
@Override
setback to summary
public void set(Object instance, Object value) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.set.

Doc from com.fasterxml.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(Object instance, Object value) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.setAndReturn.

Doc from com.fasterxml.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

Since
2.6
toStringback to summary
public String toString()

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

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

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.withName.

Doc from com.fasterxml.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.

Parameters
newName:PropertyName

Name to use for the new instance.

Returns:SettableBeanProperty

Newly constructed instance, if property name differs from the one used for this instance; or 'this' if not.

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

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.withNullProvider.

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

Implements abstract com.fasterxml.jackson.databind.deser.SettableBeanProperty.withValueDeserializer.

Doc from com.fasterxml.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.

Parameters
deser:JsonDeserializer<?>

Deserializer to assign to the new property instance

Returns:SettableBeanProperty

Newly constructed instance, if value deserializer differs from the one used for this instance; or 'this' if not.

Annotations
@Override