|
||||||||||
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.engine.converter.DefaultConverter
public class DefaultConverter
Converter for the built-in Representation classes.
Constructor Summary | |
---|---|
DefaultConverter()
|
Method Summary | ||
---|---|---|
java.util.List<java.lang.Class<?>> |
getObjectClasses(Variant source)
Returns the list of object classes that can be converted from a given variant. |
|
java.util.List<VariantInfo> |
getVariants(java.lang.Class<?> source)
Returns the list of variants that can be converted from a given object class. |
|
float |
score(java.lang.Object source,
Variant target,
Resource resource)
Scores the affinity of this helper with the source class. |
|
|
score(Representation source,
java.lang.Class<T> target,
Resource resource)
Scores the affinity of this helper with the source class. |
|
|
toObject(Representation source,
java.lang.Class<T> target,
Resource resource)
Converts a Representation into a regular Java object. |
|
Representation |
toRepresentation(java.lang.Object source,
Variant target,
Resource resource)
Converts a regular Java object into a Representation. |
|
|
updatePreferences(java.util.List<Preference<MediaType>> preferences,
java.lang.Class<T> entity)
Updates the preferences of the given ClientInfo object with
conversion capabilities for the given entity class. |
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 DefaultConverter()
Method Detail |
---|
public java.util.List<java.lang.Class<?>> getObjectClasses(Variant source)
ConverterHelper
getObjectClasses
in class ConverterHelper
source
- The source variant.
public java.util.List<VariantInfo> getVariants(java.lang.Class<?> source)
ConverterHelper
getVariants
in class ConverterHelper
source
- The source object class.
public float score(java.lang.Object source, Variant target, Resource resource)
ConverterHelper
score
in class ConverterHelper
source
- The source object to convert.target
- The expected representation metadata.resource
- The calling resource.
public <T> float score(Representation source, java.lang.Class<T> target, Resource resource)
ConverterHelper
score
in class ConverterHelper
source
- The source representation to convert.target
- The expected class of the Java object.resource
- The calling resource.
public <T> T toObject(Representation source, java.lang.Class<T> target, Resource resource) throws java.io.IOException
ConverterHelper
toObject
in class ConverterHelper
T
- The expected class of the Java object.source
- The source representation to convert.target
- The expected class of the Java object.resource
- The calling resource.
java.io.IOException
public Representation toRepresentation(java.lang.Object source, Variant target, Resource resource) throws java.io.IOException
ConverterHelper
toRepresentation
in class ConverterHelper
source
- The source object to convert.target
- The expected representation metadata.resource
- The calling resource.
java.io.IOException
public <T> void updatePreferences(java.util.List<Preference<MediaType>> preferences, java.lang.Class<T> entity)
ConverterHelper
ClientInfo
object with
conversion capabilities for the given entity class.
updatePreferences
in class ConverterHelper
preferences
- The media type preferences.entity
- The entity class to convert.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |