Class JSONString

java.lang.Object
com.google.gwt.json.client.JSONValue
com.google.gwt.json.client.JSONString

public class JSONString extends JSONValue
Represents a JSON string.
  • Constructor Details

    • JSONString

      public JSONString(String value)
      Creates a new JSONString from the supplied String.
      Parameters:
      value - a String value
      Throws:
      NullPointerException - if value is null
  • Method Details

    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isString

      public JSONString isString()
      Returns this, as this is a JSONString.
      Overrides:
      isString in class JSONValue
      Returns:
      a reference to a JSONString if this JSONValue is a JSONString or null otherwise.
    • stringValue

      public String stringValue()
      Returns the raw Java string value of this item.
    • toString

      public String toString()
      Returns the JSON formatted value of this string, quoted for evaluating in a JavaScript interpreter.
      Specified by:
      toString in class JSONValue
    • getUnwrapper

      JavaScriptObject getUnwrapper()
      Description copied from class: JSONValue
      Internal. Returns a JS func that can unwrap this value. Used from native code.
      Specified by:
      getUnwrapper in class JSONValue