Interface MarshallHelper
-
- All Superinterfaces:
Helper
- All Known Implementing Classes:
AbstractHelper,ArrayHelper,BigDecimalHelper,BigIntegerHelper,BooleanHelper,ByteHelper,CharacterHelper,CollectionHelper,ColorHelper,DateHelper,DoubleHelper,EnumHelper,FloatHelper,FontHelper,IntegerHelper,LongHelper,MapHelper,ObjectHelper,ObjectHelperDirect,ShortHelper,StringHelper
public interface MarshallHelper extends Helper
A helper can render an instance of a specific class in a custom way. It is the helpers responsability to render instances of a class to/from JSON.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.-
Methods inherited from interface com.sdicons.json.helper.Helper
getHelpedClass
-
-
-
-
Method Detail
-
renderValue
void renderValue(java.lang.Object aObj, JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool) throws MarshallExceptionConvert an element to JSON.- 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
java.lang.Object parseValue(JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool) throws MarshallException
Convert JSON representation into an instance of a class.- 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
-
-