Class SettableBeanProperty
- All Implemented Interfaces:
BeanProperty
,Named
,Serializable
- Direct Known Subclasses:
CreatorProperty
,FieldProperty
,MethodProperty
,ObjectIdReferenceProperty
,ObjectIdValueProperty
,SettableBeanProperty.Delegating
,SetterlessProperty
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Helper class that is designed to both make it easier to sub-class delegating subtypes and to reduce likelihood of breakage when new methods are added.Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.BeanProperty
BeanProperty.Bogus, BeanProperty.Std
-
Field Summary
Fields inherited from interface com.fasterxml.jackson.databind.BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assignIndex
(int index) Method used to assign index for property.void
depositSchemaProperty
(JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) Method that can be called to visit the type structure that this property is part of.final Object
deserialize
(JsonParser p, DeserializationContext ctxt) This method is needed by some specialized bean deserializers, and also called by somedeserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object)
implementations.abstract void
deserializeAndSet
(JsonParser p, DeserializationContext ctxt, Object instance) Method called to deserialize appropriate value, given parser (and context), and set it using appropriate mechanism.abstract Object
deserializeSetAndReturn
(JsonParser p, DeserializationContext ctxt, Object instance) Alternative todeserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.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.final Object
deserializeWith
(JsonParser p, DeserializationContext ctxt, Object toUpdate) void
fixAccess
(DeserializationConfig config) Method called to ensure that the mutator has proper access rights to be called, as per configuration.abstract <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.<A extends Annotation>
AgetContextAnnotation
(Class<A> acls) Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).int
Method for accessing index of the creator property: for other types of properties will simply return -1.Method for getting full name definition, including possible format-specific additional properties (such as namespace when using XML backend).Accessor for id of injectable value, if this bean property supports value injection.abstract AnnotatedMember
Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.final String
getName()
Method to get logical name of the propertyint
Method for accessing unique index of this property; indexes are assigned once all properties of aBeanDeserializer
have been collected.getType()
Method to get declared type of the property.If property is indicated to be wrapped, name of wrapper element to use.boolean
boolean
boolean
hasViews()
boolean
boolean
Accessor for checking whether this property is injectable, and if so, ONLY injectable (will not bind from input).void
abstract void
Method called to assign given value to this property, on specified Object.abstract Object
setAndReturn
(Object instance, Object value) Method called to assign given value to this property, on specified Object, and return whatever delegating accessor returned (if anything)void
void
setObjectIdInfo
(ObjectIdInfo objectIdInfo) void
toString()
boolean
visibleInView
(Class<?> activeView) abstract SettableBeanProperty
withName
(PropertyName newName) Fluent factory method for constructing and returning a new instance with specified property name.abstract SettableBeanProperty
withSimpleName
(String simpleName) abstract SettableBeanProperty
withValueDeserializer
(JsonDeserializer<?> deser) Fluent factory method for constructing and returning a new instance with specified value deserializer.Methods inherited from class com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtual
-
Method Details
-
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
- 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.
-
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
- 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.
-
withSimpleName
- Since:
- 2.3
-
withNullProvider
- Since:
- 2.9
-
setManagedReferenceName
-
setObjectIdInfo
-
setViews
-
assignIndex
public void assignIndex(int index) Method used to assign index for property. -
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.- Since:
- 2.8.3
-
markAsIgnorable
public void markAsIgnorable()- Since:
- 2.9.4
-
isIgnorable
public boolean isIgnorable()- Since:
- 2.9.4
-
getName
Description copied from interface:BeanProperty
Method to get logical name of the property- Specified by:
getName
in interfaceBeanProperty
- Specified by:
getName
in interfaceNamed
-
getFullName
Description copied from interface:BeanProperty
Method for getting full name definition, including possible format-specific additional properties (such as namespace when using XML backend).- Specified by:
getFullName
in interfaceBeanProperty
-
getType
Description copied from interface:BeanProperty
Method to get declared type of the property.- Specified by:
getType
in interfaceBeanProperty
-
getWrapperName
Description copied from interface:BeanProperty
If property is indicated to be wrapped, name of wrapper element to use.- Specified by:
getWrapperName
in interfaceBeanProperty
-
getMember
Description copied from interface:BeanProperty
Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.- Specified by:
getMember
in interfaceBeanProperty
-
getAnnotation
Description copied from interface:BeanProperty
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
AnnotationIntrospector
s) should be accessed throughAnnotationIntrospector
.- Specified by:
getAnnotation
in interfaceBeanProperty
-
getContextAnnotation
Description copied from interface:BeanProperty
Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate
AnnotationIntrospector
s) should be accessed throughAnnotationIntrospector
.- Specified by:
getContextAnnotation
in interfaceBeanProperty
-
depositSchemaProperty
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) throws JsonMappingException Description copied from interface:BeanProperty
Method that can be called to visit the type structure that this property is part of. Note that not all implementations support traversal with this method; those that do not should throwUnsupportedOperationException
.NOTE: Starting with 2.7, takes explicit
SerializerProvider
argument to reduce the need to rely on provider visitor may or may not have assigned.- Specified by:
depositSchemaProperty
in interfaceBeanProperty
- Parameters:
objectVisitor
- Visitor to used as the callback handler- Throws:
JsonMappingException
-
getManagedReferenceName
-
getObjectIdInfo
-
hasValueDeserializer
public boolean hasValueDeserializer() -
hasValueTypeDeserializer
public boolean hasValueTypeDeserializer() -
getValueDeserializer
-
getValueTypeDeserializer
-
getNullValueProvider
- Since:
- 2.9
-
visibleInView
-
hasViews
public boolean hasViews() -
getPropertyIndex
public int getPropertyIndex()Method for accessing unique index of this property; indexes are assigned once all properties of aBeanDeserializer
have been collected.- Returns:
- Index of this property
-
getCreatorIndex
public int getCreatorIndex()Method for accessing index of the creator property: for other types of properties will simply return -1.- Since:
- 2.1
-
getInjectableValueId
Accessor for id of injectable value, if this bean property supports value injection. -
isInjectionOnly
public boolean isInjectionOnly()Accessor for checking whether this property is injectable, and if so, ONLY injectable (will not bind from input). Currently (2.11) can only returntrue
for Creator-backed properties.- Returns:
- True if (and only if) property has injector that is also defined NOT to bind from input.
- Since:
- 2.11
-
deserializeAndSet
public abstract void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException 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).- Throws:
IOException
-
deserializeSetAndReturn
public abstract Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException Alternative todeserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.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.- Throws:
IOException
- Since:
- 2.0
-
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.
- Throws:
IOException
-
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.
- Throws:
IOException
-
deserialize
This method is needed by some specialized bean deserializers, and also called by somedeserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object)
implementations.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).
Note that this method is final for performance reasons: to override functionality you must override other methods that call this method; this method should also not be called directly unless you really know what you are doing (and probably not even then).
- Throws:
IOException
-
deserializeWith
public final Object deserializeWith(JsonParser p, DeserializationContext ctxt, Object toUpdate) throws IOException - Throws:
IOException
- Since:
- 2.9
-
toString
-