@Provider
@Produces(value={"application/*+xml","text/*+xml"})
@Consumes(value={"application/*+xml","text/*+xml"})
public class XStreamReaderWriterJenkins
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyReader<java.lang.Object>, javax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
XStreamReaderWriter
and should regularly be synced with upstream changes.
The major difference is configuration of XStream classloader.Modifier and Type | Field and Description |
---|---|
static com.thoughtworks.xstream.io.xml.XppDriver |
HIERARCHICAL_STREAM_DRIVER |
Constructor and Description |
---|
XStreamReaderWriterJenkins() |
Modifier and Type | Method and Description |
---|---|
protected com.thoughtworks.xstream.converters.Converter |
constructConverter(java.lang.Class<?> clazz)
Default implementation is to call the parameterless constructor of the Converter.
|
static com.thoughtworks.xstream.XStream |
getConfiguredXStream() |
long |
getSize(java.lang.Object o,
java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
protected void |
init() |
protected boolean |
isForRegisteredConverter(java.lang.Class<?> type,
java.lang.reflect.Type genericType) |
boolean |
isReadable(java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
boolean |
isWriteable(java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
java.lang.Object |
readFrom(java.lang.Class<java.lang.Object> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders,
java.io.InputStream entityStream) |
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.
|
static void |
registerConverter(com.thoughtworks.xstream.converters.Converter converter) |
void |
writeTo(java.lang.Object o,
java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders,
java.io.OutputStream entityStream) |
public static final com.thoughtworks.xstream.io.xml.XppDriver HIERARCHICAL_STREAM_DRIVER
protected void init()
public static void registerConverter(com.thoughtworks.xstream.converters.Converter converter)
public static void registerConfigurationItemAliases()
protected com.thoughtworks.xstream.converters.Converter constructConverter(java.lang.Class<?> clazz)
clazz
- The converter classpublic boolean isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isReadable
in interface javax.ws.rs.ext.MessageBodyReader<java.lang.Object>
protected boolean isForRegisteredConverter(java.lang.Class<?> type, java.lang.reflect.Type genericType)
public java.lang.Object readFrom(java.lang.Class<java.lang.Object> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, java.io.InputStream entityStream) throws java.io.IOException, javax.ws.rs.WebApplicationException
readFrom
in interface javax.ws.rs.ext.MessageBodyReader<java.lang.Object>
java.io.IOException
javax.ws.rs.WebApplicationException
public boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
public long getSize(java.lang.Object o, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
public void writeTo(java.lang.Object o, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream) throws java.io.IOException, javax.ws.rs.WebApplicationException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
java.io.IOException
javax.ws.rs.WebApplicationException
public static com.thoughtworks.xstream.XStream getConfiguredXStream()