org.restlet.ext.jaxb
Class JaxbConverter
java.lang.Object
org.restlet.engine.Helper
org.restlet.engine.converter.ConverterHelper
org.restlet.ext.jaxb.JaxbConverter
public class JaxbConverter
- extends ConverterHelper
A JAXB Converter Helper to convert from JAXB objects to JaxbRepresentations
and vice versa.
- Author:
- Sanjay Acharya
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JaxbConverter
public JaxbConverter()
getObjectClasses
public List<Class<?>> getObjectClasses(Variant source)
- Specified by:
getObjectClasses
in class ConverterHelper
getVariants
public List<VariantInfo> getVariants(Class<?> source)
- Specified by:
getVariants
in class ConverterHelper
isCompatible
protected boolean isCompatible(MediaType mediaType)
- Indicates if the given mediaType is compatible with the media types
supported by this converter.
- Parameters:
mediaType
- The mediaType.
- Returns:
- True if the given mediaType is compatible with the media types
supported by this converter.
isCompatible
protected boolean isCompatible(Variant variant)
- Indicates if the given variant is compatible with the media types
supported by this converter.
- Parameters:
variant
- The variant.
- Returns:
- True if the given variant is compatible with the media types
supported by this converter.
score
public float score(Object source,
Variant target,
Resource resource)
- Specified by:
score
in class ConverterHelper
score
public <T> float score(Representation source,
Class<T> target,
Resource resource)
- Specified by:
score
in class ConverterHelper
toObject
public <T> T toObject(Representation source,
Class<T> target,
Resource resource)
throws IOException
- Specified by:
toObject
in class ConverterHelper
- Throws:
IOException
toRepresentation
public Representation toRepresentation(Object source,
Variant target,
Resource resource)
- Specified by:
toRepresentation
in class ConverterHelper
updatePreferences
public <T> void updatePreferences(List<Preference<MediaType>> preferences,
Class<T> entity)
- Overrides:
updatePreferences
in class ConverterHelper
Copyright © 2005-2014 Restlet.