public class JSONFactoryHandler<P,O extends java.util.Map<java.lang.String,P>,A extends java.util.List<P>> extends java.lang.Object implements JSONHandler
| Constructor and Description |
|---|
JSONFactoryHandler(JSONFactory<P,O,A> factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginArray()
Start of an array
|
void |
beginObject()
Start of an object
|
void |
clear()
Clear any stored info, i.e.
|
boolean |
hasElement()
Check whether a JSON element is available
|
P |
pop()
Pops a parsed element
|
void |
yieldArray()
End of an array
|
void |
yieldFalse()
Handle a 'false' boolean
|
void |
yieldGarbage(java.lang.String str)
Attempt to detect if garbage is actually a missing data:
|
void |
yieldKey()
Key has been defined (likely through yieldString()).
|
void |
yieldNull()
Handle a 'null' value
|
void |
yieldNumber(double v)
Handle a numeric value
|
void |
yieldObject()
End of an object
|
void |
yieldSeparator()
End of an object member or array element, marked by a comma
|
void |
yieldString(java.lang.String str)
Handle a String value.
|
void |
yieldTrue()
Handle a 'true' boolean
|
public JSONFactoryHandler(JSONFactory<P,O,A> factory)
public void beginObject()
JSONHandlerbeginObject in interface JSONHandlerpublic void yieldObject()
JSONHandleryieldObject in interface JSONHandlerpublic void yieldKey()
JSONHandleryieldKey in interface JSONHandlerpublic void yieldSeparator()
JSONHandleryieldSeparator in interface JSONHandlerpublic void beginArray()
JSONHandlerbeginArray in interface JSONHandlerpublic void yieldArray()
JSONHandleryieldArray in interface JSONHandlerpublic void yieldString(java.lang.String str)
JSONHandleryieldString in interface JSONHandlerstr - stringpublic void yieldNumber(double v)
JSONHandleryieldNumber in interface JSONHandlerv - numberpublic void yieldTrue()
JSONHandleryieldTrue in interface JSONHandlerpublic void yieldFalse()
JSONHandleryieldFalse in interface JSONHandlerpublic void yieldNull()
JSONHandleryieldNull in interface JSONHandlerpublic void yieldGarbage(java.lang.String str)
If we are currently parsing an object
Check the key has been defined
If not, set the key
Otherwise, check if the value is defined
If not, set the value
Otherwise, ignore
If we are currently parsing an Array
Check the element has been defined
If not, set the element
Otherwise, ignore
yieldGarbage in interface JSONHandlerstr - garbage stringpublic boolean hasElement()
JSONHandlerhasElement in interface JSONHandlerpublic void clear()
JSONHandlerclear in interface JSONHandlerpublic P pop()
pop in interface JSONHandler