Class ObjectCodecService
- java.lang.Object
-
- org.nuxeo.ecm.automation.io.services.codec.ObjectCodecService
-
public class ObjectCodecService extends Object
- Author:
- Bogdan Stefanescu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObjectCodecService.BooleanCodec
static class
ObjectCodecService.CalendarCodec
static class
ObjectCodecService.DateCodec
static class
ObjectCodecService.DocumentAdapterCodec
static class
ObjectCodecService.NumberCodec
static class
ObjectCodecService.StringCodec
-
Field Summary
Fields Modifier and Type Field Description protected Map<Class<?>,ObjectCodec<?>>
_codecs
protected Map<String,ObjectCodec<?>>
_codecsByName
protected Map<Class<?>,ObjectCodec<?>>
codecs
protected Map<String,ObjectCodec<?>>
codecsByName
protected static Log
log
-
Constructor Summary
Constructors Constructor Description ObjectCodecService(com.fasterxml.jackson.core.JsonFactory jsonFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCodec(ObjectCodec<?> codec)
Map<Class<?>,ObjectCodec<?>>
codecs()
Map<String,ObjectCodec<?>>
codecsByName()
ObjectCodec<?>
getCodec(Class<?> objectType)
ObjectCodec<?>
getCodec(String name)
Collection<ObjectCodec<?>>
getCodecs()
Get all codecs.protected void
init()
void
postInit()
Object
read(com.fasterxml.jackson.core.JsonParser jp, ClassLoader cl, CoreSession session)
Object
read(InputStream in, ClassLoader cl, CoreSession session)
Object
read(InputStream in, CoreSession session)
Object
read(String json, ClassLoader cl, CoreSession session)
Object
read(String json, CoreSession session)
protected Object
readGenericObject(com.fasterxml.jackson.core.JsonParser jp, String name, ClassLoader cl)
Object
readNode(com.fasterxml.jackson.databind.JsonNode node, ClassLoader cl, CoreSession session)
Object
readNode(com.fasterxml.jackson.databind.JsonNode node, CoreSession session)
void
removeCodec(Class<?> objectType)
void
removeCodec(String name)
String
toString(Object object)
String
toString(Object object, boolean preetyPrint)
void
write(com.fasterxml.jackson.core.JsonGenerator jg, Object object)
void
write(OutputStream out, Object object)
void
write(OutputStream out, Object object, boolean prettyPint)
protected void
writeGenericObject(com.fasterxml.jackson.core.JsonGenerator jg, Class<?> clazz, Object object)
-
-
-
Field Detail
-
log
protected static final Log log
-
codecs
protected Map<Class<?>,ObjectCodec<?>> codecs
-
codecsByName
protected Map<String,ObjectCodec<?>> codecsByName
-
_codecs
protected Map<Class<?>,ObjectCodec<?>> _codecs
-
_codecsByName
protected Map<String,ObjectCodec<?>> _codecsByName
-
-
Method Detail
-
init
protected void init()
-
postInit
public void postInit()
-
getCodecs
public Collection<ObjectCodec<?>> getCodecs()
Get all codecs.
-
addCodec
public void addCodec(ObjectCodec<?> codec)
-
removeCodec
public void removeCodec(String name)
-
removeCodec
public void removeCodec(Class<?> objectType)
-
getCodec
public ObjectCodec<?> getCodec(Class<?> objectType)
-
getCodec
public ObjectCodec<?> getCodec(String name)
-
codecs
public Map<Class<?>,ObjectCodec<?>> codecs()
-
codecsByName
public Map<String,ObjectCodec<?>> codecsByName()
-
toString
public String toString(Object object) throws IOException
- Throws:
IOException
-
toString
public String toString(Object object, boolean preetyPrint) throws IOException
- Throws:
IOException
-
write
public void write(OutputStream out, Object object) throws IOException
- Throws:
IOException
-
write
public void write(OutputStream out, Object object, boolean prettyPint) throws IOException
- Throws:
IOException
-
write
public void write(com.fasterxml.jackson.core.JsonGenerator jg, Object object) throws IOException
- Throws:
IOException
-
read
public Object read(String json, CoreSession session) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
read
public Object read(String json, ClassLoader cl, CoreSession session) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
read
public Object read(InputStream in, CoreSession session) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
read
public Object read(InputStream in, ClassLoader cl, CoreSession session) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
read
public Object read(com.fasterxml.jackson.core.JsonParser jp, ClassLoader cl, CoreSession session) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
readNode
public Object readNode(com.fasterxml.jackson.databind.JsonNode node, ClassLoader cl, CoreSession session) throws IOException
- Throws:
IOException
-
readNode
public Object readNode(com.fasterxml.jackson.databind.JsonNode node, CoreSession session) throws IOException
- Throws:
IOException
-
writeGenericObject
protected final void writeGenericObject(com.fasterxml.jackson.core.JsonGenerator jg, Class<?> clazz, Object object) throws IOException
- Throws:
IOException
-
readGenericObject
protected final Object readGenericObject(com.fasterxml.jackson.core.JsonParser jp, String name, ClassLoader cl) throws IOException
- Throws:
IOException
-
-