ccc.plugins.s11n.json
Class TemplateSerializer

java.lang.Object
  extended by ccc.plugins.s11n.json.ResSerializer<T>
      extended by ccc.plugins.s11n.json.ResourceSerializer<Template>
          extended by ccc.plugins.s11n.json.TemplateSerializer
All Implemented Interfaces:
Serializer<Template>

public class TemplateSerializer
extends ResourceSerializer<Template>

Serializer for Templates.

Author:
Civic Computing Ltd.

Constructor Summary
TemplateSerializer()
           
 
Method Summary
protected  Template createObject()
          Create a new instance of type T.
 Template read(Json json)
          Deserialize from a representation.
 Json write(Json json, Template instance)
          Serialize to representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateSerializer

public TemplateSerializer()
Method Detail

read

public Template read(Json json)
Deserialize from a representation.

Specified by:
read in interface Serializer<Template>
Overrides:
read in class ResourceSerializer<Template>
Parameters:
json - The wire representation.
Returns:
The corresponding object.

createObject

protected Template createObject()
Create a new instance of type T.

Specified by:
createObject in class ResSerializer<Template>
Returns:
The newly created instance of T.

write

public Json write(Json json,
                  Template instance)
Serialize to representation.

Specified by:
write in interface Serializer<Template>
Overrides:
write in class ResourceSerializer<Template>
Parameters:
json - The wire representation.
instance - The object to serialize.
Returns:
Returns the 'json' input param if the 'instance' param is not NULL; returns NULL otherwise.


Copyright © 2010. All Rights Reserved.