Package org.opensearch.client.json
Interface JsonpMapper
- All Known Implementing Classes:
JacksonJsonpMapper,JsonbJsonpMapper,JsonpMapperBase
public interface JsonpMapper
A
JsonpMapper combines a JSON-P provider and object serialization/deserialization based on JSON-P events.-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TGet a named attribute associated to this mapper.default <T> TGet a named attribute associated to this mapper, with a default value.<T> Tdeserialize(jakarta.json.stream.JsonParser parser, Class<T> clazz) Deserialize an object, given its class.default booleanShould object parsers in the API client be lenient and silently ignore unknown fields?jakarta.json.spi.JsonProviderReturn the JSON-P provider, to create JSON parsers and generators.<T> voidserialize(T value, jakarta.json.stream.JsonGenerator generator) Serialize an object.default <T> JsonpMapperwithAttribute(String name, T value) Create a new mapper with a named attribute that delegates to this one.
-
Method Details
-
jsonProvider
jakarta.json.spi.JsonProvider jsonProvider()Return the JSON-P provider, to create JSON parsers and generators. -
deserialize
Deserialize an object, given its class. -
serialize
<T> void serialize(T value, jakarta.json.stream.JsonGenerator generator) Serialize an object. -
ignoreUnknownFields
default boolean ignoreUnknownFields()Should object parsers in the API client be lenient and silently ignore unknown fields?- Returns:
trueby default.
-
attribute
Get a named attribute associated to this mapper. -
attribute
Get a named attribute associated to this mapper, with a default value. -
withAttribute
Create a new mapper with a named attribute that delegates to this one.- Implementation Note:
- The default implementation will be removed in a future release, and inheritors will be required to implement it themselves.
See
JsonbJsonpMapper.withAttribute(String, Object)andJacksonJsonpMapper.withAttribute(String, Object)for examples.
-