Class MergingSettableBeanProperty
java.lang.Object
com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase
com.fasterxml.jackson.databind.deser.SettableBeanProperty
com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating
com.fasterxml.jackson.databind.deser.impl.MergingSettableBeanProperty
- All Implemented Interfaces:
BeanProperty,Named,Serializable
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.
- Since:
- 2.9
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty
SettableBeanProperty.DelegatingNested 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 TypeMethodDescriptionstatic MergingSettableBeanPropertyconstruct(SettableBeanProperty delegate, AnnotatedMember accessor) voiddeserializeAndSet(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(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.voidMethod called to assign given value to this property, on specified 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)Methods inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating
assignIndex, fixAccess, getAnnotation, getCreatorIndex, getDelegate, getInjectableValueId, getManagedReferenceName, getMember, getObjectIdInfo, getPropertyIndex, getValueDeserializer, getValueTypeDeserializer, hasValueDeserializer, hasValueTypeDeserializer, hasViews, isInjectionOnly, visibleInView, withName, withNullProvider, withValueDeserializerMethods inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty
depositSchemaProperty, deserialize, deserializeWith, getContextAnnotation, getFullName, getName, getNullValueProvider, getType, getWrapperName, isIgnorable, markAsIgnorable, setManagedReferenceName, setObjectIdInfo, setViews, toString, withSimpleNameMethods inherited from class com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtual
-
Method Details
-
construct
public static MergingSettableBeanProperty construct(SettableBeanProperty delegate, AnnotatedMember accessor) -
deserializeAndSet
public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException 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).- Overrides:
deserializeAndSetin classSettableBeanProperty.Delegating- Throws:
IOException
-
deserializeSetAndReturn
public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException Description copied from class:SettableBeanPropertyAlternative toSettableBeanProperty.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.- Overrides:
deserializeSetAndReturnin classSettableBeanProperty.Delegating- Throws:
IOException
-
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.
- Overrides:
setin classSettableBeanProperty.Delegating- Throws:
IOException
-
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.
- Overrides:
setAndReturnin classSettableBeanProperty.Delegating- Throws:
IOException
-