Class XStreamReaderWriter
java.lang.Object
com.xebialabs.xltype.serialization.xstream.XStreamReaderWriter
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<Object>,jakarta.ws.rs.ext.MessageBodyWriter<Object>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.thoughtworks.xstream.io.xml.XppDriver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.thoughtworks.xstream.converters.ConverterconstructConverter(Class<?> clazz) Default implementation is to call the parameterless constructor of the Converter.protected com.thoughtworks.xstream.converters.DataHolderstatic com.thoughtworks.xstream.XStreamlonggetSize(Object o, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) protected voidinit()protected booleanisForRegisteredConverter(Class<?> type, Type genericType) booleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) readFrom(Class<Object> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) static voidThis is separate, as remote we need to have fetched the descriptors first, before we have the types to initialize XStream with.static voidregisterConverter(com.thoughtworks.xstream.converters.Converter converter) voidwriteTo(Object o, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
-
Field Details
-
HIERARCHICAL_STREAM_DRIVER
public static final com.thoughtworks.xstream.io.xml.XppDriver HIERARCHICAL_STREAM_DRIVER
-
-
Constructor Details
-
XStreamReaderWriter
public XStreamReaderWriter()
-
-
Method Details
-
init
protected void init() -
registerConverter
public static void registerConverter(com.thoughtworks.xstream.converters.Converter converter) -
registerConfigurationItemAliases
public static void registerConfigurationItemAliases()This is separate, as remote we need to have fetched the descriptors first, before we have the types to initialize XStream with. -
constructConverter
Default implementation is to call the parameterless constructor of the Converter. But can be overridden to look for the correct converter in for instance a Spring context.- Parameters:
clazz- The converter class- Returns:
- The instantiated converter.
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isReadablein interfacejakarta.ws.rs.ext.MessageBodyReader<Object>
-
isForRegisteredConverter
-
readFrom
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
readFromin interfacejakarta.ws.rs.ext.MessageBodyReader<Object>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-
createDataHolder
protected com.thoughtworks.xstream.converters.DataHolder createDataHolder() -
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<Object>
-
getSize
public long getSize(Object o, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfacejakarta.ws.rs.ext.MessageBodyWriter<Object>
-
writeTo
public void writeTo(Object o, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<Object>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-
getConfiguredXStream
public static com.thoughtworks.xstream.XStream getConfiguredXStream()
-