flexjson
Class JSONContext

java.lang.Object
  extended by flexjson.JSONContext

public class JSONContext
extends Object


Constructor Summary
JSONContext()
           
 
Method Summary
static void cleanup()
          static moethod to clean up thread when serialization is complete
static JSONContext get()
          static method to getTransformer the context for this thread
 LinkedList<Object> getObjectStack()
           
 OutputHandler getOut()
          getTransformer output handler
 Path getPath()
           
 String getRootName()
           
 Transformer getTransformer(Object object)
          Retrieves a transformer for the provided object
 ChainedSet getVisits()
           
 boolean isIncluded(BeanProperty prop)
           
 boolean isIncluded(String key, Object value)
           
protected  PathExpression matches(List<PathExpression> expressions)
           
 TypeContext peekTypeContext()
           
 void popTypeContext()
           
 void pushTypeContext(TypeContext contextEnum)
           
 void serializationType(SerializationType serializationType)
           
 void setOut(OutputHandler out)
          Set the output handler.
 void setPathExpressions(List<PathExpression> pathExpressions)
           
 void setPathTransformers(Map<Path,Transformer> pathTransformerMap)
          used to pass in configured transformers from the JsonSerializer
 void setPrettyPrint(boolean prettyPrint)
          configures the context to output JSON with new lines and indentations
 void setRootName(String rootName)
           
 void setTypeTransformers(TypeTransformerMap typeTransformerMap)
          used to pass in configured transformers from the JsonSerializer
 void setVisits(ChainedSet visits)
           
 void transform(Object object)
          Run a transformer on the provided object
 void write(String value)
          write a simple non-quoted value to output
 void writeCloseArray()
           
 void writeCloseObject()
           
 void writeComma()
           
 void writeIndent()
           
 void writeName(String name)
           
 TypeContext writeOpenArray()
           
 TypeContext writeOpenObject()
           
 void writeQuoted(String value)
          write a quoted and escaped value to the output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONContext

public JSONContext()
Method Detail

serializationType

public void serializationType(SerializationType serializationType)

transform

public void transform(Object object)
Run a transformer on the provided object

Parameters:
object -

getTransformer

public Transformer getTransformer(Object object)
Retrieves a transformer for the provided object

Parameters:
object -
Returns:

setTypeTransformers

public void setTypeTransformers(TypeTransformerMap typeTransformerMap)
used to pass in configured transformers from the JsonSerializer

Parameters:
typeTransformerMap -

setPathTransformers

public void setPathTransformers(Map<Path,Transformer> pathTransformerMap)
used to pass in configured transformers from the JsonSerializer

Parameters:
pathTransformerMap -

setPrettyPrint

public void setPrettyPrint(boolean prettyPrint)
configures the context to output JSON with new lines and indentations

Parameters:
prettyPrint -

pushTypeContext

public void pushTypeContext(TypeContext contextEnum)

popTypeContext

public void popTypeContext()

peekTypeContext

public TypeContext peekTypeContext()

setOut

public void setOut(OutputHandler out)
Set the output handler.

Parameters:
out -

getOut

public OutputHandler getOut()
getTransformer output handler

Returns:

write

public void write(String value)
write a simple non-quoted value to output

Parameters:
value -

writeOpenObject

public TypeContext writeOpenObject()

writeCloseObject

public void writeCloseObject()

writeName

public void writeName(String name)

writeComma

public void writeComma()

writeOpenArray

public TypeContext writeOpenArray()

writeCloseArray

public void writeCloseArray()

writeIndent

public void writeIndent()

writeQuoted

public void writeQuoted(String value)
write a quoted and escaped value to the output

Parameters:
value -

get

public static JSONContext get()
static method to getTransformer the context for this thread

Returns:

cleanup

public static void cleanup()
static moethod to clean up thread when serialization is complete


getVisits

public ChainedSet getVisits()

setVisits

public void setVisits(ChainedSet visits)

getObjectStack

public LinkedList<Object> getObjectStack()

getRootName

public String getRootName()

setRootName

public void setRootName(String rootName)

getPath

public Path getPath()

setPathExpressions

public void setPathExpressions(List<PathExpression> pathExpressions)

isIncluded

public boolean isIncluded(BeanProperty prop)

isIncluded

public boolean isIncluded(String key,
                          Object value)

matches

protected PathExpression matches(List<PathExpression> expressions)


Copyright © 2014. All Rights Reserved.