public final class NullStructureWriter extends java.lang.Object implements StructureWriter
| Modifier and Type | Method and Description |
|---|---|
void |
beginStructure(java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a structure itself. |
boolean |
booleanValue(boolean value,
java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a value. |
boolean |
doubleValue(double value,
java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a value. |
boolean |
endStructure(java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
an end structure. |
java.lang.String |
getIdentifier()
Returns
null for no identifier. |
static NullStructureWriter |
getInstance()
Factory method for
NullStructureWriter. |
char |
getStructureType()
Returns
'i' to indicate the initial structure. |
boolean |
jsonAppendableValue(JSONAppendable value,
java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a value. |
boolean |
jsonStringValue(JSONString value,
java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a value. |
void |
key(java.lang.String key,
java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a key. |
boolean |
longValue(long value,
java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a value. |
boolean |
nullValue(java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a value. |
boolean |
simpleValue(java.lang.Object value,
java.lang.Appendable writer)
Throws a
JSONException to indicate this writer can't write
a value. |
void |
subValue(java.lang.Appendable writer)
This method does nothing itself, but allows a sub-structure to be
written.
|
public static NullStructureWriter getInstance()
NullStructureWriter. Returns a singleton
instance.NullStructureWriterpublic void beginStructure(java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
a structure itself.beginStructure in interface StructureWriterwriter - the Appendable to write any beginning structure contentJSONException - no structure can be written by this writerpublic void key(java.lang.String key,
java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
a key.key in interface StructureWriterkey - the key to be writtenwriter - the Appendable to write the keyJSONException - no key can be written by this writerpublic void subValue(java.lang.Appendable writer)
subValue in interface StructureWriterwriter - the Appendable to write any delimiters or separatorspublic boolean simpleValue(java.lang.Object value,
java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
a value.simpleValue in interface StructureWritervalue - 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 - a value cannot be written by this writerWriterUtil.isSimpleValue(Object)public boolean jsonStringValue(JSONString value, java.lang.Appendable writer) throws JSONException
JSONException to indicate this writer can't write
a value.jsonStringValue in interface StructureWritervalue - 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 - a value cannot be written by this writerpublic boolean jsonAppendableValue(JSONAppendable value, java.lang.Appendable writer) throws JSONException
JSONException to indicate this writer can't write
a value.jsonAppendableValue in interface StructureWritervalue - 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 - a value cannot be written by this writerpublic boolean nullValue(java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
a value.nullValue in interface StructureWriterwriter - 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 - a value cannot be written by this writerpublic boolean booleanValue(boolean value,
java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
a value.booleanValue in interface StructureWritervalue - 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 - a value cannot be written by this writerpublic boolean doubleValue(double value,
java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
a value.doubleValue in interface StructureWritervalue - 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 - a value cannot be written by this writerpublic boolean longValue(long value,
java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
a value.longValue in interface StructureWritervalue - 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 - a value cannot be written by this writerpublic boolean endStructure(java.lang.Appendable writer)
throws JSONException
JSONException to indicate this writer can't write
an end structure.endStructure in interface StructureWriterwriter - 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 - no end structure can be written by this writerpublic java.lang.String getIdentifier()
null for no identifier.getIdentifier in interface StructureIdentifiernullJSONPointerUtils.toJSONPointer(Iterable)public char getStructureType()
'i' to indicate the initial structure.getStructureType in interface StructureWriter