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()
JSONHandler
beginObject
in interface JSONHandler
public void yieldObject()
JSONHandler
yieldObject
in interface JSONHandler
public void yieldKey()
JSONHandler
yieldKey
in interface JSONHandler
public void yieldSeparator()
JSONHandler
yieldSeparator
in interface JSONHandler
public void beginArray()
JSONHandler
beginArray
in interface JSONHandler
public void yieldArray()
JSONHandler
yieldArray
in interface JSONHandler
public void yieldString(java.lang.String str)
JSONHandler
yieldString
in interface JSONHandler
str
- stringpublic void yieldNumber(double v)
JSONHandler
yieldNumber
in interface JSONHandler
v
- numberpublic void yieldTrue()
JSONHandler
yieldTrue
in interface JSONHandler
public void yieldFalse()
JSONHandler
yieldFalse
in interface JSONHandler
public void yieldNull()
JSONHandler
yieldNull
in interface JSONHandler
public 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 JSONHandler
str
- garbage stringpublic boolean hasElement()
JSONHandler
hasElement
in interface JSONHandler
public void clear()
JSONHandler
clear
in interface JSONHandler
public P pop()
pop
in interface JSONHandler