程序包 com.sh.json

类 JSONNull

java.lang.Object
com.sh.json.JSONNull
所有已实现的接口:
JSON, Serializable

public final class JSONNull extends Object implements JSON
JSONNull is equivalent to the value that JavaScript calls null, whilst Java's null is equivalent to the value that JavaScript calls undefined.
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    equals(Object object)
    A Null object is equal to the null value and to itself.
    static JSONNull
    Returns the singleton instance of JSONNull
    int
     
    boolean
    Returns true if this object is a JSONArray, false otherwise.
    boolean
    Returns true if this object has no elements or keys.
    int
    Returns the number of properties in an object or the size of the array.
    Get the "null" string value.
    toString(int indentFactor)
    Make a prettyprinted JSON text.
    toString(int indentFactor, int indent)
    Make a prettyprinted JSON text.
    write(Writer writer)
    Write the contents as JSON text to a writer.

    从类继承的方法 java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 方法详细资料

    • getInstance

      public static JSONNull getInstance()
      Returns the singleton instance of JSONNull
    • equals

      public boolean equals(Object object)
      A Null object is equal to the null value and to itself.
      覆盖:
      equals 在类中 Object
      参数:
      object - An object to test for nullness.
      返回:
      true if the object parameter is the JSONObject.NULL object or null.
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • isArray

      public boolean isArray()
      从接口复制的说明: JSON
      Returns true if this object is a JSONArray, false otherwise.
      指定者:
      isArray 在接口中 JSON
    • isEmpty

      public boolean isEmpty()
      从接口复制的说明: JSON
      Returns true if this object has no elements or keys.
      指定者:
      isEmpty 在接口中 JSON
    • size

      public int size()
      从接口复制的说明: JSON
      Returns the number of properties in an object or the size of the array.
      指定者:
      size 在接口中 JSON
      返回:
      the size of an json object or array
    • toString

      public String toString()
      Get the "null" string value.
      覆盖:
      toString 在类中 Object
      返回:
      The string "null".
    • toString

      public String toString(int indentFactor)
      从接口复制的说明: JSON
      Make a prettyprinted JSON text.

      Warning: This method assumes that the data structure is acyclical.

      指定者:
      toString 在接口中 JSON
      参数:
      indentFactor - The number of spaces to add to each level of indentation.
      返回:
      a printable, displayable, portable, transmittable representation of the object, beginning with { (left brace) and ending with } (right brace).
    • toString

      public String toString(int indentFactor, int indent)
      从接口复制的说明: JSON
      Make a prettyprinted JSON text.

      Warning: This method assumes that the data structure is acyclical.

      指定者:
      toString 在接口中 JSON
      参数:
      indentFactor - The number of spaces to add to each level of indentation.
      indent - The indentation of the top level.
      返回:
      a printable, displayable, transmittable representation of the object, beginning with { (left brace) and ending with } (right brace).
    • write

      public Writer write(Writer writer)
      从接口复制的说明: JSON
      Write the contents as JSON text to a writer. For compactness, no whitespace is added.

      Warning: This method assumes that the data structure is acyclical.

      指定者:
      write 在接口中 JSON
      返回:
      The writer.