public abstract static class SimpleJsonReader.PickyArrayHandler extends SimpleJsonReader.ArrayHandler
Deriving your array handler from this class is useful in cases where you expect only values of a few certain types.
SimpleJsonReader.ObjectHandler| Constructor and Description |
|---|
PickyArrayHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected SimpleJsonReader.TemporaryHandler |
arrayElement(int index)
Called when the beginning of an array sub-element
was read.
|
protected void |
element(int index,
boolean v)
Called when a boolean element was read.
|
protected void |
element(int index,
java.lang.Number v)
Called when a number value was read.
|
protected void |
element(int index,
java.lang.String v)
Called when a text element was read.
|
protected void |
nullElement(int index)
Called when a null element was read.
|
protected SimpleJsonReader.TemporaryHandler |
objectElement(int index)
Called when the beginning of an object element
was read.
|
protected void |
throwException(Json.ValueType valueType)
Method for throwing an
IllegalStateException. |
beginArray, beginObject, endArray, endObject, key, nullValue, value, value, valueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfinish, initializeprotected void throwException(@NotNull Json.ValueType valueType)
IllegalStateException.valueType - expected value typejava.lang.IllegalStateException - always@NotNull protected SimpleJsonReader.TemporaryHandler objectElement(int index)
SimpleJsonReader.ArrayHandlerSimpleJsonReader.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.
objectElement in class SimpleJsonReader.ArrayHandlerindex - index of the array element which is readSimpleJsonReader.ObjectHandler@NotNull protected SimpleJsonReader.TemporaryHandler arrayElement(int index)
SimpleJsonReader.ArrayHandlerSimpleJsonReader.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.
arrayElement in class SimpleJsonReader.ArrayHandlerindex - index of the array element which is readSimpleJsonReader.ArrayHandlerprotected void nullElement(int index)
SimpleJsonReader.ArrayHandlernullElement in class SimpleJsonReader.ArrayHandlerindex - index of the array element which is readprotected void element(int index,
@NotNull
java.lang.String v)
SimpleJsonReader.ArrayHandlerelement in class SimpleJsonReader.ArrayHandlerindex - index of the array element which is readv - text valueprotected void element(int index,
boolean v)
SimpleJsonReader.ArrayHandlerelement in class SimpleJsonReader.ArrayHandlerindex - index of the array element which is readv - boolean valueprotected void element(int index,
@NotNull
java.lang.Number v)
SimpleJsonReader.ArrayHandlerelement in class SimpleJsonReader.ArrayHandlerindex - index of the array element which is readv - number value, implementation will provide either
an Integer (if fit), or a Double