public class GsonConverter extends ConverterHelper
Constructor and Description |
---|
GsonConverter() |
Modifier and Type | Method and Description |
---|---|
protected <T> GsonRepresentation<T> |
create(Representation source,
Class<T> objectClass)
Creates the unmarshaling
GsonRepresentation . |
protected <T> GsonRepresentation<T> |
create(T source)
Creates the marshaling
GsonRepresentation . |
List<Class<?>> |
getObjectClasses(Variant source) |
List<VariantInfo> |
getVariants(Class<?> source) |
float |
score(Object source,
Variant target,
Resource resource) |
<T> float |
score(Representation source,
Class<T> target,
Resource resource) |
<T> T |
toObject(Representation source,
Class<T> target,
Resource resource) |
Representation |
toRepresentation(Object source,
Variant target,
Resource resource) |
<T> void |
updatePreferences(List<Preference<MediaType>> preferences,
Class<T> entity) |
addObjectClass, addVariant, addVariants, getVariants, updatePreferences
protected <T> GsonRepresentation<T> create(Representation source, Class<T> objectClass)
GsonRepresentation
.T
- source
- The source representation to unmarshal.objectClass
- The object class to instantiate.GsonRepresentation
.protected <T> GsonRepresentation<T> create(T source)
GsonRepresentation
.T
- source
- The source object to marshal.GsonRepresentation
.public List<Class<?>> getObjectClasses(Variant source)
getObjectClasses
in class ConverterHelper
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 <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) throws IOException
toRepresentation
in class ConverterHelper
IOException
public <T> void updatePreferences(List<Preference<MediaType>> preferences, Class<T> entity)
updatePreferences
in class ConverterHelper
Copyright © 2005-2017 Restlet.