public interface StructureWriter extends StructureIdentifier
Modifier and Type | Method and Description |
---|---|
void |
beginStructure(java.lang.Appendable writer)
Begin the structure represented by this object, either a JSON Object
or a JSON Array.
|
boolean |
booleanValue(boolean value,
java.lang.Appendable writer)
Write a
boolean value to the given Appendable . |
boolean |
doubleValue(double value,
java.lang.Appendable writer)
Write a
double value to the given Appendable . |
boolean |
endStructure(java.lang.Appendable writer)
End the structure represented by this object, either a JSON Object
or a JSON Array.
|
char |
getStructureType()
Returns the type of this structure as a char value.
|
boolean |
jsonAppendableValue(JSONAppendable value,
java.lang.Appendable writer)
Write a
JSONAppendable value to the given Appendable . |
boolean |
jsonStringValue(JSONString value,
java.lang.Appendable writer)
Write a
JSONString value to the given Appendable . |
void |
key(java.lang.String key,
java.lang.Appendable writer)
Write a key for a JSON Object.
|
boolean |
longValue(long value,
java.lang.Appendable writer)
Write a
long value to the given Appendable . |
boolean |
nullValue(java.lang.Appendable writer)
Write a JSON
null value to the given Appendable . |
boolean |
simpleValue(java.lang.Object value,
java.lang.Appendable writer)
Write a simple value to the given
Appendable . |
void |
subValue(java.lang.Appendable writer)
Indicates that a sub-structure is about to be written.
|
getIdentifier
void beginStructure(java.lang.Appendable writer) throws JSONException
writer
- the Appendable to write any beginning structure contentJSONException
- there was a problem beginning the structurevoid key(java.lang.String key, java.lang.Appendable writer) throws JSONException
key
- the key to be writtenwriter
- the Appendable to write the keyJSONException
- this structure is not a JSON Object, the key is
null
, or there was another problem writing the keyvoid subValue(java.lang.Appendable writer) throws JSONException
writer
- the Appendable to write any delimiters or separatorsJSONException
- there was a problem writing the delimiterboolean simpleValue(java.lang.Object value, java.lang.Appendable writer) throws JSONException
Appendable
.value
- the value to be writtenwriter
- the Appendable to which the JSON value will be writtentrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem writing the valueWriterUtil.isSimpleValue(Object)
boolean jsonStringValue(JSONString value, java.lang.Appendable writer) throws JSONException
JSONString
value to the given Appendable
.value
- the value to be writtenwriter
- the Appendable to which the JSON value will be writtentrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem writing the valueboolean jsonAppendableValue(JSONAppendable value, java.lang.Appendable writer) throws JSONException
JSONAppendable
value to the given Appendable
.value
- the value to be writtenwriter
- the Appendable to which the JSON value will be writtentrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem writing the valueboolean nullValue(java.lang.Appendable writer) throws JSONException
null
value to the given Appendable
.writer
- the Appendable to which the JSON value will be writtentrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem writing the valueboolean booleanValue(boolean value, java.lang.Appendable writer) throws JSONException
boolean
value to the given Appendable
.value
- the value to be writtenwriter
- the Appendable to which the JSON value will be writtentrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem writing the valueboolean doubleValue(double value, java.lang.Appendable writer) throws JSONException
double
value to the given Appendable
.value
- the value to be writtenwriter
- the Appendable to which the JSON value will be writtentrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem writing the valueboolean longValue(long value, java.lang.Appendable writer) throws JSONException
long
value to the given Appendable
.value
- the value to be writtenwriter
- the Appendable to which the JSON value will be writtentrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem writing the valueboolean endStructure(java.lang.Appendable writer) throws JSONException
writer
- the Appendable to write any end structure contenttrue
to indicate JSON writing has been completed, and
no more content may be written, otherwise false
to indicate
more JSON data may be writtenJSONException
- there was a problem ending the structurechar getStructureType()
'i'
— the initial structure, before any JSON Object or
JSON Array has been written'o'
— a JSON Object'a'
— a JSON Array