public class ConverterService extends Service
| Constructor and Description |
|---|
ConverterService()
Constructor.
|
ConverterService(boolean enabled)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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<? extends Variant> |
getVariants(java.lang.Class<?> source,
Variant target)
Returns the list of variants that can be converted from a given object
class.
|
java.lang.Object |
toObject(Representation source)
Converts a Representation into a regular Java object.
|
<T> T |
toObject(Representation source,
java.lang.Class<T> target,
UniformResource resource)
Converts a Representation into a regular Java object.
|
Representation |
toRepresentation(java.lang.Object source)
Converts a regular Java object into a Representation.
|
Representation |
toRepresentation(java.lang.Object source,
Variant target,
UniformResource resource)
Converts a regular Java object into a Representation.
|
void |
updatePreferences(java.util.List<Preference<MediaType>> preferences,
java.lang.Class<?> entity)
Updates the media type preferences with available conversion capabilities
for the given entity class.
|
createInboundFilter, createOutboundFilter, getContext, isEnabled, isStarted, isStopped, setContext, setEnabled, start, stoppublic ConverterService()
public ConverterService(boolean enabled)
enabled - True if the service has been enabled.public java.util.List<java.lang.Class<?>> getObjectClasses(Variant source)
source - The source variant.public java.util.List<? extends Variant> getVariants(java.lang.Class<?> source, Variant target)
source - The source class.target - The expected representation metadata.public java.lang.Object toObject(Representation source) throws java.io.IOException
source - The source representation to convert.java.io.IOExceptionpublic <T> T toObject(Representation source, java.lang.Class<T> target, UniformResource resource) throws java.io.IOException
T - The expected class of the Java object.source - The source representation to convert.target - The target class of the Java object.resource - The parent resource.java.io.IOExceptionpublic Representation toRepresentation(java.lang.Object source)
source - The source object to convert.public Representation toRepresentation(java.lang.Object source, Variant target, UniformResource resource)
source - The source object to convert.target - The target representation variant.resource - The parent resource.public void updatePreferences(java.util.List<Preference<MediaType>> preferences, java.lang.Class<?> entity)
preferences - The media type preferences.entity - The entity class to convert.Copyright © 2005-2012. All Rights Reserved.