public class PolygeneConverter
extends org.restlet.engine.converter.ConverterHelper
Constructor and Description |
---|
PolygeneConverter(ObjectFactory objectFactory) |
Modifier and Type | Method and Description |
---|---|
protected <T> org.restlet.representation.Representation |
create(org.restlet.data.MediaType mediaType,
T source)
Creates the marshaling
JsonRepresentation . |
protected <T> org.restlet.representation.Representation |
create(org.restlet.representation.Representation source,
Class<T> objectClass)
Creates the unmarshaling
JsonRepresentation . |
List<Class<?>> |
getObjectClasses(org.restlet.representation.Variant source) |
ObjectFactory |
getObjectFactory() |
List<org.restlet.engine.resource.VariantInfo> |
getVariants(Class<?> source) |
protected boolean |
isCompatible(org.restlet.representation.Variant variant)
Indicates if the given variant is compatible with the media types
supported by this converter.
|
float |
score(Object source,
org.restlet.representation.Variant target,
org.restlet.resource.Resource resource) |
<T> float |
score(org.restlet.representation.Representation source,
Class<T> target,
org.restlet.resource.Resource resource) |
<T> T |
toObject(org.restlet.representation.Representation source,
Class<T> target,
org.restlet.resource.Resource resources) |
org.restlet.representation.Representation |
toRepresentation(Object source,
org.restlet.representation.Variant target,
org.restlet.resource.Resource resource) |
<T> void |
updatePreferences(List<org.restlet.data.Preference<org.restlet.data.MediaType>> preferences,
Class<T> entity) |
public PolygeneConverter(ObjectFactory objectFactory)
protected <T> org.restlet.representation.Representation create(org.restlet.data.MediaType mediaType, T source)
JsonRepresentation
.mediaType
- The target media type.source
- The source object to marshal.JsonRepresentation
.protected <T> org.restlet.representation.Representation create(org.restlet.representation.Representation source, Class<T> objectClass)
JsonRepresentation
.source
- The source representation to unmarshal.objectClass
- The object class to instantiate.JsonRepresentation
.public ObjectFactory getObjectFactory()
public List<Class<?>> getObjectClasses(org.restlet.representation.Variant source)
getObjectClasses
in class org.restlet.engine.converter.ConverterHelper
public List<org.restlet.engine.resource.VariantInfo> getVariants(Class<?> source)
getVariants
in class org.restlet.engine.converter.ConverterHelper
protected boolean isCompatible(org.restlet.representation.Variant variant)
variant
- The variant.public float score(Object source, org.restlet.representation.Variant target, org.restlet.resource.Resource resource)
score
in class org.restlet.engine.converter.ConverterHelper
public <T> float score(org.restlet.representation.Representation source, Class<T> target, org.restlet.resource.Resource resource)
score
in class org.restlet.engine.converter.ConverterHelper
public <T> T toObject(org.restlet.representation.Representation source, Class<T> target, org.restlet.resource.Resource resources) throws IOException
toObject
in class org.restlet.engine.converter.ConverterHelper
IOException
public org.restlet.representation.Representation toRepresentation(Object source, org.restlet.representation.Variant target, org.restlet.resource.Resource resource)
toRepresentation
in class org.restlet.engine.converter.ConverterHelper