|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.util.ajax.JSON
com.dyuproject.json.StandardJSON
public class StandardJSON
Standard JSON serialization of pojos using cached convertors with configurable classloading. Enhancement for jetty-util's org.mortbay.util.ajax.JSON
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.mortbay.util.ajax.JSON |
---|
org.mortbay.util.ajax.JSON.Convertible, org.mortbay.util.ajax.JSON.Convertor, org.mortbay.util.ajax.JSON.Generator, org.mortbay.util.ajax.JSON.Literal, org.mortbay.util.ajax.JSON.Output, org.mortbay.util.ajax.JSON.ReaderSource, org.mortbay.util.ajax.JSON.Source, org.mortbay.util.ajax.JSON.StringSource |
Field Summary | |
---|---|
protected boolean |
_addClass
|
protected ConvertorCache |
_convertorCache
|
Constructor Summary | |
---|---|
StandardJSON()
|
|
StandardJSON(boolean addClass)
|
|
StandardJSON(ConvertorCache convertorCache)
|
|
StandardJSON(ConvertorCache convertorCache,
boolean addClass)
|
Method Summary | |
---|---|
protected org.mortbay.util.ajax.JSON.Convertor |
getConvertor(Class clazz)
|
ConvertorCache |
getConvertorCache()
Gets the convertor cache. |
static URL |
getResource(String path)
Gets a URL resource from the classloader. |
static URL |
getResource(String path,
Class<?> context,
boolean checkParents)
Gets a URL resource from the classloader;
If not found, the classloader of the context class specified will be used along
with its parent if the flag checkParents is true. |
boolean |
isAddClass()
Checks whether the classname of a pojo is included upon serialization. |
static boolean |
isCheckParents()
Checks whether classloading should check parent classloaders. |
static Class<?> |
loadClass(String className)
Loads a class from the classloader. |
static Class<?> |
loadClass(String className,
Class<?> context,
boolean checkParents)
Loads a class from the classloader; If not found, the classloader of the context class specified will be used along
with its parent if the flag checkParents is true. |
protected Object |
parseObject(org.mortbay.util.ajax.JSON.Source source)
|
void |
setAddClass(boolean addClass)
Sets the addClass to determine whether the classname of a pojo
is included upon serialization. |
static void |
setCheckParents(boolean checkParents)
Sets the checkParents to determine whether classloading
should check parent classloaders. |
Methods inherited from class org.mortbay.util.ajax.JSON |
---|
addConvertor, addConvertorFor, append, appendArray, appendArray, appendBoolean, appendJSON, appendJSON, appendJSON, appendMap, appendNull, appendNumber, appendString, complete, contextFor, contextForArray, convertTo, fromJSON, getConvertorFor, getDefault, getStringBufferSize, handleUnknown, newArray, newMap, parse, parse, parse, parse, parse, parse, parse, parse, parseArray, parseNumber, parseString, registerConvertor, seekTo, seekTo, setDefault, setStringBufferSize, toJSON, toString, toString, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final ConvertorCache _convertorCache
protected boolean _addClass
Constructor Detail |
---|
public StandardJSON()
public StandardJSON(ConvertorCache convertorCache)
public StandardJSON(ConvertorCache convertorCache, boolean addClass)
public StandardJSON(boolean addClass)
Method Detail |
---|
public static boolean isCheckParents()
public static void setCheckParents(boolean checkParents)
checkParents
to determine whether classloading
should check parent classloaders.
public static Class<?> loadClass(String className, Class<?> context, boolean checkParents)
context
class specified will be used along
with its parent if the flag checkParents
is true.
public static Class<?> loadClass(String className)
public static URL getResource(String path, Class<?> context, boolean checkParents)
URL
resource from the classloader;
If not found, the classloader of the context
class specified will be used along
with its parent if the flag checkParents
is true.
public static URL getResource(String path)
URL
resource from the classloader.
public ConvertorCache getConvertorCache()
public boolean isAddClass()
public void setAddClass(boolean addClass)
addClass
to determine whether the classname of a pojo
is included upon serialization.
protected org.mortbay.util.ajax.JSON.Convertor getConvertor(Class clazz)
getConvertor
in class org.mortbay.util.ajax.JSON
protected Object parseObject(org.mortbay.util.ajax.JSON.Source source)
parseObject
in class org.mortbay.util.ajax.JSON
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |