Class ObjectHelperDirect
java.lang.Object
com.sdicons.json.serializer.helper.impl.ObjectHelperDirect
- All Implemented Interfaces:
Helper,MarshallHelper
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConstructorgetAnnotatedConstructor(Class aClass) protected ObjectHelperDirect.AnnotatedMethodsgetAnnotatedMethods(Class aClass) protected MethodgetAnnotatedSerializingMethod(Class aClass) getFieldInfo(Class aClass) parseValue(JSONObject aObjectElement, JSONMarshall aMarshall, HashMap aPool) Convert JSON representation into an instance of a class.voidrenderValue(Object aObj, JSONObject aObjectElement, JSONMarshall aMarshall, HashMap aPool) Convert an element to JSON.
-
Field Details
-
annotatedPool
-
-
Constructor Details
-
ObjectHelperDirect
public ObjectHelperDirect()
-
-
Method Details
-
getAnnotatedMethods
protected ObjectHelperDirect.AnnotatedMethods getAnnotatedMethods(Class aClass) throws MarshallException - Throws:
MarshallException
-
getFieldInfo
-
getAnnotatedSerializingMethod
-
getAnnotatedConstructor
-
renderValue
public void renderValue(Object aObj, JSONObject aObjectElement, JSONMarshall aMarshall, HashMap aPool) throws MarshallException Description 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 Object parseValue(JSONObject aObjectElement, JSONMarshall aMarshall, 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
- Specified by:
getHelpedClassin interfaceHelper
-