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

public Class PropertyValueBuffer

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.BitSet, com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.deser.SettableAnyProperty, .SettableBeanProperty, com.fasterxml.jackson.databind.introspect.AnnotatedMember

Simple container used for temporarily buffering a set of PropertyValues. Using during construction of beans (and Maps) that use Creators, and hence need buffering before instance (that will have properties to assign values to) is constructed.

Field Summary

Modifier and TypeField and Description
protected PropertyValue
_anyParamBuffered

If "Any-setter-via-Creator" exists, we will need to buffer values to feed it, separate from regular, non-creator properties (see _buffered).

protected final SettableAnyProperty
_anyParamSetter

"Any setter" property bound to a Creator parameter (via @JsonAnySetter)

protected PropertyValue
_buffered

If we get non-creator parameters before or between creator parameters, those need to be buffered.

protected final DeserializationContext
protected final Object[]
_creatorParameters

Buffer used for storing creator parameters for constructing instance.

protected Object
_idValue

In case there is an Object Id property to handle, this is the value we have for it.

protected final ObjectIdReader
protected int
_paramsNeeded

Number of creator parameters for which we have not yet received values.

protected int
_paramsSeen

Bitflag used to track parameters found from incoming data when number of parameters is less than 32 (fits in int).

protected final BitSet
_paramsSeenBig

Bitflag used to track parameters found from incoming data when number of parameters is 32 or higher.

protected final JsonParser

Constructor Summary

AccessConstructor and Description
public
public
PropertyValueBuffer(JsonParser p, DeserializationContext ctxt, int paramCount, ObjectIdReader oir)
Deprecated

Method Summary

Modifier and TypeMethod and Description
private Object
_createAndSetAnySetterValue()

Helper method called to create and set any values buffered for "any setter"

protected Object
public boolean

Returns:

True if we have received all creator parameters
assignParameter
(SettableBeanProperty prop, Object value)

Method called to buffer value for given property, as well as check whether we now have values for all (creator) properties that we expect to get values for.

public void
public void
protected PropertyValue
public void
public void
public Object
getParameter(SettableBeanProperty prop)

A variation of getParameters(SettableBeanProperty[]) that accepts a single property.

public Object[]
getParameters(SettableBeanProperty[] props)

Method called to do necessary post-processing such as injection of values and verification of values for required properties, after either assignParameter(SettableBeanProperty, Object) returns true (to indicate all creator properties are found), or when then whole JSON Object has been processed,

public Object
handleIdValue(final DeserializationContext ctxt, Object bean)

Helper method called to handle Object Id value collected earlier, if any

public final boolean
hasParameter(SettableBeanProperty prop)

Returns true if the given property was seen in the JSON source by this buffer.

public boolean
public boolean
readIdProperty(String propName)

Helper method called to see if given non-creator property is the "id property"; and if so, handle appropriately.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_anyParamBufferedback to summary
protected PropertyValue _anyParamBuffered

If "Any-setter-via-Creator" exists, we will need to buffer values to feed it, separate from regular, non-creator properties (see _buffered).

Since
2.18
_anyParamSetterback to summary
protected final SettableAnyProperty _anyParamSetter

"Any setter" property bound to a Creator parameter (via @JsonAnySetter)

Since
2.18
_bufferedback to summary
protected PropertyValue _buffered

If we get non-creator parameters before or between creator parameters, those need to be buffered. Buffer is just a simple linked list

_contextback to summary
protected final DeserializationContext _context
_creatorParametersback to summary
protected final Object[] _creatorParameters

Buffer used for storing creator parameters for constructing instance.

_idValueback to summary
protected Object _idValue

In case there is an Object Id property to handle, this is the value we have for it.

_objectIdReaderback to summary
protected final ObjectIdReader _objectIdReader
_paramsNeededback to summary
protected int _paramsNeeded

Number of creator parameters for which we have not yet received values.

_paramsSeenback to summary
protected int _paramsSeen

Bitflag used to track parameters found from incoming data when number of parameters is less than 32 (fits in int).

_paramsSeenBigback to summary
protected final BitSet _paramsSeenBig

Bitflag used to track parameters found from incoming data when number of parameters is 32 or higher.

_parserback to summary
protected final JsonParser _parser

Constructor Detail

PropertyValueBufferback to summary
public PropertyValueBuffer(JsonParser p, DeserializationContext ctxt, int paramCount, ObjectIdReader oir, SettableAnyProperty anyParamSetter)
Since
2.18
PropertyValueBufferback to summary
public PropertyValueBuffer(JsonParser p, DeserializationContext ctxt, int paramCount, ObjectIdReader oir)

Deprecated

Annotations
@Deprecated

Method Detail

_createAndSetAnySetterValueback to summary
private Object _createAndSetAnySetterValue() throws JsonMappingException

Helper method called to create and set any values buffered for "any setter"

_findMissingback to summary
protected Object _findMissing(SettableBeanProperty prop) throws JsonMappingException
assignParameterback to summary
public boolean assignParameter(SettableBeanProperty prop, Object value)

Method called to buffer value for given property, as well as check whether we now have values for all (creator) properties that we expect to get values for.

Returns:boolean

True if we have received all creator parameters

Since
2.6
bufferAnyParameterPropertyback to summary
public void bufferAnyParameterProperty(SettableAnyProperty prop, String propName, Object value)
bufferAnyPropertyback to summary
public void bufferAnyProperty(SettableAnyProperty prop, String propName, Object value)
bufferedback to summary
protected PropertyValue buffered()
bufferMapPropertyback to summary
public void bufferMapProperty(Object key, Object value)
bufferPropertyback to summary
public void bufferProperty(SettableBeanProperty prop, Object value)
getParameterback to summary
public Object getParameter(SettableBeanProperty prop) throws JsonMappingException

A variation of getParameters(SettableBeanProperty[]) that accepts a single property. Whereas the plural form eagerly fetches and validates all properties, this method may be used (along with hasParameter(SettableBeanProperty)) to let applications only fetch the properties defined in the JSON source itself, and to have some other customized behavior for missing properties.

Since
2.8
getParametersback to summary
public Object[] getParameters(SettableBeanProperty[] props) throws JsonMappingException, IOException

Method called to do necessary post-processing such as injection of values and verification of values for required properties, after either assignParameter(SettableBeanProperty, Object) returns true (to indicate all creator properties are found), or when then whole JSON Object has been processed,

handleIdValueback to summary
public Object handleIdValue(final DeserializationContext ctxt, Object bean) throws IOException

Helper method called to handle Object Id value collected earlier, if any

hasParameterback to summary
public final boolean hasParameter(SettableBeanProperty prop)

Returns true if the given property was seen in the JSON source by this buffer.

Since
2.8
isCompleteback to summary
public boolean isComplete()
readIdPropertyback to summary
public boolean readIdProperty(String propName) throws IOException

Helper method called to see if given non-creator property is the "id property"; and if so, handle appropriately.

Since
2.1