Package com.norconex.commons.lang.bean.jackson

# Class JsonXmlCollectionDeserializer<T extends Collection<?>>

java.lang.Object
tools.jackson.databind.ValueDeserializer<T>
com.norconex.commons.lang.bean.jackson.JsonXmlCollectionDeserializer<T>

Type Parameters:
  `T` - type of collection

All Implemented Interfaces:
  `tools.jackson.databind.deser.NullValueProvider`

public class JsonXmlCollectionDeserializer<T extends Collection<?>> extends tools.jackson.databind.ValueDeserializer<T>

XML collection deserializer. Adds support for the `JsonXmlCollection` annotation and reads collections back regardless of how the XML mapper surfaces repeated child elements.

Registered through the `JsonXmlCollectionModule` deserializer modifier for regular bean collection properties, and through `@JsonDeserialize` (on the collection type or carried by `JsonXmlCollection`) for collection properties of `@JsonUnwrapped` beans (such as `Configurable` configuration objects), which Jackson resolves through a path that bypasses deserializer modifiers.

The XML mapper presents the collection as a wrapper object holding the entries. Depending on the entry kind, repeated elements appear either as a JSON array (typically for object entries) or as repeated property names (typically for scalar entries); a single entry appears as a lone value. All of these shapes are handled here, as is the plain `START_ARRAY` used by JSON and YAML.

Since:
  3.0.0
See Also:
  - `JsonXmlCollection`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class tools.jackson.databind.ValueDeserializer

  `tools.jackson.databind.ValueDeserializer.None`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JsonXmlCollectionDeserializer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `tools.jackson.databind.ValueDeserializer<?>`
  `createContextual(tools.jackson.databind.DeserializationContext ctx, tools.jackson.databind.BeanProperty property)`
  `T`
  `deserialize(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctx)`

  ### Methods inherited from class tools.jackson.databind.ValueDeserializer

  `collectAllPropertyNamesTo, deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getObjectIdReader, handledType, hasAnySetter, isCachable, logicalType, replaceDelegatee, resolve, supportsUpdate, unwrappingDeserializer`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JsonXmlCollectionDeserializer

    public JsonXmlCollectionDeserializer()

- ## Method Details

  - ### createContextual

    public tools.jackson.databind.ValueDeserializer<?> createContextual(tools.jackson.databind.DeserializationContext ctx, tools.jackson.databind.BeanProperty property)
    Overrides:
      `createContextual` in class `tools.jackson.databind.ValueDeserializer<T extends Collection<?>>`

  - ### deserialize

    public T deserialize(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctx)
    Specified by:
      `deserialize` in class `tools.jackson.databind.ValueDeserializer<T extends Collection<?>>`