Class UnwrappedPropertyHandler
java.lang.Object
tools.jackson.databind.deser.impl.UnwrappedPropertyHandler
Object that is responsible for handling acrobatics related to
deserializing "unwrapped" values; sets of properties that are
embedded (inlined) as properties of parent JSON object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<SettableBeanProperty> protected final booleanFlag that indicates if any of the unwrapped value deserializers has an "any setter" (seeJsonAnySetter)protected final List<SettableBeanProperty> Set of all unwrapped property names from unwrapped deserializers.static final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUnwrappedPropertyHandler(List<SettableBeanProperty> creatorProps, List<SettableBeanProperty> props, Set<String> unwrappedPropertyNames, boolean hasUnwrappedAnySetter) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean_collectDeserializerPropertyNames(SettableBeanProperty prop, Set<String> names) Helper method to collect property names from a property's deserializer.private boolean_collectUnwrappedPropertyNames(List<SettableBeanProperty> properties, List<SettableBeanProperty> creatorProperties, Set<String> names) Helper method to collect unwrapped property names.private BeanDeserializerBase_findBeanDeser(ValueDeserializer<?> deser) voidaddCreatorProperty(SettableBeanProperty property) voidaddProperty(SettableBeanProperty property) voidcollectUnwrappedPropertyNamesTo(Set<String> names) Method for collecting property names recognized by unwrapped deserializers.static PropertyNamecreatorParamName(int index) Generates a placeholder name for creator properties that don't have a name, but are marked with `@JsonUnwrapped` annotation.booleanhasUnwrappedProperty(String propName) Method that checks if the given property name belongs to any unwrapped property.Creates a new UnwrappedPropertyHandler with initialized unwrapped property names cache.processUnwrapped(tools.jackson.core.JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) Deprecated.processUnwrapped(tools.jackson.core.JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered, boolean hasUnwrappedContent) Processes unwrapped properties from the buffered token stream.processUnwrappedCreatorProperties(tools.jackson.core.JsonParser originalParser, DeserializationContext ctxt, PropertyValueBuffer values, TokenBuffer buffered) renameAll(DeserializationContext ctxt, NameTransformer transformer) private List<SettableBeanProperty> renameProperties(DeserializationContext ctxt, Collection<SettableBeanProperty> properties, NameTransformer transformer)
-
Field Details
-
JSON_UNWRAPPED_NAME_PREFIX
- Since:
- 2.19
- See Also:
-
_creatorProperties
- Since:
- 2.19
-
_properties
-
_unwrappedPropertyNames
-
_hasUnwrappedAnySetter
protected final boolean _hasUnwrappedAnySetterFlag that indicates if any of the unwrapped value deserializers has an "any setter" (seeJsonAnySetter)- Since:
- 3.1
-
-
Constructor Details
-
UnwrappedPropertyHandler
public UnwrappedPropertyHandler() -
UnwrappedPropertyHandler
protected UnwrappedPropertyHandler(List<SettableBeanProperty> creatorProps, List<SettableBeanProperty> props, Set<String> unwrappedPropertyNames, boolean hasUnwrappedAnySetter)
-
-
Method Details
-
initializeUnwrappedPropertyNames
Creates a new UnwrappedPropertyHandler with initialized unwrapped property names cache.- Since:
- 3.1
-
addCreatorProperty
- Since:
- 2.19
-
addProperty
-
renameAll
-
renameProperties
private List<SettableBeanProperty> renameProperties(DeserializationContext ctxt, Collection<SettableBeanProperty> properties, NameTransformer transformer) -
processUnwrappedCreatorProperties
public PropertyValueBuffer processUnwrappedCreatorProperties(tools.jackson.core.JsonParser originalParser, DeserializationContext ctxt, PropertyValueBuffer values, TokenBuffer buffered) - Since:
- 2.19
-
processUnwrapped
public Object processUnwrapped(tools.jackson.core.JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered, boolean hasUnwrappedContent) Processes unwrapped properties from the buffered token stream.- Parameters:
originalParser- Parser from which input was originally readctxt- Deserialization contextbean- the target value objectbuffered- the token buffer containing the JSON tokens to deserialize- Returns:
- the bean with unwrapped properties set
- Since:
- 3.1
-
processUnwrapped
@Deprecated public Object processUnwrapped(tools.jackson.core.JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) Deprecated. -
creatorParamName
Generates a placeholder name for creator properties that don't have a name, but are marked with `@JsonUnwrapped` annotation.- Since:
- 2.19
-
hasUnwrappedProperty
Method that checks if the given property name belongs to any unwrapped property.- Parameters:
propName- Property name to check- Returns:
trueif name is recognized by an unwrapped deserializer (or if any of them has "any setter")- Since:
- 3.1
-
collectUnwrappedPropertyNamesTo
-
_collectUnwrappedPropertyNames
private boolean _collectUnwrappedPropertyNames(List<SettableBeanProperty> properties, List<SettableBeanProperty> creatorProperties, Set<String> names) Helper method to collect unwrapped property names.- Returns:
trueif any property deserializer has AnySetter.- Since:
- 3.1
-
_collectDeserializerPropertyNames
Helper method to collect property names from a property's deserializer.- Returns:
trueif the property deserializer has AnySetter.- Since:
- 3.1
-
_findBeanDeser
-
processUnwrapped(JsonParser, DeserializationContext, Object, TokenBuffer, boolean)