public abstract static class SimpleJsonReader.PickyObjectHandler extends SimpleJsonReader.ObjectHandler
Deriving your object handler from this class is useful in cases where you expect only values of a few certain types.
SimpleJsonReader.ObjectHandler| Constructor and Description |
|---|
PickyObjectHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected SimpleJsonReader.TemporaryHandler |
arrayValue(java.lang.String key)
Called when a key with the beginning of an array value
was read.
|
protected void |
nullValue(java.lang.String key)
Called when a null value was read.
|
protected SimpleJsonReader.TemporaryHandler |
objectValue(java.lang.String key)
Called when a key with the beginning of an object value
was read.
|
protected void |
throwException(java.lang.String key,
Json.ValueType valueType)
Method for throwing an
IllegalStateException. |
protected void |
value(java.lang.String key,
boolean v)
Called when a boolean value was read.
|
protected void |
value(java.lang.String key,
java.lang.Number v)
Called when a number value was read.
|
protected void |
value(java.lang.String key,
java.lang.String v)
Called when a text value was read.
|
beginArray, beginObject, endArray, endObject, key, nullValue, value, value, valueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfinish, initializeprotected void throwException(@NotNull java.lang.String key, @NotNull Json.ValueType valueType)
IllegalStateException.key - unexpected key, or key which received a wrong value typevalueType - expected value typejava.lang.IllegalStateException - always@NotNull protected SimpleJsonReader.TemporaryHandler objectValue(@NotNull java.lang.String key)
SimpleJsonReader.ObjectHandlerSimpleJsonReader.TemporaryHandler.initialize(SimpleJsonReader)
method, then be used to handle the key-value pairs inside
the object. When the object is finished, the handler's
SimpleJsonReader.TemporaryHandler.finish(SimpleJsonReader) method
is called.
If the key is unsupported either throw an exception
or return SimpleJsonReader.SKIP_HANDLER which will ignore
the object.
objectValue in class SimpleJsonReader.ObjectHandlerkey - key for which the object is readSimpleJsonReader.ObjectHandler@NotNull protected SimpleJsonReader.TemporaryHandler arrayValue(@NotNull java.lang.String key)
SimpleJsonReader.ObjectHandlerSimpleJsonReader.TemporaryHandler.initialize(SimpleJsonReader)
method, then be used to handle the key-value pairs inside
the object. When the object is finished, the handler's
SimpleJsonReader.TemporaryHandler.finish(SimpleJsonReader) method
is called.
If the key is unsupported either throw an exception
or return SimpleJsonReader.SKIP_HANDLER which will ignore
the object.
arrayValue in class SimpleJsonReader.ObjectHandlerkey - key for which the object is readSimpleJsonReader.ArrayHandlerprotected void nullValue(@NotNull java.lang.String key)
SimpleJsonReader.ObjectHandlernullValue in class SimpleJsonReader.ObjectHandlerkey - key for which the null was readprotected void value(@NotNull java.lang.String key, @NotNull java.lang.String v)
SimpleJsonReader.ObjectHandlervalue in class SimpleJsonReader.ObjectHandlerkey - key for which the text value was readv - text valueprotected void value(@NotNull java.lang.String key, boolean v)
SimpleJsonReader.ObjectHandlervalue in class SimpleJsonReader.ObjectHandlerkey - key for which the boolean value was readv - boolean valueprotected void value(@NotNull java.lang.String key, @NotNull java.lang.Number v)
SimpleJsonReader.ObjectHandlervalue in class SimpleJsonReader.ObjectHandlerkey - key for which the number value was readv - number value, implementation will provide either
an Integer (if fit), or a Double