Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.deser.impl

public Class MergingSettableBeanProperty

extends Delegating
Class Inheritance
Imports
java.io.IOException, com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.deser.*, com.fasterxml.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 com.fasterxml.jackson.databind.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

Field Summary

Modifier and TypeField and Description
protected final AnnotatedMember
_accessor

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

private static final long
Inherited from com.fasterxml.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 com.fasterxml.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 com.fasterxml.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 void
set(Object instance, Object value)

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.set.

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

public Object
setAndReturn(Object instance, Object value)

Overrides com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.withDelegate.

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

Inherited from com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating:
_withassignIndexfixAccessgetAnnotationgetCreatorIndexgetDeclaringClassgetDelegategetInjectableValueIdgetManagedReferenceNamegetMembergetObjectIdInfogetPropertyIndexgetValueDeserializergetValueTypeDeserializerhasValueDeserializerhasValueTypeDeserializerhasViewsisInjectionOnlyvisibleInViewwithNamewithNullProviderwithValueDeserializer

Field Detail

_accessorback to summary
protected final AnnotatedMember _accessor

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

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase.serialVersionUID.

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 IOException

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.deserializeAndSet.

Doc from com.fasterxml.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 IOException

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.deserializeSetAndReturn.

Doc from com.fasterxml.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
setback to summary
public void set(Object instance, Object value) throws IOException

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.set.

Doc from com.fasterxml.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(Object instance, Object value) throws IOException

Overrides com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.setAndReturn.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.withDelegate.

Doc from com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating.withDelegate.

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

Annotations
@Override