org.hudsonci.rest.common
Class JacksonCodec

java.lang.Object
  extended by org.hudsonci.rest.common.JacksonCodec
All Implemented Interfaces:
JsonCodec

@Named
@Singleton
public class JacksonCodec
extends Object
implements JsonCodec

Jackson JSON codec.

Since:
2.1.0
Author:
Jason Dillon

Constructor Summary
JacksonCodec()
           
JacksonCodec(org.codehaus.jackson.map.ObjectMapper mapper)
           
 
Method Summary
<T> T
decode(String value, Class<T> type)
           
 String encode(Object value)
           
 org.codehaus.jackson.map.ObjectMapper getMapper()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JacksonCodec

@Inject
public JacksonCodec(org.codehaus.jackson.map.ObjectMapper mapper)

JacksonCodec

public JacksonCodec()
Method Detail

getMapper

public org.codehaus.jackson.map.ObjectMapper getMapper()

encode

public String encode(Object value)
              throws IOException
Specified by:
encode in interface JsonCodec
Throws:
IOException

decode

public <T> T decode(String value,
                    Class<T> type)
         throws IOException
Specified by:
decode in interface JsonCodec
Throws:
IOException


Copyright © 2004-2011 Hudson. All Rights Reserved.