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()
           
 int getDepth()
          Returns the current depth.
 NamingStyle getEnumCaseStyle()
          Deprecated. 
 NamingStyle getEnumStyle()
           
 JSONHint getHint()
          Returns the current hint annotation.
 Object getKey()
          Returns the current key object.
 Object getKey(int level)
          Returns the key object in any depth.
 int getLevel()
          Deprecated. 
 Locale getLocale()
           
 int getMaxDepth()
           
 JSON.Mode getMode()
           
 NamingStyle getPropertyCaseStyle()
          Deprecated. 
 NamingStyle getPropertyStyle()
           
 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()

getPropertyStyle

public NamingStyle getPropertyStyle()

getEnumStyle

public NamingStyle getEnumStyle()

getPropertyCaseStyle

@Deprecated
public NamingStyle getPropertyCaseStyle()
Deprecated. 


getEnumCaseStyle

@Deprecated
public NamingStyle getEnumCaseStyle()
Deprecated. 


getLevel

@Deprecated
public int getLevel()
Deprecated. 

Returns the current level.

Returns:
level number. 0 is root node.

getDepth

public int getDepth()
Returns the current depth.

Returns:
depth 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 depth. the negative value means relative to current depth.

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