|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.json.JSONNull
public final class JSONNull
JSONNull is equivalent to the value that JavaScript calls null, whilst Java's null is equivalent to the value that JavaScript calls undefined.
Method Summary | |
---|---|
boolean |
equals(java.lang.Object object)
A Null object is equal to the null value and to itself. |
static JSONNull |
getInstance()
Returns the singleton instance of JSONNull |
int |
hashCode()
|
boolean |
isArray()
Returns true if this object is a JSONArray, false otherwise. |
boolean |
isEmpty()
Returns true if this object has no elements or keys. |
int |
size()
Returns the number of properties in an object or the size of the array. |
java.lang.String |
toString()
Get the "null" string value. |
java.lang.String |
toString(int indentFactor)
Make a prettyprinted JSON text. |
java.lang.String |
toString(int indentFactor,
int indent)
Make a prettyprinted JSON text. |
java.io.Writer |
write(java.io.Writer writer)
Write the contents as JSON text to a writer. |
java.io.Writer |
writeCanonical(java.io.Writer w)
Writes the canonicalized form of this JSON object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static JSONNull getInstance()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- An object to test for nullness.
public int hashCode()
hashCode
in class java.lang.Object
public boolean isArray()
JSON
isArray
in interface JSON
public boolean isEmpty()
JSON
isEmpty
in interface JSON
public int size()
JSON
size
in interface JSON
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int indentFactor)
JSON
Warning: This method assumes that the data structure is acyclical.
toString
in interface JSON
indentFactor
- The number of spaces to add to each level of
indentation.
{
(left
brace) and ending with }
(right
brace).public java.lang.String toString(int indentFactor, int indent)
JSON
Warning: This method assumes that the data structure is acyclical.
toString
in interface JSON
indentFactor
- The number of spaces to add to each level of
indentation.indent
- The indentation of the top level.
{
(left brace)
and ending with }
(right brace).public java.io.Writer write(java.io.Writer writer) throws java.io.IOException
JSON
Warning: This method assumes that the data structure is acyclical.
write
in interface JSON
java.io.IOException
public java.io.Writer writeCanonical(java.io.Writer w) throws java.io.IOException
JSON
writeCanonical
in interface JSON
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |