public class JacksonConverter extends ConverterHelper
Constructor and Description |
---|
JacksonConverter() |
Modifier and Type | Method and Description |
---|---|
protected <T> JacksonRepresentation<T> |
create(MediaType mediaType,
T source)
Creates the marshaling
JacksonRepresentation . |
protected <T> JacksonRepresentation<T> |
create(Representation source,
java.lang.Class<T> objectClass)
Creates the unmarshaling
JacksonRepresentation . |
java.util.List<java.lang.Class<?>> |
getObjectClasses(Variant source) |
java.util.List<VariantInfo> |
getVariants(java.lang.Class<?> source) |
protected boolean |
isCompatible(Variant variant)
Indicates if the given variant is compatible with the media types
supported by this converter.
|
float |
score(java.lang.Object source,
Variant target,
Resource resource) |
<T> float |
score(Representation source,
java.lang.Class<T> target,
Resource resource) |
<T> T |
toObject(Representation source,
java.lang.Class<T> target,
Resource resource) |
Representation |
toRepresentation(java.lang.Object source,
Variant target,
Resource resource) |
<T> void |
updatePreferences(java.util.List<Preference<MediaType>> preferences,
java.lang.Class<T> entity) |
addObjectClass, addVariant, addVariants, getVariants, updatePreferences
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, java.lang.Class<T> objectClass)
JacksonRepresentation
.T
- source
- The source representation to unmarshal.objectClass
- The object class to instantiate.JacksonRepresentation
.public java.util.List<java.lang.Class<?>> getObjectClasses(Variant source)
getObjectClasses
in class ConverterHelper
public java.util.List<VariantInfo> getVariants(java.lang.Class<?> source)
getVariants
in class ConverterHelper
protected boolean isCompatible(Variant variant)
variant
- The variant.public float score(java.lang.Object source, Variant target, Resource resource)
score
in class ConverterHelper
public <T> float score(Representation source, java.lang.Class<T> target, Resource resource)
score
in class ConverterHelper
public <T> T toObject(Representation source, java.lang.Class<T> target, Resource resource) throws java.io.IOException
toObject
in class ConverterHelper
java.io.IOException
public Representation toRepresentation(java.lang.Object source, Variant target, Resource resource)
toRepresentation
in class ConverterHelper
public <T> void updatePreferences(java.util.List<Preference<MediaType>> preferences, java.lang.Class<T> entity)
updatePreferences
in class ConverterHelper
Copyright © 2005-2020 Restlet.