|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.engine.Helper
org.restlet.engine.converter.ConverterHelper
org.restlet.ext.jackson.JacksonConverter
public class JacksonConverter
Converter between the JSON and Representation classes based on Jackson.
Constructor Summary | |
---|---|
JacksonConverter()
|
Method Summary | ||
---|---|---|
protected
|
create(MediaType mediaType,
T source)
Creates the marshaling JacksonRepresentation . |
|
protected
|
create(Representation source,
Class<T> objectClass)
Creates the unmarshaling JacksonRepresentation . |
|
protected org.codehaus.jackson.map.ObjectMapper |
createObjectMapper()
Creates a Jackson object mapper based on a media type. |
|
List<Class<?>> |
getObjectClasses(Variant source)
|
|
org.codehaus.jackson.map.ObjectMapper |
getObjectMapper()
Returns the modifiable Jackson object mapper. |
|
List<VariantInfo> |
getVariants(Class<?> source)
|
|
float |
score(Object source,
Variant target,
Resource resource)
|
|
|
score(Representation source,
Class<T> target,
Resource resource)
|
|
void |
setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
Sets the Jackson object mapper. |
|
|
toObject(Representation source,
Class<T> target,
Resource resource)
|
|
Representation |
toRepresentation(Object source,
Variant target,
Resource resource)
|
|
|
updatePreferences(List<Preference<MediaType>> preferences,
Class<T> entity)
|
Methods inherited from class org.restlet.engine.converter.ConverterHelper |
---|
addObjectClass, addVariant, addVariants, getVariants, updatePreferences |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JacksonConverter()
Method Detail |
---|
protected <T> JacksonRepresentation<T> create(MediaType mediaType, T source)
JacksonRepresentation
.
T
- mediaType
- The target media type.source
- The source object to marshal.
JacksonRepresentation
.protected <T> JacksonRepresentation<T> create(Representation source, Class<T> objectClass)
JacksonRepresentation
.
T
- source
- The source representation to unmarshal.objectClass
- The object class to instantiate.
JacksonRepresentation
.protected org.codehaus.jackson.map.ObjectMapper createObjectMapper()
ObjectMapper.ObjectMapper(JsonFactory)
.
public List<Class<?>> getObjectClasses(Variant source)
getObjectClasses
in class ConverterHelper
public org.codehaus.jackson.map.ObjectMapper getObjectMapper()
public List<VariantInfo> getVariants(Class<?> source)
getVariants
in class ConverterHelper
public float score(Object source, Variant target, Resource resource)
score
in class ConverterHelper
public <T> float score(Representation source, Class<T> target, Resource resource)
score
in class ConverterHelper
public void setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
objectMapper
- The Jackson object mapper.public <T> T toObject(Representation source, Class<T> target, Resource resource) throws IOException
toObject
in class ConverterHelper
IOException
public Representation toRepresentation(Object source, Variant target, Resource resource)
toRepresentation
in class ConverterHelper
public <T> void updatePreferences(List<Preference<MediaType>> preferences, Class<T> entity)
updatePreferences
in class ConverterHelper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |