com.ibm.websphere.rpcadapter.serializers
Class ObjectToJson
- java.lang.Object
com.ibm.websphere.rpcadapter.serializers.ObjectToJson
- public class ObjectToJson
- extends java.lang.Object
Field Summary
Modifier and Type | Field and Description |
---|---|
|
JREF_PREFIX
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
toJson(java.lang.Object bean,java.util.Map hiddenFields,boolean recursive)
Uses getters, if available.
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
JREF_PREFIX
- public static final java.lang.String JREF_PREFIX
See Also:
Method Detail
toJson
- public static java.lang.Object toJson( java.lang.Object bean,
- java.util.Map hiddenFields,
- boolean recursive)
- throws java.lang.IllegalArgumentException
- java.beans.IntrospectionException
- java.lang.IllegalAccessException
- java.lang.reflect.InvocationTargetException
Uses getters, if available. Otherwise, attempts to get values from the
fields directly. Getters and fields must be public; fields must also be
non-final.
Circular references are replaced with JavaScript references (e.g. {"a" : [
{"b" : "x"}, {"c" : "y"}, "$jref:this.a[0]" ] }).
Parameters:
bean
- Returns:
Throws:
java.lang.IllegalArgumentException
java.beans.IntrospectionException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException