Class JSONNull
java.lang.Object
net.sf.json.JSONNull
- All Implemented Interfaces:
Serializable, JSON
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanA Null object is equal to the null value and to itself.static JSONNullReturns the singleton instance of JSONNullinthashCode()booleanisArray()Returns true if this object is a JSONArray, false otherwise.booleanisEmpty()Returns true if this object has no elements or keys.intsize()Returns the number of properties in an object or the size of the array.toString()Get the "null" string value.toString(int indentFactor) Make a prettyprinted JSON text.toString(int indentFactor, int indent) Make a prettyprinted JSON text.Write the contents as JSON text to a writer.Writes the canonicalized form of this JSON object.
-
Field Details
-
instance
singleton instance
-
-
Constructor Details
-
JSONNull
private JSONNull()
-
-
Method Details
-
getInstance
Returns the singleton instance of JSONNull -
equals
-
hashCode
-
isArray
-
isEmpty
-
size
-
toString
-
toString
Description copied from interface:JSONMake a prettyprinted JSON text. Warning: This method assumes that the data structure is acyclical. -
toString
Description copied from interface:JSONMake a prettyprinted JSON text. Warning: This method assumes that the data structure is acyclical.- Specified by:
toStringin interfaceJSON- Parameters:
indentFactor- The number of spaces to add to each level of indentation.indent- The indentation of the top level.- Returns:
- a printable, displayable, transmittable representation of the
object, beginning with
{(left brace) and ending with}(right brace).
-
write
Description copied from interface:JSONWrite the contents as JSON text to a writer. For compactness, no whitespace is added. Warning: This method assumes that the data structure is acyclical.- Specified by:
writein interfaceJSON- Returns:
- The writer.
- Throws:
IOException
-
writeCanonical
Description copied from interface:JSONWrites the canonicalized form of this JSON object.- Specified by:
writeCanonicalin interfaceJSON- Throws:
IOException
-