public class ColorSerializer extends AbstractSerializer
Constructor and Description |
---|
ColorSerializer() |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getHelpedClass() |
Object |
toJava(JSONObject aObjectElement,
JSONSerializer serializer,
HashMap<Object,Object> aPool)
Convert JSON representation into an instance of a class.
|
void |
toJSON(Object aObj,
JSONObject aParent,
JSONSerializer serializer,
HashMap<Object,Object> aPool)
Convert an element to JSON.
|
equals
public Object toJava(JSONObject aObjectElement, JSONSerializer serializer, HashMap<Object,Object> aPool) throws SerializerException
ClassSerializer
aObjectElement
- The source element we have to convert into an object.serializer
- The marshal we can use to convert sub elements into sub objects to compose our target object.aPool
- A pool of objects already encountered. Is used to resolve references.SerializerException
public void toJSON(Object aObj, JSONObject aParent, JSONSerializer serializer, HashMap<Object,Object> aPool) throws SerializerException
ClassSerializer
toJSON
in interface ClassSerializer
toJSON
in class AbstractSerializer
aObj
- Instance that should be rendered to JSON.aParent
- The parent element where we have to put the rendered information. A helper is allowed to add
child elements.serializer
- The marshal we can use to recursively render parts of our own object.aPool
- A pool of objects already encountered. Is used to resolve references.SerializerException
public Class<?> getHelpedClass()
Copyright © 2012. All Rights Reserved.