org.opengts.util
Class JSON._Value

java.lang.Object
  extended by org.opengts.util.JSON._Value
Enclosing class:
JSON

public static class JSON._Value
extends java.lang.Object

JSON Value


Constructor Summary
JSON._Value()
          Constructor
JSON._Value(boolean v)
          Constructor
JSON._Value(java.lang.Boolean v)
          Constructor
JSON._Value(double v)
          Constructor
JSON._Value(java.lang.Double v)
          Constructor
JSON._Value(int v)
          Constructor
JSON._Value(java.lang.Integer v)
          Constructor
JSON._Value(JSON._Array v)
          Constructor
JSON._Value(JSON._Object v)
          Constructor
JSON._Value(long v)
          Constructor
JSON._Value(java.lang.Long v)
          Constructor
JSON._Value(java.lang.String v)
          Constructor
 
Method Summary
 JSON._Array getArrayValue(JSON._Array dft)
          Gets the JSON._Array value
 boolean getBooleanValue(boolean dft)
          Gets the Boolean representation of this value if the value type is one of Boolean(booleanValue), String(parseBoolean), or Number(false if '0', true otherwise)
 double getDoubleValue(double dft)
          Gets the Double representation of this value if the value type is one of Number(doubleValue), String(parseDouble), or Boolean('0.0' if false, '1.0' otherwise)
 int getIntValue(int dft)
          Gets the Integer representation of this value if the value type is one of Number(intValue), String(parseInt), or Boolean('0' if false, '1' otherwise)
 long getLongValue(long dft)
          Gets the Long representation of this value if the value type is one of Number(longValue), String(parseLong), or Boolean('0' if false, '1' otherwise)
 java.lang.Object getObjectValue()
          Gets the value (may be null)
 JSON._Object getObjectValue(JSON._Object dft)
          Gets the JSON._Object value
 java.lang.String getStringValue(java.lang.String dft)
          Gets the String representation of this value if the value type is one of String, Number, or Boolean
 java.lang.Class getValueClass()
          Returns the class of the value object
 boolean isArrayValue()
          Returns true if this value represents a JSON._Array
 boolean isBooleanValue()
          Returns true if this value represents a Boolean
 boolean isDoubleValue()
          Returns true if this value represents a Double
 boolean isIntValue()
          Returns true if this value represents an Integer
 boolean isLongValue()
          Returns true if this value represents a Long
 boolean isNullValue()
          Returns true if this value represents a nul Object
 boolean isObjectValue()
          Returns true if this value represents a JSON._Object
 boolean isStringValue()
          Returns true if this value represents a String
 java.lang.String toString()
          Returns a String representation of this instance
 java.lang.StringBuffer toStringBuffer(int prefix, java.lang.StringBuffer sb)
          Write a String representation of this instance to the StringBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSON._Value

public JSON._Value()
Constructor


JSON._Value

public JSON._Value(java.lang.String v)
Constructor


JSON._Value

public JSON._Value(java.lang.Integer v)
Constructor


JSON._Value

public JSON._Value(int v)
Constructor


JSON._Value

public JSON._Value(java.lang.Long v)
Constructor


JSON._Value

public JSON._Value(long v)
Constructor


JSON._Value

public JSON._Value(java.lang.Double v)
Constructor


JSON._Value

public JSON._Value(double v)
Constructor


JSON._Value

public JSON._Value(java.lang.Boolean v)
Constructor


JSON._Value

public JSON._Value(boolean v)
Constructor


JSON._Value

public JSON._Value(JSON._Array v)
Constructor


JSON._Value

public JSON._Value(JSON._Object v)
Constructor

Method Detail

getObjectValue

public java.lang.Object getObjectValue()
Gets the value (may be null)


isNullValue

public boolean isNullValue()
Returns true if this value represents a nul Object


isStringValue

public boolean isStringValue()
Returns true if this value represents a String


getStringValue

public java.lang.String getStringValue(java.lang.String dft)
Gets the String representation of this value if the value type is one of String, Number, or Boolean


isIntValue

public boolean isIntValue()
Returns true if this value represents an Integer


getIntValue

public int getIntValue(int dft)
Gets the Integer representation of this value if the value type is one of Number(intValue), String(parseInt), or Boolean('0' if false, '1' otherwise)


isLongValue

public boolean isLongValue()
Returns true if this value represents a Long


getLongValue

public long getLongValue(long dft)
Gets the Long representation of this value if the value type is one of Number(longValue), String(parseLong), or Boolean('0' if false, '1' otherwise)


isDoubleValue

public boolean isDoubleValue()
Returns true if this value represents a Double


getDoubleValue

public double getDoubleValue(double dft)
Gets the Double representation of this value if the value type is one of Number(doubleValue), String(parseDouble), or Boolean('0.0' if false, '1.0' otherwise)


isBooleanValue

public boolean isBooleanValue()
Returns true if this value represents a Boolean


getBooleanValue

public boolean getBooleanValue(boolean dft)
Gets the Boolean representation of this value if the value type is one of Boolean(booleanValue), String(parseBoolean), or Number(false if '0', true otherwise)


isArrayValue

public boolean isArrayValue()
Returns true if this value represents a JSON._Array


getArrayValue

public JSON._Array getArrayValue(JSON._Array dft)
Gets the JSON._Array value


isObjectValue

public boolean isObjectValue()
Returns true if this value represents a JSON._Object


getObjectValue

public JSON._Object getObjectValue(JSON._Object dft)
Gets the JSON._Object value


getValueClass

public java.lang.Class getValueClass()
Returns the class of the value object


toStringBuffer

public java.lang.StringBuffer toStringBuffer(int prefix,
                                             java.lang.StringBuffer sb)
Write a String representation of this instance to the StringBuffer


toString

public java.lang.String toString()
Returns a String representation of this instance

Overrides:
toString in class java.lang.Object