Class CustomizeJsonParser (1.43.1)

public class CustomizeJsonParser

Beta
Customizes the behavior of a JSON parser.

All methods have a default trivial implementation, so subclasses need only implement the methods whose behavior needs customization.

Implementation has no fields and therefore thread-safe, but sub-classes are not necessarily thread-safe.

Inheritance

Object > CustomizeJsonParser

Constructors

CustomizeJsonParser()

public CustomizeJsonParser()

Methods

handleUnrecognizedKey(Object context, String key)

public void handleUnrecognizedKey(Object context, String key)

Called when the given unrecognized key is encountered in the given context object.

Parameters
NameDescription
contextObject
keyString

newInstanceForArray(Object context, Field field)

public Collection<Object> newInstanceForArray(Object context, Field field)

Returns a new instance value for the given field in the given context object for a JSON array or null for the default behavior.

Parameters
NameDescription
contextObject
fieldField
Returns
TypeDescription
Collection<Object>

newInstanceForObject(Object context, Class<?> fieldClass)

public Object newInstanceForObject(Object context, Class<?> fieldClass)

Returns a new instance value for the given field class in the given context object for JSON Object or null for the default behavior.

Parameters
NameDescription
contextObject
fieldClassClass<?>
Returns
TypeDescription
Object

stopAt(Object context, String key)

public boolean stopAt(Object context, String key)

Returns whether to stop parsing at the given key of the given context object.

Parameters
NameDescription
contextObject
keyString
Returns
TypeDescription
boolean