Class SimpleJsonpMapper

java.lang.Object
co.elastic.clients.json.JsonpMapperBase
co.elastic.clients.json.SimpleJsonpMapper
All Implemented Interfaces:
JsonpMapper

public class SimpleJsonpMapper
extends JsonpMapperBase
A simple implementation of JsonpMapper that only handles classes of the Java API client.

To handle application classes serialization and deserialization, consider using JacksonJsonpMapper or JsonbJsonpMapper.

  • Field Details

  • Constructor Details

    • SimpleJsonpMapper

      public SimpleJsonpMapper​(boolean ignoreUnknownFields)
    • SimpleJsonpMapper

      public SimpleJsonpMapper()
  • Method Details

    • withAttribute

      public <T> JsonpMapper withAttribute​(java.lang.String name, T value)
      Description copied from interface: JsonpMapper
      Create a new mapper with an additional attribute.

      The JsonpMapperFeatures class contains the names of attributes that all implementations of JsonpMapper must implement.

      See Also:
      JsonpMapperFeatures
    • ignoreUnknownFields

      public boolean ignoreUnknownFields()
      Description copied from interface: JsonpMapper
      Should object parsers in the API client be lenient and silently ignore unknown fields?
      Returns:
      true by default.
    • jsonProvider

      public jakarta.json.spi.JsonProvider jsonProvider()
      Description copied from interface: JsonpMapper
      Return the JSON-P provider, to create JSON parsers and generators.
    • serialize

      public <T> void serialize​(T value, jakarta.json.stream.JsonGenerator generator)
      Description copied from interface: JsonpMapper
      Serialize an object.
    • getDefaultDeserializer

      protected <T> JsonpDeserializer<T> getDefaultDeserializer​(java.lang.Class<T> clazz)
      Description copied from class: JsonpMapperBase
      Get a serializer when none of the builtin ones are applicable
      Specified by:
      getDefaultDeserializer in class JsonpMapperBase
    • getDefaultSerializer

      protected <T> JsonpSerializer<T> getDefaultSerializer​(T value)