Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation.server.jaxrs.io
Class ObjectCodec<T>

java.lang.Object
  extended by org.nuxeo.ecm.automation.server.jaxrs.io.ObjectCodec<T>
Direct Known Subclasses:
ObjectCodecService.BooleanCodec, ObjectCodecService.CalendarCodec, ObjectCodecService.DateCodec, ObjectCodecService.NumberCodec, ObjectCodecService.StringCodec

public abstract class ObjectCodec<T>
extends Object

Author:
Bogdan Stefanescu

Constructor Summary
ObjectCodec()
           
ObjectCodec(Class<T> type)
           
 
Method Summary
static Class<?> findParametrizedType(Class<?> clazz)
           
 Class<T> getJavaType()
           
 String getType()
          Get this codec type.
 boolean isBuiltin()
          Whether this codec is a builtin codec
 T read(org.codehaus.jackson.JsonParser jp)
          When the object codec is called the stream is positioned on the first value.
 void write(org.codehaus.jackson.JsonGenerator jg, T value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCodec

public ObjectCodec()

ObjectCodec

public ObjectCodec(Class<T> type)
Method Detail

findParametrizedType

public static Class<?> findParametrizedType(Class<?> clazz)

getType

public String getType()
Get this codec type. Implementors can override to return a short name. The default name is the object type name.

Returns:

isBuiltin

public boolean isBuiltin()
Whether this codec is a builtin codec

Returns:

getJavaType

public Class<T> getJavaType()

write

public void write(org.codehaus.jackson.JsonGenerator jg,
                  T value)
           throws IOException
Throws:
IOException

read

public T read(org.codehaus.jackson.JsonParser jp)
       throws IOException
When the object codec is called the stream is positioned on the first value. For inlined objects this is the first value after the "entity-type" property. For non inlined objects this will be the object itself (i.e. '{' or '[')

Parameters:
jp -
Returns:
Throws:
IOException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.