Package co.elastic.clients.json
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class co.elastic.clients.json.JsonpMapperBase
JsonpMapperBase.JsonpSerializableSerializer<T extends JsonpSerializable>, JsonpMapperBase.JsonpValueSerializer -
Field Summary
Fields Modifier and Type Field Description static SimpleJsonpMapperINSTANCEstatic SimpleJsonpMapperINSTANCE_REJECT_UNKNOWN_FIELDS -
Constructor Summary
Constructors Constructor Description SimpleJsonpMapper()SimpleJsonpMapper(boolean ignoreUnknownFields) -
Method Summary
Modifier and Type Method Description protected <T> JsonpDeserializer<T>getDefaultDeserializer(java.lang.Class<T> clazz)Get a serializer when none of the builtin ones are applicableprotected <T> JsonpSerializer<T>getDefaultSerializer(T value)booleanignoreUnknownFields()Should object parsers in the API client be lenient and silently ignore unknown fields?jakarta.json.spi.JsonProviderjsonProvider()Return the JSON-P provider, to create JSON parsers and generators.<T> voidserialize(T value, jakarta.json.stream.JsonGenerator generator)Serialize an object.<T> JsonpMapperwithAttribute(java.lang.String name, T value)Create a new mapper with an additional attribute.Methods inherited from class co.elastic.clients.json.JsonpMapperBase
addAttribute, attribute, deserialize, findDeserializer, findSerializerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface co.elastic.clients.json.JsonpMapper
attribute
-
Field Details
-
INSTANCE
-
INSTANCE_REJECT_UNKNOWN_FIELDS
-
-
Constructor Details
-
SimpleJsonpMapper
public SimpleJsonpMapper(boolean ignoreUnknownFields) -
SimpleJsonpMapper
public SimpleJsonpMapper()
-
-
Method Details
-
withAttribute
Description copied from interface:JsonpMapperCreate a new mapper with an additional attribute.The
JsonpMapperFeaturesclass contains the names of attributes that all implementations ofJsonpMappermust implement.- See Also:
JsonpMapperFeatures
-
ignoreUnknownFields
public boolean ignoreUnknownFields()Description copied from interface:JsonpMapperShould object parsers in the API client be lenient and silently ignore unknown fields?- Returns:
trueby default.
-
jsonProvider
public jakarta.json.spi.JsonProvider jsonProvider()Description copied from interface:JsonpMapperReturn 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:JsonpMapperSerialize an object. -
getDefaultDeserializer
Description copied from class:JsonpMapperBaseGet a serializer when none of the builtin ones are applicable- Specified by:
getDefaultDeserializerin classJsonpMapperBase
-
getDefaultSerializer
-