- All Implemented Interfaces:
Named,BeanProperty,FullyNamed
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.deser.SettableBeanProperty
SettableBeanProperty.DelegatingNested classes/interfaces inherited from interface tools.jackson.databind.BeanProperty
BeanProperty.Bogus, BeanProperty.StdNested classes/interfaces inherited from interface tools.jackson.core.util.Named
Named.StringAsNamed -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotatedParameterPlaceholder that represents constructor parameter, when it is created from actual constructor.protected final intprotected SettableBeanPropertyIn 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 booleanMarker 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.ValueId of value to inject, if value injection should be used for this parameter (in addition to, or instead of, regular deserialization).Fields inherited from class tools.jackson.databind.deser.SettableBeanProperty
_contextAnnotations, _managedReferenceName, _nullProvider, _objectIdInfo, _propertyIndex, _propName, _type, _valueDeserializer, _valueTypeDeserializer, _viewMatcher, _wrapperName, MISSING_VALUE_DESERIALIZERFields inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
_aliases, _metadataFields inherited from interface tools.jackson.databind.BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreatorProperty(CreatorProperty src, TypeDeserializer typeDeser) protectedCreatorProperty(CreatorProperty src, PropertyName newName) protectedCreatorProperty(CreatorProperty src, ValueDeserializer<?> deser, NullValueProvider nva) protectedCreatorProperty(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, JacksonInject.Value injectable, PropertyMetadata metadata) -
Method Summary
Modifier and TypeMethodDescriptionstatic CreatorPropertyconstruct(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, JacksonInject.Value injectable, PropertyMetadata metadata) Factory method for creatingCreatorPropertyinstancesvoiddeserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) Method called to deserialize appropriate value, given parser (and context), and set it using appropriate mechanism.deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) Alternative toSettableBeanProperty.deserializeAndSet(tools.jackson.core.JsonParser, tools.jackson.databind.DeserializationContext, java.lang.Object)that returns either return value of setter method called (if one is), or null to indicate that no return value is available.voidfixAccess(DeserializationConfig config) Method called to ensure that the mutator has proper access rights to be called, as per configuration.<A extends Annotation>
AgetAnnotation(Class<A> acls) Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.intMethod for accessing index of the creator property: for other types of properties will simply return -1.Accessor for id of injectable value, if this bean property supports value injection.Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.Accessor for additional optional information about property.booleanbooleanAccessor for checking whether this property is injectable, and if so, ONLY injectable (will not bind from input).voidvoidset(DeserializationContext ctxt, Object instance, Object value) Method called to assign given value to this property, on specified Object.setAndReturn(DeserializationContext ctxt, Object instance, Object value) Method called to assign given value to this property, on specified Object, and return whatever delegating accessor returned (if anything)voidsetFallbackSetter(SettableBeanProperty fallbackSetter) NOTE: one exception to immutability, due to problems with CreatorProperty instances being shared between Bean, separate PropertyBasedCreatortoString()withName(PropertyName newName) Fluent factory method for constructing and returning a new instance with specified property name.withValueDeserializer(ValueDeserializer<?> deser) Fluent factory method for constructing and returning a new instance with specified value deserializer.withValueTypeDeserializer(TypeDeserializer typeDeser) Methods inherited from class tools.jackson.databind.deser.SettableBeanProperty
_throwAsJacksonE, _throwAsJacksonE, assignIndex, depositSchemaProperty, deserialize, deserializeWith, getContextAnnotation, getDeclaringClass, getFullName, getManagedReferenceName, getName, getNullValueProvider, getObjectIdInfo, getPropertyIndex, getType, getValueDeserializer, getValueTypeDeserializer, getWrapperName, hasValueDeserializer, hasValueTypeDeserializer, hasViews, isMerging, setManagedReferenceName, setObjectIdInfo, setViews, unwrapped, visibleInView, withSimpleNameMethods inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, isRequired, isVirtualMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface tools.jackson.databind.util.FullyNamed
hasName
-
Field Details
-
_annotated
Placeholder that represents constructor parameter, when it is created from actual constructor. May be null when a synthetic instance is created. -
_injectableValue
Id of value to inject, if value injection should be used for this parameter (in addition to, or instead of, regular deserialization). -
_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.
-
_creatorIndex
protected final int _creatorIndex -
_ignorable
protected boolean _ignorableMarker 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.
-
-
Constructor Details
-
CreatorProperty
protected CreatorProperty(PropertyName name, JavaType type, PropertyName wrapperName, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedParameter param, int index, JacksonInject.Value injectable, PropertyMetadata metadata) -
CreatorProperty
-
CreatorProperty
-
CreatorProperty
-
-
Method Details
-
construct
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 creatingCreatorPropertyinstances- Parameters:
name- Name of the logical propertytype- Type of the property, used to find deserializerwrapperName- Possible wrapper to use for logical property, if anytypeDeser- Type deserializer to use for handling polymorphic type information, if one is neededcontextAnnotations- Contextual annotations (usually by class that declares creator [constructor, factory method] that includes this property)param- Representation of property, constructor or factory method parameter; used for accessing annotations of the propertyinjectable- Information about injectable value, if anyindex- Index of this property within creator invocation
-
withName
Description copied from class:SettableBeanPropertyFluent factory method for constructing and returning a new instance with specified property name. Note that this method should NOT change configuration of this instance.- Specified by:
withNamein classSettableBeanProperty- Parameters:
newName- Name to use for the new instance.- Returns:
- Newly constructed instance, if property name differs from the one used for this instance; or 'this' if not.
-
withValueDeserializer
Description copied from class:SettableBeanPropertyFluent factory method for constructing and returning a new instance with specified value deserializer. Note that this method should NOT change configuration of this instance.- Specified by:
withValueDeserializerin classSettableBeanProperty- Parameters:
deser- Deserializer to assign to the new property instance- Returns:
- Newly constructed instance, if value deserializer differs from the one used for this instance; or 'this' if not.
-
withNullProvider
- Specified by:
withNullProviderin classSettableBeanProperty
-
withValueTypeDeserializer
-
fixAccess
Description copied from class:SettableBeanPropertyMethod 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.- Overrides:
fixAccessin classSettableBeanProperty
-
setFallbackSetter
NOTE: one exception to immutability, due to problems with CreatorProperty instances being shared between Bean, separate PropertyBasedCreator -
markAsIgnorable
public void markAsIgnorable()- Overrides:
markAsIgnorablein classSettableBeanProperty
-
isIgnorable
public boolean isIgnorable()- Overrides:
isIgnorablein classSettableBeanProperty
-
getAnnotation
Description copied from interface:BeanPropertyMethod 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 throughAnnotationIntrospector.- Specified by:
getAnnotationin interfaceBeanProperty- Specified by:
getAnnotationin classSettableBeanProperty
-
getMember
Description copied from interface:BeanPropertyMethod for accessing primary physical entity that represents the property; annotated field, method or constructor property.- Specified by:
getMemberin interfaceBeanProperty- Specified by:
getMemberin classSettableBeanProperty
-
getCreatorIndex
public int getCreatorIndex()Description copied from class:SettableBeanPropertyMethod for accessing index of the creator property: for other types of properties will simply return -1.- Overrides:
getCreatorIndexin classSettableBeanProperty
-
deserializeAndSet
public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws JacksonException Description copied from class:SettableBeanPropertyMethod 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).- Specified by:
deserializeAndSetin classSettableBeanProperty- Throws:
JacksonException
-
deserializeSetAndReturn
public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws JacksonException Description copied from class:SettableBeanPropertyAlternative toSettableBeanProperty.deserializeAndSet(tools.jackson.core.JsonParser, tools.jackson.databind.DeserializationContext, java.lang.Object)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.- Specified by:
deserializeSetAndReturnin classSettableBeanProperty- Throws:
JacksonException
-
set
Description copied from class:SettableBeanPropertyMethod 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.
- Specified by:
setin classSettableBeanProperty
-
setAndReturn
Description copied from class:SettableBeanPropertyMethod 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.
- Specified by:
setAndReturnin classSettableBeanProperty
-
getMetadata
Description copied from interface:BeanPropertyAccessor for additional optional information about property.- Specified by:
getMetadatain interfaceBeanProperty- Overrides:
getMetadatain classConcreteBeanPropertyBase- Returns:
- Metadata about property; never null.
-
getInjectableValueId
Description copied from class:SettableBeanPropertyAccessor for id of injectable value, if this bean property supports value injection.- Overrides:
getInjectableValueIdin classSettableBeanProperty
-
isInjectionOnly
public boolean isInjectionOnly()Description copied from class:SettableBeanPropertyAccessor for checking whether this property is injectable, and if so, ONLY injectable (will not bind from input). Currently (2.11) can only returntruefor Creator-backed properties.- Overrides:
isInjectionOnlyin classSettableBeanProperty- Returns:
- True if (and only if) property has injector that is also defined NOT to bind from input.
-
toString
- Overrides:
toStringin classSettableBeanProperty
-