net.arnx.jsonic
Class JSON.Context

java.lang.Object
  extended by net.arnx.jsonic.JSON.Context
Enclosing class:
JSON

public final class JSON.Context
extends Object


Constructor Summary
JSON.Context()
           
 
Method Summary
<T> T
convert(Object key, Object value, Class<? extends T> c)
           
 Object convert(Object key, Object value, Type t)
           
 StringBuilder getCachedBuffer()
           
 NamingStyle getEnumCaseStyle()
           
 JSONHint getHint()
          Returns the current hint annotation.
 Object getKey()
          Returns the current key object.
 Object getKey(int level)
          Returns the key object in any level.
 int getLevel()
          Returns the current level.
 Locale getLocale()
           
 int getMaxDepth()
           
 JSON.Mode getMode()
           
 NamingStyle getPropertyCaseStyle()
           
 TimeZone getTimeZone()
           
 boolean isPrettyPrint()
           
 boolean isSuppressNull()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSON.Context

public JSON.Context()
Method Detail

getCachedBuffer

public StringBuilder getCachedBuffer()

getLocale

public Locale getLocale()

getTimeZone

public TimeZone getTimeZone()

getMaxDepth

public int getMaxDepth()

isPrettyPrint

public boolean isPrettyPrint()

isSuppressNull

public boolean isSuppressNull()

getMode

public JSON.Mode getMode()

getPropertyCaseStyle

public NamingStyle getPropertyCaseStyle()

getEnumCaseStyle

public NamingStyle getEnumCaseStyle()

getLevel

public int getLevel()
Returns the current level.

Returns:
level number. 0 is root node.

getKey

public Object getKey()
Returns the current key object.

Returns:
Root node is '$'. When the parent is a array, the key is Integer, otherwise String.

getKey

public Object getKey(int level)
Returns the key object in any level. the negative value means relative to current level.

Returns:
Root node is '$'. When the parent is a array, the key is Integer, otherwise String.

getHint

public JSONHint getHint()
Returns the current hint annotation.

Returns:
the current annotation if present on this context, else null.

convert

public <T> T convert(Object key,
                     Object value,
                     Class<? extends T> c)
          throws Exception
Throws:
Exception

convert

public Object convert(Object key,
                      Object value,
                      Type t)
               throws Exception
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object