com.metaparadigm.jsonrpc.serializer.impl
Class RawJSONArraySerializer

java.lang.Object
  extended by com.metaparadigm.jsonrpc.serializer.AbstractSerializer
      extended by com.metaparadigm.jsonrpc.serializer.impl.RawJSONArraySerializer
All Implemented Interfaces:
Serializer, java.io.Serializable

public class RawJSONArraySerializer
extends AbstractSerializer

See Also:
Serialized Form

Constructor Summary
RawJSONArraySerializer()
           
 
Method Summary
 java.lang.Class[] getJSONClasses()
          Get the json java classes that this Serializer is able to serialize from json into java and deserialize into json from java.
 java.lang.Class[] getSerializableClasses()
          Get the java classes that this Serializer is able to serialize from java into json and deserialize into java from json.
 java.lang.Object marshall(SerializerState state, java.lang.Object o)
          Marshall a java object into an equivalent json object.
 ObjectMatch tryUnmarshall(SerializerState state, java.lang.Class clazz, java.lang.Object jso)
           
 java.lang.Object unmarshall(SerializerState state, java.lang.Class clazz, java.lang.Object jso)
          Unmarshall json into an equivalent java object.
 
Methods inherited from class com.metaparadigm.jsonrpc.serializer.AbstractSerializer
canSerialize, setOwner
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawJSONArraySerializer

public RawJSONArraySerializer()
Method Detail

getJSONClasses

public java.lang.Class[] getJSONClasses()
Description copied from interface: Serializer
Get the json java classes that this Serializer is able to serialize from json into java and deserialize into json from java. These will typically be primitive class type wrappers or JSONObject, JSONArray.

Returns:
json side java classes that can be serialized/deserialized by this serializer.

getSerializableClasses

public java.lang.Class[] getSerializableClasses()
Description copied from interface: Serializer
Get the java classes that this Serializer is able to serialize from java into json and deserialize into java from json.

Returns:
java side classes that can be serialized/deserialized by this serializer.

marshall

public java.lang.Object marshall(SerializerState state,
                                 java.lang.Object o)
                          throws MarshallException
Description copied from interface: Serializer
Marshall a java object into an equivalent json object.

Parameters:
state - can be used to hold state while unmarshalling through recursive levels.
o - java object to marhsall into json.
Returns:
that JSONObject or JSONArray that contains the json representation of the java object that was marshalled.
Throws:
MarshallException - if there is a problem marshalling java to json.

tryUnmarshall

public ObjectMatch tryUnmarshall(SerializerState state,
                                 java.lang.Class clazz,
                                 java.lang.Object jso)
                          throws UnmarshallException
Throws:
UnmarshallException

unmarshall

public java.lang.Object unmarshall(SerializerState state,
                                   java.lang.Class clazz,
                                   java.lang.Object jso)
                            throws UnmarshallException
Description copied from interface: Serializer
Unmarshall json into an equivalent java object.

Parameters:
state - can be used to hold state while unmarshalling through recursive levels.
clazz - optional java class to unmarshall to.
jso - JSONObject or JSONArray that contains the json to unmarshall.
Returns:
the java object representing the json that was unmarshalled.
Throws:
UnmarshallException - if there is a problem unmarshalling json to java.


Copyright © 2005 Metaparadigm Pte Ltd.