Class ObjectHelperDirect
- java.lang.Object
-
- com.sdicons.json.serializer.helper.impl.ObjectHelperDirect
-
- All Implemented Interfaces:
Helper,MarshallHelper
public class ObjectHelperDirect extends java.lang.Object implements MarshallHelper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classObjectHelperDirect.AnnotatedMethods
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Class,ObjectHelperDirect.AnnotatedMethods>annotatedPool
-
Constructor Summary
Constructors Constructor Description ObjectHelperDirect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.reflect.ConstructorgetAnnotatedConstructor(java.lang.Class aClass)protected ObjectHelperDirect.AnnotatedMethodsgetAnnotatedMethods(java.lang.Class aClass)protected java.lang.reflect.MethodgetAnnotatedSerializingMethod(java.lang.Class aClass)protected java.util.List<java.lang.reflect.Field>getFieldInfo(java.lang.Class aClass)java.lang.ClassgetHelpedClass()java.lang.ObjectparseValue(JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool)Convert JSON representation into an instance of a class.voidrenderValue(java.lang.Object aObj, JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool)Convert an element to JSON.
-
-
-
Field Detail
-
annotatedPool
private java.util.Map<java.lang.Class,ObjectHelperDirect.AnnotatedMethods> annotatedPool
-
-
Method Detail
-
getAnnotatedMethods
protected ObjectHelperDirect.AnnotatedMethods getAnnotatedMethods(java.lang.Class aClass) throws MarshallException
- Throws:
MarshallException
-
getFieldInfo
protected java.util.List<java.lang.reflect.Field> getFieldInfo(java.lang.Class aClass)
-
getAnnotatedSerializingMethod
protected java.lang.reflect.Method getAnnotatedSerializingMethod(java.lang.Class aClass)
-
getAnnotatedConstructor
protected java.lang.reflect.Constructor getAnnotatedConstructor(java.lang.Class aClass)
-
renderValue
public void renderValue(java.lang.Object aObj, JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool) throws MarshallExceptionDescription copied from interface:MarshallHelperConvert an element to JSON.- Specified by:
renderValuein interfaceMarshallHelper- Parameters:
aObj- Instance that should be rendered to JSON.aObjectElement- The parent element where we have to put the rendered information. A helper is allowed to add child elements.aMarshall- The marshall we can use to recursively render parts of our own object.aPool- A pool of objects already encountered. Is used to resolve references.- Throws:
MarshallException
-
parseValue
public java.lang.Object parseValue(JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool) throws MarshallException
Description copied from interface:MarshallHelperConvert JSON representation into an instance of a class.- Specified by:
parseValuein interfaceMarshallHelper- Parameters:
aObjectElement- The source element we have to convert into an object.aMarshall- The marshall we can use to convert sub elements into subobjects to compose our target object.aPool- A pool of objects already encountered. Is used to resolve references.- Returns:
- The newly created object.
- Throws:
MarshallException
-
getHelpedClass
public java.lang.Class getHelpedClass()
- Specified by:
getHelpedClassin interfaceHelper
-
-