public class GsonConverter extends ConverterHelper
Constructor and Description |
---|
GsonConverter() |
Modifier and Type | Method and Description |
---|---|
protected <T> GsonRepresentation<T> |
create(Representation source,
java.lang.Class<T> objectClass)
Creates the unmarshaling
GsonRepresentation . |
protected <T> GsonRepresentation<T> |
create(T source)
Creates the marshaling
GsonRepresentation . |
java.util.List<java.lang.Class<?>> |
getObjectClasses(Variant source) |
java.util.List<VariantInfo> |
getVariants(java.lang.Class<?> source) |
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> GsonRepresentation<T> create(Representation source, java.lang.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 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
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) throws java.io.IOException
toRepresentation
in class ConverterHelper
java.io.IOException
public <T> void updatePreferences(java.util.List<Preference<MediaType>> preferences, java.lang.Class<T> entity)
updatePreferences
in class ConverterHelper
Copyright © 2005-2020 Restlet.