Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.automation.server.jaxrs.io
Class JsonMarshalling

java.lang.Object
  extended by org.nuxeo.ecm.automation.server.jaxrs.io.JsonMarshalling

public class JsonMarshalling
extends Object

Handles input/output marshalling and references resolution.

Author:
Bogdan Stefanescu

Constructor Summary
JsonMarshalling()
           
 
Method Summary
 void addMarshaller(JsonMarshaller<?> marshaller)
          Register the new marshalling logic
 boolean canMarshall(Class<?> clazz)
          Indicates if we can marshall the requested java type
<T> JsonMarshaller<T>
getMarshaller(Class<T> clazz)
          Access to the marshalling logic giving a java type
<T> JsonMarshaller<T>
getMarshaller(String type)
          Access to the marshalling logic giving a JSON type
<T> T
read(String type, net.sf.json.JSONObject object)
           
 void removeMarshaller(Class<?> clazz)
          Remove the marshalling logic associated to the provided java type
<T> void
write(Class<T> clazz, net.sf.json.JSONObject object, Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonMarshalling

public JsonMarshalling()
Method Detail

addMarshaller

public void addMarshaller(JsonMarshaller<?> marshaller)
Register the new marshalling logic

Parameters:
marshaller -

removeMarshaller

public void removeMarshaller(Class<?> clazz)
Remove the marshalling logic associated to the provided java type

Parameters:
clazz -

canMarshall

public boolean canMarshall(Class<?> clazz)
Indicates if we can marshall the requested java type

Parameters:
clazz -
Returns:

getMarshaller

public <T> JsonMarshaller<T> getMarshaller(String type)
Access to the marshalling logic giving a JSON type

Type Parameters:
T -
Parameters:
type -
Returns:

getMarshaller

public <T> JsonMarshaller<T> getMarshaller(Class<T> clazz)
Access to the marshalling logic giving a java type

Type Parameters:
T -
Parameters:
clazz -
Returns:

write

public <T> void write(Class<T> clazz,
                      net.sf.json.JSONObject object,
                      Object value)

read

public <T> T read(String type,
                  net.sf.json.JSONObject object)

Nuxeo Enterprise Platform 5.4

Copyright © 2011 Nuxeo SAS. All Rights Reserved.