public abstract class SettableBeanProperty extends ConcreteBeanPropertyBase implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SettableBeanProperty.Delegating
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.
|
BeanProperty.Bogus, BeanProperty.Std
Modifier and Type | Field and Description |
---|---|
protected Annotations |
_contextAnnotations
Class that contains this property (either class that declares
the property or one of its subclasses), class that is
deserialized using deserializer that contains this property.
|
protected String |
_managedReferenceName
If property represents a managed (forward) reference, we will need
the name of reference for later linking.
|
protected NullValueProvider |
_nullProvider
Entity used for possible translation from `null` into non-null
value of type of this property.
|
protected ObjectIdInfo |
_objectIdInfo
This is the information for object identity associated with the property.
|
protected int |
_propertyIndex
Index of property (within all property of a bean); assigned
when all properties have been collected.
|
protected PropertyName |
_propName
Logical name of the property (often but not always derived
from the setter method name)
|
protected JavaType |
_type
Base type for property; may be a supertype of actual value.
|
protected JsonDeserializer<Object> |
_valueDeserializer
Deserializer used for handling property value.
|
protected TypeDeserializer |
_valueTypeDeserializer
If value will contain type information (to support
polymorphic handling), this is the type deserializer
used to handle type resolution.
|
protected ViewMatcher |
_viewMatcher
Helper object used for checking whether this property is to
be included in the active view, if property is view-specific;
null otherwise.
|
protected PropertyName |
_wrapperName |
protected static JsonDeserializer<Object> |
MISSING_VALUE_DESERIALIZER
To avoid nasty NPEs, let's use a placeholder for _valueDeserializer,
if real deserializer is not (yet) available.
|
_aliases, _metadata
EMPTY_FORMAT, EMPTY_INCLUDE
Modifier | Constructor and Description |
---|---|
protected |
SettableBeanProperty(BeanPropertyDefinition propDef,
JavaType type,
TypeDeserializer typeDeser,
Annotations contextAnnotations) |
protected |
SettableBeanProperty(PropertyName propName,
JavaType type,
PropertyMetadata metadata,
JsonDeserializer<Object> valueDeser)
Constructor only used by
ObjectIdValueProperty . |
protected |
SettableBeanProperty(PropertyName propName,
JavaType type,
PropertyName wrapper,
TypeDeserializer typeDeser,
Annotations contextAnnotations,
PropertyMetadata metadata) |
protected |
SettableBeanProperty(SettableBeanProperty src)
Basic copy-constructor for sub-classes to use.
|
protected |
SettableBeanProperty(SettableBeanProperty src,
JsonDeserializer<?> deser,
NullValueProvider nuller)
Copy-with-deserializer-change constructor for sub-classes to use.
|
protected |
SettableBeanProperty(SettableBeanProperty src,
PropertyName newName)
Copy-with-deserializer-change constructor for sub-classes to use.
|
Modifier and Type | Method and Description |
---|---|
protected IOException |
_throwAsIOE(Exception e)
Deprecated.
|
protected void |
_throwAsIOE(Exception e,
Object value) |
protected IOException |
_throwAsIOE(JsonParser p,
Exception e) |
protected void |
_throwAsIOE(JsonParser p,
Exception e,
Object value)
Method that takes in exception of any type, and casts or wraps it
to an IOException or its subclass.
|
void |
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.
|
Object |
deserialize(JsonParser p,
DeserializationContext ctxt)
This method is needed by some specialized bean deserializers,
and also called by some
deserializeAndSet(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 to
deserializeAndSet(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. |
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> |
getAnnotation(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> |
getContextAnnotation(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 |
getCreatorIndex()
Method for accessing index of the creator property: for other
types of properties will simply return -1.
|
protected Class<?> |
getDeclaringClass() |
PropertyName |
getFullName()
Method for getting full name definition, including possible
format-specific additional properties (such as namespace when
using XML backend).
|
Object |
getInjectableValueId()
Accessor for id of injectable value, if this bean property supports
value injection.
|
String |
getManagedReferenceName() |
abstract AnnotatedMember |
getMember()
Method for accessing primary physical entity that represents the property;
annotated field, method or constructor property.
|
String |
getName()
Method to get logical name of the property
|
NullValueProvider |
getNullValueProvider() |
ObjectIdInfo |
getObjectIdInfo() |
int |
getPropertyIndex()
Method for accessing unique index of this property; indexes are
assigned once all properties of a
BeanDeserializer have
been collected. |
JavaType |
getType()
Method to get declared type of the property.
|
JsonDeserializer<Object> |
getValueDeserializer() |
TypeDeserializer |
getValueTypeDeserializer() |
PropertyName |
getWrapperName()
If property is indicated to be wrapped, name of
wrapper element to use.
|
boolean |
hasValueDeserializer() |
boolean |
hasValueTypeDeserializer() |
boolean |
hasViews() |
boolean |
isIgnorable() |
boolean |
isInjectionOnly()
Accessor for checking whether this property is injectable, and if so,
ONLY injectable (will not bind from input).
|
void |
markAsIgnorable() |
abstract void |
set(Object instance,
Object value)
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 |
setManagedReferenceName(String n) |
void |
setObjectIdInfo(ObjectIdInfo objectIdInfo) |
void |
setViews(Class<?>[] views) |
String |
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 |
withNullProvider(NullValueProvider nva) |
SettableBeanProperty |
withSimpleName(String simpleName) |
abstract SettableBeanProperty |
withValueDeserializer(JsonDeserializer<?> deser)
Fluent factory method for constructing and returning a new instance
with specified value deserializer.
|
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtual
protected static final JsonDeserializer<Object> MISSING_VALUE_DESERIALIZER
protected final PropertyName _propName
protected final JavaType _type
protected final PropertyName _wrapperName
protected final transient Annotations _contextAnnotations
protected final JsonDeserializer<Object> _valueDeserializer
NOTE: has been immutable since 2.3
protected final TypeDeserializer _valueTypeDeserializer
protected final NullValueProvider _nullProvider
_valueDeserializer
, but not always.protected String _managedReferenceName
TODO: should try to make immutable.
protected ObjectIdInfo _objectIdInfo
TODO: should try to make immutable.
protected ViewMatcher _viewMatcher
TODO: should try to make immutable.
protected int _propertyIndex
TODO: should try to make immutable if at all possible
protected SettableBeanProperty(BeanPropertyDefinition propDef, JavaType type, TypeDeserializer typeDeser, Annotations contextAnnotations)
protected SettableBeanProperty(PropertyName propName, JavaType type, PropertyName wrapper, TypeDeserializer typeDeser, Annotations contextAnnotations, PropertyMetadata metadata)
protected SettableBeanProperty(PropertyName propName, JavaType type, PropertyMetadata metadata, JsonDeserializer<Object> valueDeser)
ObjectIdValueProperty
.protected SettableBeanProperty(SettableBeanProperty src)
protected SettableBeanProperty(SettableBeanProperty src, JsonDeserializer<?> deser, NullValueProvider nuller)
protected SettableBeanProperty(SettableBeanProperty src, PropertyName newName)
public abstract SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser)
deser
- Deserializer to assign to the new property instancepublic abstract SettableBeanProperty withName(PropertyName newName)
newName
- Name to use for the new instance.public SettableBeanProperty withSimpleName(String simpleName)
public abstract SettableBeanProperty withNullProvider(NullValueProvider nva)
public void setManagedReferenceName(String n)
public void setObjectIdInfo(ObjectIdInfo objectIdInfo)
public void setViews(Class<?>[] views)
public void assignIndex(int index)
public void fixAccess(DeserializationConfig config)
public void markAsIgnorable()
public boolean isIgnorable()
public final String getName()
BeanProperty
getName
in interface BeanProperty
getName
in interface Named
public PropertyName getFullName()
BeanProperty
getFullName
in interface BeanProperty
public JavaType getType()
BeanProperty
getType
in interface BeanProperty
public PropertyName getWrapperName()
BeanProperty
getWrapperName
in interface BeanProperty
public abstract AnnotatedMember getMember()
BeanProperty
getMember
in interface BeanProperty
public abstract <A extends Annotation> A getAnnotation(Class<A> acls)
BeanProperty
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
through AnnotationIntrospector
.
getAnnotation
in interface BeanProperty
public <A extends Annotation> A getContextAnnotation(Class<A> acls)
BeanProperty
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
through AnnotationIntrospector
.
getContextAnnotation
in interface BeanProperty
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) throws JsonMappingException
BeanProperty
UnsupportedOperationException
.
NOTE: Starting with 2.7, takes explicit SerializerProvider
argument to reduce the need to rely on provider visitor may or may not
have assigned.
depositSchemaProperty
in interface BeanProperty
objectVisitor
- Visitor to used as the callback handlerJsonMappingException
protected Class<?> getDeclaringClass()
public String getManagedReferenceName()
public ObjectIdInfo getObjectIdInfo()
public boolean hasValueDeserializer()
public boolean hasValueTypeDeserializer()
public JsonDeserializer<Object> getValueDeserializer()
public TypeDeserializer getValueTypeDeserializer()
public NullValueProvider getNullValueProvider()
public boolean visibleInView(Class<?> activeView)
public boolean hasViews()
public int getPropertyIndex()
BeanDeserializer
have
been collected.public int getCreatorIndex()
public Object getInjectableValueId()
public boolean isInjectionOnly()
true
for Creator-backed properties.public abstract void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException
IOException
public abstract Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException
deserializeAndSet(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.IOException
public abstract void set(Object instance, Object value) throws IOException
Note: this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.
IOException
public abstract Object setAndReturn(Object instance, Object value) throws IOException
Note: this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.
IOException
public final Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
deserializeAndSet(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).
IOException
public final Object deserializeWith(JsonParser p, DeserializationContext ctxt, Object toUpdate) throws IOException
IOException
protected void _throwAsIOE(JsonParser p, Exception e, Object value) throws IOException
IOException
protected IOException _throwAsIOE(JsonParser p, Exception e) throws IOException
IOException
@Deprecated protected IOException _throwAsIOE(Exception e) throws IOException
IOException
protected void _throwAsIOE(Exception e, Object value) throws IOException
IOException
Copyright © 2008–2023 FasterXML. All rights reserved.