Class UnwrappedPropertyHandler

java.lang.Object
tools.jackson.databind.deser.impl.UnwrappedPropertyHandler

public class UnwrappedPropertyHandler extends Object
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 Details

    • JSON_UNWRAPPED_NAME_PREFIX

      public static final String JSON_UNWRAPPED_NAME_PREFIX
      Since:
      2.19
      See Also:
    • _creatorProperties

      protected final List<SettableBeanProperty> _creatorProperties
      Since:
      2.19
    • _properties

      protected final List<SettableBeanProperty> _properties
    • _unwrappedPropertyNames

      protected final Set<String> _unwrappedPropertyNames
      Set of all unwrapped property names from unwrapped deserializers.
      Since:
      3.1
    • _hasUnwrappedAnySetter

      protected final boolean _hasUnwrappedAnySetter
      Flag that indicates if any of the unwrapped value deserializers has an "any setter" (see JsonAnySetter)
      Since:
      3.1
  • Constructor Details

  • Method Details

    • initializeUnwrappedPropertyNames

      public UnwrappedPropertyHandler initializeUnwrappedPropertyNames()
      Creates a new UnwrappedPropertyHandler with initialized unwrapped property names cache.
      Since:
      3.1
    • addCreatorProperty

      public void addCreatorProperty(SettableBeanProperty property)
      Since:
      2.19
    • addProperty

      public void addProperty(SettableBeanProperty property)
    • renameAll

      public UnwrappedPropertyHandler renameAll(DeserializationContext ctxt, 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 read
      ctxt - Deserialization context
      bean - the target value object
      buffered - 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)
    • creatorParamName

      public static PropertyName creatorParamName(int index)
      Generates a placeholder name for creator properties that don't have a name, but are marked with `@JsonUnwrapped` annotation.
      Since:
      2.19
    • hasUnwrappedProperty

      public boolean hasUnwrappedProperty(String propName)
      Method that checks if the given property name belongs to any unwrapped property.
      Parameters:
      propName - Property name to check
      Returns:
      true if name is recognized by an unwrapped deserializer (or if any of them has "any setter")
      Since:
      3.1
    • collectUnwrappedPropertyNamesTo

      public void collectUnwrappedPropertyNamesTo(Set<String> names)
      Method for collecting property names recognized by unwrapped deserializers.
      Since:
      3.1