Top Description Fields Constructors Methods
tools.jackson.databind.deser.impl

public Class MergingSettableBeanProperty

extends Delegating
Class Inheritance
Imports
tools.jackson.core.JacksonException, .JsonParser, tools.jackson.databind.DeserializationContext, tools.jackson.databind.deser.*, tools.jackson.databind.introspect.AnnotatedMember

SettableBeanProperty implementation that will try to access value of the property first, and if non-null value found, pass that for update (using tools.jackson.databind.ValueDeserializer#deserialize(tools.jackson.core.JsonParser, tools.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.

Field Summary

Modifier and TypeField and Description
protected final AnnotatedMember
_accessor

Member (field, method) used for accessing existing value.

Inherited from tools.jackson.databind.deser.SettableBeanProperty.Delegating:
delegate

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public static MergingSettableBeanProperty
public void
deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance)

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.deserializeAndSet.

Method called to deserialize appropriate value, given parser (and context), and set it using appropriate mechanism.

public Object
deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance)

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.deserializeSetAndReturn.

Alternative to deserializeAndSet that returns either return value of setter method called (if one is), or null to indicate that no return value is available.

public boolean
isMerging()

Overrides tools.jackson.databind.deser.SettableBeanProperty.isMerging.

Whether this property requires merging of values (read-then-write)

public void
set(DeserializationContext ctxt, Object instance, Object value)

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.set.

Method called to assign given value to this property, on specified Object.

public Object
setAndReturn(DeserializationContext ctxt, Object instance, Object value)

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.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.

protected SettableBeanProperty
withDelegate(SettableBeanProperty d)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.Delegating.withDelegate.

Method sub-classes must implement, to construct a new instance with given delegate.

Inherited from tools.jackson.databind.deser.SettableBeanProperty.Delegating:
_withassignIndexfixAccessgetAnnotationgetCreatorIndexgetDeclaringClassgetDelegategetInjectableValueIdgetManagedReferenceNamegetMembergetObjectIdInfogetPropertyIndexgetValueDeserializergetValueTypeDeserializerhasValueDeserializerhasValueTypeDeserializerhasViewsisInjectionOnlyvisibleInViewwithNamewithNullProviderwithValueDeserializer

Field Detail

_accessorback to summary
protected final AnnotatedMember _accessor

Member (field, method) used for accessing existing value.

Constructor Detail

MergingSettableBeanPropertyback to summary
protected MergingSettableBeanProperty(SettableBeanProperty delegate, AnnotatedMember accessor)
MergingSettableBeanPropertyback to summary
protected MergingSettableBeanProperty(MergingSettableBeanProperty src, SettableBeanProperty delegate)

Method Detail

constructback to summary
public static MergingSettableBeanProperty construct(SettableBeanProperty delegate, AnnotatedMember accessor)
deserializeAndSetback to summary
public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws JacksonException

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.deserializeAndSet.

Doc from tools.jackson.databind.deser.SettableBeanProperty.deserializeAndSet.

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).

Annotations
@Override
deserializeSetAndReturnback to summary
public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws JacksonException

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.deserializeSetAndReturn.

Doc from tools.jackson.databind.deser.SettableBeanProperty.deserializeSetAndReturn.

Alternative to deserializeAndSet 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.

Annotations
@Override
isMergingback to summary
public boolean isMerging()

Overrides tools.jackson.databind.deser.SettableBeanProperty.isMerging.

Doc from tools.jackson.databind.deser.SettableBeanProperty.isMerging.

Whether this property requires merging of values (read-then-write)

Annotations
@Override
setback to summary
public void set(DeserializationContext ctxt, Object instance, Object value)

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.set.

Doc from tools.jackson.databind.deser.SettableBeanProperty.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.

Annotations
@Override
setAndReturnback to summary
public Object setAndReturn(DeserializationContext ctxt, Object instance, Object value)

Overrides tools.jackson.databind.deser.SettableBeanProperty.Delegating.setAndReturn.

Doc from tools.jackson.databind.deser.SettableBeanProperty.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.

Annotations
@Override
withDelegateback to summary
protected SettableBeanProperty withDelegate(SettableBeanProperty d)

Implements abstract tools.jackson.databind.deser.SettableBeanProperty.Delegating.withDelegate.

Doc from tools.jackson.databind.deser.SettableBeanProperty.Delegating.withDelegate.

Method sub-classes must implement, to construct a new instance with given delegate.

Annotations
@Override