|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.json.JsonConfig
public class JsonConfig
Utility class that helps configuring the serialization process.
Method Summary | |
---|---|
void |
addJsonEventListener(JsonEventListener listener)
Registers a listener for Json events. |
void |
clearJsonBeanProcessors()
Removes all registered JsonBeanProcessors. |
void |
clearJsonEventListeners()
Removes all registered listener for Json Events. |
void |
clearJsonValueProcessors()
Removes all registered JsonValueProcessors. |
void |
disableEventTriggering()
Disables event triggering when building. |
void |
enableEventTriggering()
Enables event triggering when building. |
JsonBeanProcessor |
findJsonBeanProcessor(Class target)
Finds a JsonBeanProcessor registered to the target class. |
JsonValueProcessor |
findJsonValueProcessor(Class propertyType)
Finds a JsonValueProcessor registered to the target type. |
JsonValueProcessor |
findJsonValueProcessor(Class beanClass,
Class propertyType,
String key)
Finds a JsonValueProcessor. |
JsonValueProcessor |
findJsonValueProcessor(Class propertyType,
String key)
Finds a JsonValueProcessor. |
CycleDetectionStrategy |
getCycleDetectionStrategy()
Returns the configured CycleDetectionStrategy. |
String[] |
getExcludes()
Returns the configured properties for exclusion. |
static JsonConfig |
getInstance()
Returns the singleton instance. |
JavaIdentifierTransformer |
getJavaIdentifierTransformer()
Returns the configured JavaIdentifierTransformer. |
List |
getJsonEventListeners()
Returns a list of registered listeners for Json events. |
Collection |
getMergedExcludes()
Returns a set of default excludes with user-defined excludes. |
boolean |
isEventTriggeringEnabled()
Returns true if event triggering is enabled during building. |
boolean |
isIgnoreDefaultExcludes()
Returns true if default excludes will not be used. |
boolean |
isIgnoreTransientFields()
Returns true if transient fields of a bean will be ignored. |
boolean |
isSkipJavaIdentifierTransformationInMapKeys()
Returns true if map keys will not be transformed. |
void |
registerJsonBeanProcessor(Class target,
JsonBeanProcessor jsonBeanProcessor)
Registers a JsonValueProcessor. |
void |
registerJsonValueProcessor(Class beanClass,
Class propertyType,
JsonValueProcessor jsonValueProcessor)
Registers a JsonValueProcessor. |
void |
registerJsonValueProcessor(Class propertyType,
JsonValueProcessor jsonValueProcessor)
Registers a JsonValueProcessor. |
void |
registerJsonValueProcessor(Class beanClass,
String key,
JsonValueProcessor jsonValueProcessor)
Registers a JsonValueProcessor. |
void |
registerJsonValueProcessor(String key,
JsonValueProcessor jsonValueProcessor)
Registers a JsonValueProcessor. |
void |
removeJsonEventListener(JsonEventListener listener)
Removes a listener for Json events. |
void |
reset()
Resets all values to its default state. |
void |
setCycleDetectionStrategy(CycleDetectionStrategy cycleDetectionStrategy)
Sets a CycleDetectionStrategy to use. |
void |
setExcludes(String[] excludes)
Sets the excludes to use. |
void |
setIgnoreDefaultExcludes(boolean ignoreDefaultExcludes)
Sets if default ecludes would be skipped when building. |
void |
setIgnoreTransientFields(boolean ignoreTransientFields)
Sets if transient fields would be skipped when building. |
void |
setJavaIdentifierTransformer(JavaIdentifierTransformer javaIdentifierTransformer)
Sets the JavaIdentifierTransformer to use. |
void |
setSkipJavaIdentifierTransformationInMapKeys(boolean skipJavaIdentifierTransformationInMapKeys)
Sets if transient fields of beans would be skipped when building. |
void |
unregisterJsonBeanProcessor(Class target)
Removes a JsonBeanProcessor. |
void |
unregisterJsonValueProcessor(Class propertyType)
Removes a JsonValueProcessor. |
void |
unregisterJsonValueProcessor(Class beanClass,
Class propertyType)
Removes a JsonValueProcessor. |
void |
unregisterJsonValueProcessor(Class beanClass,
String key)
Removes a JsonValueProcessor. |
void |
unregisterJsonValueProcessor(String key)
Removes a JsonValueProcessor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JsonConfig getInstance()
public void addJsonEventListener(JsonEventListener listener)
listener
- a listener for eventsenableEventTriggering()
,
disableEventTriggering()
,
removeJsonEventListener(JsonEventListener)
public void clearJsonBeanProcessors()
public void clearJsonEventListeners()
public void clearJsonValueProcessors()
public void disableEventTriggering()
public void enableEventTriggering()
public JsonBeanProcessor findJsonBeanProcessor(Class target)
target
- a class used for searching a JsonBeanProcessor.public JsonValueProcessor findJsonValueProcessor(Class propertyType)
propertyType
- a class used for searching a JsonValueProcessor.public JsonValueProcessor findJsonValueProcessor(Class beanClass, Class propertyType, String key)
beanClass
- the class to which the property may belongpropertyType
- the type of the propertykey
- the name of the property which may belong to the target classpublic JsonValueProcessor findJsonValueProcessor(Class propertyType, String key)
propertyType
- the type of the propertykey
- the name of the property which may belong to the target classpublic CycleDetectionStrategy getCycleDetectionStrategy()
public String[] getExcludes()
public JavaIdentifierTransformer getJavaIdentifierTransformer()
public List getJsonEventListeners()
public Collection getMergedExcludes()
public boolean isEventTriggeringEnabled()
public boolean isIgnoreDefaultExcludes()
public boolean isIgnoreTransientFields()
public boolean isSkipJavaIdentifierTransformationInMapKeys()
public void registerJsonBeanProcessor(Class target, JsonBeanProcessor jsonBeanProcessor)
target
- the class to use as keyjsonBeanProcessor
- the processor to registerpublic void registerJsonValueProcessor(Class beanClass, Class propertyType, JsonValueProcessor jsonValueProcessor)
beanClass
- the class to use as keypropertyType
- the property type to use as keyjsonValueProcessor
- the processor to registerpublic void registerJsonValueProcessor(Class propertyType, JsonValueProcessor jsonValueProcessor)
propertyType
- the property type to use as keyjsonValueProcessor
- the processor to registerpublic void registerJsonValueProcessor(Class beanClass, String key, JsonValueProcessor jsonValueProcessor)
beanClass
- the class to use as keykey
- the property name to use as keyjsonValueProcessor
- the processor to registerpublic void registerJsonValueProcessor(String key, JsonValueProcessor jsonValueProcessor)
key
- the property name to use as keyjsonValueProcessor
- the processor to registerpublic void removeJsonEventListener(JsonEventListener listener)
listener
- a listener for eventsaddJsonEventListener(JsonEventListener)
public void reset()
public void setCycleDetectionStrategy(CycleDetectionStrategy cycleDetectionStrategy)
public void setExcludes(String[] excludes)
public void setIgnoreDefaultExcludes(boolean ignoreDefaultExcludes)
public void setIgnoreTransientFields(boolean ignoreTransientFields)
public void setJavaIdentifierTransformer(JavaIdentifierTransformer javaIdentifierTransformer)
public void setSkipJavaIdentifierTransformationInMapKeys(boolean skipJavaIdentifierTransformationInMapKeys)
public void unregisterJsonBeanProcessor(Class target)
target
- a class used for searching a JsonBeanProcessor.public void unregisterJsonValueProcessor(Class propertyType)
propertyType
- a class used for searching a JsonValueProcessor.public void unregisterJsonValueProcessor(Class beanClass, Class propertyType)
beanClass
- the class to which the property may belongpropertyType
- the type of the propertypublic void unregisterJsonValueProcessor(Class beanClass, String key)
beanClass
- the class to which the property may belongkey
- the name of the property which may belong to the target classpublic void unregisterJsonValueProcessor(String key)
key
- the name of the property which may belong to the target class
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |