public class MergingSettableBeanProperty extends SettableBeanProperty.Delegating
SettableBeanProperty
implementation that will try to access value of
the property first, and if non-null value found, pass that for update
(using JsonDeserializer.deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, Object)
)
instead of constructing a new value. This is necessary to support "merging" properties.
Note that there are many similarities to SetterlessProperty
, which predates
this variant; and that one is even used in cases where there is no mutator
available.
SettableBeanProperty.Delegating
BeanProperty.Bogus, BeanProperty.Std
EMPTY_FORMAT, EMPTY_INCLUDE
Modifier and Type | Method and Description |
---|---|
static MergingSettableBeanProperty |
construct(SettableBeanProperty delegate,
AnnotatedMember accessor) |
void |
deserializeAndSet(JsonParser p,
DeserializationContext ctxt,
java.lang.Object instance)
Method called to deserialize appropriate value, given parser (and
context), and set it using appropriate mechanism.
|
java.lang.Object |
deserializeSetAndReturn(JsonParser p,
DeserializationContext ctxt,
java.lang.Object instance)
Alternative to
SettableBeanProperty.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. |
void |
set(java.lang.Object instance,
java.lang.Object value)
Method called to assign given value to this property, on
specified Object.
|
java.lang.Object |
setAndReturn(java.lang.Object instance,
java.lang.Object value)
Method called to assign given value to this property, on
specified Object, and return whatever delegating accessor
returned (if anything)
|
assignIndex, fixAccess, getAnnotation, getCreatorIndex, getDelegate, getInjectableValueId, getManagedReferenceName, getMember, getObjectIdInfo, getPropertyIndex, getValueDeserializer, getValueTypeDeserializer, hasValueDeserializer, hasValueTypeDeserializer, hasViews, visibleInView, withName, withNullProvider, withValueDeserializer
depositSchemaProperty, deserialize, deserializeWith, getContextAnnotation, getFullName, getName, getNullValueProvider, getType, getWrapperName, isIgnorable, markAsIgnorable, setManagedReferenceName, setObjectIdInfo, setViews, toString, withSimpleName
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtual
public static MergingSettableBeanProperty construct(SettableBeanProperty delegate, AnnotatedMember accessor)
public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, java.lang.Object instance) throws java.io.IOException
SettableBeanProperty
deserializeAndSet
in class SettableBeanProperty.Delegating
java.io.IOException
public java.lang.Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, java.lang.Object instance) throws java.io.IOException
SettableBeanProperty
SettableBeanProperty.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.deserializeSetAndReturn
in class SettableBeanProperty.Delegating
java.io.IOException
public void set(java.lang.Object instance, java.lang.Object value) throws java.io.IOException
SettableBeanProperty
Note: this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.
set
in class SettableBeanProperty.Delegating
java.io.IOException
public java.lang.Object setAndReturn(java.lang.Object instance, java.lang.Object value) throws java.io.IOException
SettableBeanProperty
Note: this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.
setAndReturn
in class SettableBeanProperty.Delegating
java.io.IOException
Copyright © 2010 - 2020 Adobe. All Rights Reserved