T
- the type that is yielded by the parserpublic interface JSONBuilder<T>
Modifier and Type | Method and Description |
---|---|
void |
addBoolean(boolean value)
This method should be invoked when the parser consumes a
JSON expression 'true' or 'false'.
|
void |
addFloat(double value)
This method should be invoked when the parser consumes a
JSON floating point value.
|
void |
addInteger(java.math.BigInteger num)
This method should preferably be invoked when the parser consumes
a JSON integer value that is too large to fit in a long.
|
void |
addInteger(long value)
This method should be invoked when the parser consumes a
JSON integer value.
|
void |
addNull()
This method should be invoked when the parser consumes a
JSON expression 'null'.
|
void |
addString(java.lang.String value)
This method should be invoked when the parser consumes a
JSON string.
|
T |
build()
This method will return a value representing the JSON tree
consumed so far by the parser.
|
void |
endArray()
This method should be invoked when the parser consumes the
end of an array i.e.
|
void |
endObject()
This method should be invoked when the parser consumes the
end of an object i.e.
|
void |
field(java.lang.String field)
This method should be invoked when the parser consumes the
field name of an object ahead of a ':'.
|
void |
startArray()
This method should be invoked when the parser consumes the
start of an array i.e.
|
void |
startObject()
This method should be invoked when the parser consumes the
start of an object i.e.
|
void addNull()
void addBoolean(boolean value)
value
- true if the expression was 'true', else false.void addInteger(long value)
value
- the integer value as a signed 64-bit integer.void addInteger(java.math.BigInteger num)
num
- the value as a big-integervoid addFloat(double value)
value
- the floating point valuevoid addString(java.lang.String value)
value
- the stringvoid startArray()
void endArray()
void field(java.lang.String field)
field
- name of the fieldvoid startObject()
void endObject()
T build() throws JSONBuildFailedException
JSONBuildFailedException
.JSONBuildFailedException