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

# Class JsonXmlCollectionSerializer<T extends Collection<?>>

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<T>
com.norconex.commons.lang.bean.jackson.JsonXmlCollectionSerializer<T>

Type Parameters:
  `T` - Collection type to be serialized

All Implemented Interfaces:
  `com.fasterxml.jackson.databind.deser.ResolvableDeserializer`, `com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable`, `com.fasterxml.jackson.databind.ser.ContextualSerializer`

public class JsonXmlCollectionSerializer<T extends Collection<?>> extends com.fasterxml.jackson.databind.JsonSerializer<T> implements com.fasterxml.jackson.databind.ser.ContextualSerializer, com.fasterxml.jackson.databind.deser.ResolvableDeserializer
XML collection serializer. Adds support for `JsonXmlCollection` annotation and properly writes self-closing and empty tag pairs. for `null` and empty, respectively.

Since:
  3.0.0
See Also:
  - `JsonXmlCollection`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

  `com.fasterxml.jackson.databind.JsonSerializer.None`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DEFAULT_INNER_NAME`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JsonXmlCollectionSerializer(com.fasterxml.jackson.databind.JsonSerializer<?> defaultSerializer)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `com.fasterxml.jackson.databind.JsonSerializer<?>`
  `createContextual(com.fasterxml.jackson.databind.SerializerProvider prov, com.fasterxml.jackson.databind.BeanProperty property)`
  `void`
  `resolve(com.fasterxml.jackson.databind.DeserializationContext ctxt)`
  `void`
  `serialize(T objects, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider sp)`

  ### Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

  `acceptJsonFormatVisitor, getDelegatee, handledType, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties`

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

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

- ## Field Details

  - ### DEFAULT_INNER_NAME

    public static final String DEFAULT_INNER_NAME
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### JsonXmlCollectionSerializer

    public JsonXmlCollectionSerializer(com.fasterxml.jackson.databind.JsonSerializer<?> defaultSerializer)

- ## Method Details

  - ### createContextual

    public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual(com.fasterxml.jackson.databind.SerializerProvider prov, com.fasterxml.jackson.databind.BeanProperty property) throws com.fasterxml.jackson.databind.JsonMappingException
    Specified by:
      `createContextual` in interface `com.fasterxml.jackson.databind.ser.ContextualSerializer`
    Throws:
      `com.fasterxml.jackson.databind.JsonMappingException`

  - ### resolve

    public void resolve(com.fasterxml.jackson.databind.DeserializationContext ctxt) throws com.fasterxml.jackson.databind.JsonMappingException
    Specified by:
      `resolve` in interface `com.fasterxml.jackson.databind.deser.ResolvableDeserializer`
    Throws:
      `com.fasterxml.jackson.databind.JsonMappingException`

  - ### serialize

    public void serialize(T objects, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider sp) throws IOException
    Specified by:
      `serialize` in class `com.fasterxml.jackson.databind.JsonSerializer<T extends Collection<?>>`
    Throws:
      `IOException`