@Deprecated public class XstreamConverter extends ConverterHelper
createXstream(MediaType, Class) method and apply your own security
permissions, and provide this new converter to the Restlet Engine (see
org.restlet.engine.Engine#getRegisteredConverters method).| Constructor and Description |
|---|
XstreamConverter()
Deprecated.
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T> XstreamRepresentation<T> |
create(MediaType mediaType,
T source)
Deprecated.
Creates the marshaling
XstreamRepresentation. |
protected <T> XstreamRepresentation<T> |
create(Representation source,
Class<T> target)
Deprecated.
Creates the unmarshaling
XstreamRepresentation. |
<T> com.thoughtworks.xstream.XStream |
createXstream(MediaType mediaType,
Class<T> target)
Deprecated.
Creates an XStream object based on a media type.
|
Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> |
getJsonDriverClass()
Deprecated.
Returns the XStream JSON driver class.
|
List<Class<?>> |
getObjectClasses(Variant source)
Deprecated.
Returns the list of object classes that can be converted from a given
variant.
|
List<VariantInfo> |
getVariants(Class<?> source)
Deprecated.
Returns the list of variants that can be converted from a given object
class.
|
Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> |
getXmlDriverClass()
Deprecated.
Returns the XStream XML driver class.
|
float |
score(Object source,
Variant target,
Resource resource)
Deprecated.
Scores the affinity of this helper with the source class.
|
<T> float |
score(Representation source,
Class<T> target,
Resource resource)
Deprecated.
Scores the affinity of this helper with the source class.
|
void |
setJsonDriverClass(Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> jsonDriverClass)
Deprecated.
Sets the XStream JSON driver class.
|
void |
setXmlDriverClass(Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> xmlDriverClass)
Deprecated.
Sets the XStream XML driver class.
|
<T> T |
toObject(Representation source,
Class<T> target,
Resource resource)
Deprecated.
Converts a Representation into a regular Java object.
|
Representation |
toRepresentation(Object source,
Variant target,
Resource resource)
Deprecated.
Converts a regular Java object into a Representation.
|
<T> void |
updatePreferences(List<Preference<MediaType>> preferences,
Class<T> entity)
Deprecated.
Updates the preferences of the given
ClientInfo object with
conversion capabilities for the given entity class. |
addObjectClass, addVariant, addVariants, getVariants, updatePreferencesprotected <T> XstreamRepresentation<T> create(MediaType mediaType, T source)
XstreamRepresentation.T - mediaType - The target media type.source - The source object to marshal.XstreamRepresentation.protected <T> XstreamRepresentation<T> create(Representation source, Class<T> target) throws IOException
XstreamRepresentation.T - source - The source representation to unmarshal.target - The expected class of the Java object.XstreamRepresentation.IOExceptionpublic <T> com.thoughtworks.xstream.XStream createXstream(MediaType mediaType, Class<T> target) throws IOException
HierarchicalStreamDriver or a DomDriver. To be overriden
in order to customize security permissions.T - mediaType - The serialization media type.target - The expected class of the Java object.IOExceptionpublic Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> getJsonDriverClass()
public List<Class<?>> getObjectClasses(Variant source)
ConverterHelpergetObjectClasses in class ConverterHelpersource - The source variant.public List<VariantInfo> getVariants(Class<?> source)
ConverterHelpergetVariants in class ConverterHelpersource - The source object class.public Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> getXmlDriverClass()
public float score(Object source, Variant target, Resource resource)
ConverterHelperscore in class ConverterHelpersource - The source object to convert.target - The expected representation metadata.resource - The calling resource.public <T> float score(Representation source, Class<T> target, Resource resource)
ConverterHelperscore in class ConverterHelpersource - The source representation to convert.target - The expected class of the Java object.resource - The calling resource.public void setJsonDriverClass(Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> jsonDriverClass)
jsonDriverClass - The XStream JSON driver class.public void setXmlDriverClass(Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> xmlDriverClass)
xmlDriverClass - The XStream XML driver class.public <T> T toObject(Representation source, Class<T> target, Resource resource) throws IOException
ConverterHelpertoObject in class ConverterHelperT - 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.IOExceptionpublic Representation toRepresentation(Object source, Variant target, Resource resource)
ConverterHelpertoRepresentation in class ConverterHelpersource - The source object to convert.target - The expected representation metadata.resource - The calling resource.public <T> void updatePreferences(List<Preference<MediaType>> preferences, Class<T> entity)
ConverterHelperClientInfo object with
conversion capabilities for the given entity class.updatePreferences in class ConverterHelperpreferences - The media type preferences.entity - The entity class to convert.Copyright © 2005–2016. All rights reserved.