Package 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 org.restlet.engine.converter.ConverterHelper
A JAXB Converter Helper to convert from JAXB objects to JaxbRepresentations and vice versa.- Author:
- Sanjay Acharya
-
-
Constructor Summary
Constructors Constructor Description JaxbConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Class<?>>
getObjectClasses(org.restlet.representation.Variant source)
java.util.List<org.restlet.engine.resource.VariantInfo>
getVariants(java.lang.Class<?> source)
protected boolean
isCompatible(org.restlet.data.MediaType mediaType)
Indicates if the given mediaType is compatible with the media types supported by this converter.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(java.lang.Object source, org.restlet.representation.Variant target, org.restlet.resource.Resource resource)
<T> float
score(org.restlet.representation.Representation source, java.lang.Class<T> target, org.restlet.resource.Resource resource)
<T> T
toObject(org.restlet.representation.Representation source, java.lang.Class<T> target, org.restlet.resource.Resource resource)
org.restlet.representation.Representation
toRepresentation(java.lang.Object source, org.restlet.representation.Variant target, org.restlet.resource.Resource resource)
<T> void
updatePreferences(java.util.List<org.restlet.data.Preference<org.restlet.data.MediaType>> preferences, java.lang.Class<T> entity)
-
-
-
Method Detail
-
getObjectClasses
public java.util.List<java.lang.Class<?>> getObjectClasses(org.restlet.representation.Variant source)
- Specified by:
getObjectClasses
in classorg.restlet.engine.converter.ConverterHelper
-
getVariants
public java.util.List<org.restlet.engine.resource.VariantInfo> getVariants(java.lang.Class<?> source)
- Specified by:
getVariants
in classorg.restlet.engine.converter.ConverterHelper
-
isCompatible
protected boolean isCompatible(org.restlet.data.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(org.restlet.representation.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(java.lang.Object source, org.restlet.representation.Variant target, org.restlet.resource.Resource resource)
- Specified by:
score
in classorg.restlet.engine.converter.ConverterHelper
-
score
public <T> float score(org.restlet.representation.Representation source, java.lang.Class<T> target, org.restlet.resource.Resource resource)
- Specified by:
score
in classorg.restlet.engine.converter.ConverterHelper
-
toObject
public <T> T toObject(org.restlet.representation.Representation source, java.lang.Class<T> target, org.restlet.resource.Resource resource) throws java.io.IOException
- Specified by:
toObject
in classorg.restlet.engine.converter.ConverterHelper
- Throws:
java.io.IOException
-
toRepresentation
public org.restlet.representation.Representation toRepresentation(java.lang.Object source, org.restlet.representation.Variant target, org.restlet.resource.Resource resource)
- Specified by:
toRepresentation
in classorg.restlet.engine.converter.ConverterHelper
-
updatePreferences
public <T> void updatePreferences(java.util.List<org.restlet.data.Preference<org.restlet.data.MediaType>> preferences, java.lang.Class<T> entity)
- Overrides:
updatePreferences
in classorg.restlet.engine.converter.ConverterHelper
-
-