Class AbstractJAXBProvider<T>
- java.lang.Object
-
- org.jboss.resteasy.plugins.providers.AbstractEntityProvider<T>
-
- org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider<T>
-
- Type Parameters:
T- type
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>,javax.ws.rs.ext.MessageBodyWriter<T>,AsyncBufferedMessageBodyWriter<T>,AsyncMessageBodyWriter<T>
- Direct Known Subclasses:
JAXBElementProvider,JAXBXmlRootElementProvider,JAXBXmlSeeAlsoProvider,JAXBXmlTypeProvider,XopWithMultipartRelatedJAXBProvider
public abstract class AbstractJAXBProvider<T> extends AbstractEntityProvider<T> implements AsyncBufferedMessageBodyWriter<T>
A AbstractJAXBProvider.- Version:
- $Revision:$
- Author:
- Ryan J. McDonough
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.ws.rs.ext.Providersproviders
-
Constructor Summary
Constructors Constructor Description AbstractJAXBProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MarshallerdecorateMarshaller(Class type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, Marshaller marshaller)static UnmarshallerdecorateUnmarshaller(Class type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, Unmarshaller marshaller)JAXBContextfindJAXBContext(Class<?> type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, boolean reader)static StringgetCharset(javax.ws.rs.core.MediaType mediaType)Gets the character set from media type.protected MarshallergetMarshaller(Class<?> type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)Retrieve JAXB marshaller.booleanisDisableDTDs()booleanisDisableExternalEntities()booleanisEnableSecureProcessingFeature()booleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)protected abstract booleanisReadWritable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)protected booleanneedsSecurity()protected TprocessWithSecureProcessing(Unmarshaller unmarshaller, InputStream entityStream, String charset)TreadFrom(Class<T> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)static voidsetCharset(javax.ws.rs.core.MediaType mediaType, Marshaller marshaller)voidsetDisableDTDs(boolean disableDTDs)voidsetDisableExternalEntities(boolean disableExternalEntities)voidsetEnableSecureProcessingFeature(boolean enableSecureProcessingFeature)voidwriteTo(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outputStream)-
Methods inherited from class org.jboss.resteasy.plugins.providers.AbstractEntityProvider
getSize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.resteasy.core.messagebody.AsyncBufferedMessageBodyWriter
asyncWriteTo
-
-
-
-
Method Detail
-
findJAXBContext
public JAXBContext findJAXBContext(Class<?> type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, boolean reader) throws JAXBException
- Throws:
JAXBException
-
decorateMarshaller
public static Marshaller decorateMarshaller(Class type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, Marshaller marshaller) throws JAXBException
- Throws:
JAXBException
-
decorateUnmarshaller
public static Unmarshaller decorateUnmarshaller(Class type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, Unmarshaller marshaller) throws JAXBException
- Throws:
JAXBException
-
readFrom
public T readFrom(Class<T> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException
- Specified by:
readFromin interfacejavax.ws.rs.ext.MessageBodyReader<T>- Throws:
IOException
-
writeTo
public void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outputStream) throws IOException
- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<T>- Throws:
IOException
-
getMarshaller
protected Marshaller getMarshaller(Class<?> type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
Retrieve JAXB marshaller.- Parameters:
type- typeannotations- annotationsmediaType- media type- Returns:
- jaxb marshaller
-
setCharset
public static void setCharset(javax.ws.rs.core.MediaType mediaType, Marshaller marshaller) throws PropertyException- Throws:
PropertyException
-
isReadWritable
protected abstract boolean isReadWritable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
isReadablein interfacejavax.ws.rs.ext.MessageBodyReader<T>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<T>
-
getCharset
public static String getCharset(javax.ws.rs.core.MediaType mediaType)
Gets the character set from media type.- Parameters:
mediaType- media type- Returns:
- charset
-
isDisableExternalEntities
public boolean isDisableExternalEntities()
-
setDisableExternalEntities
public void setDisableExternalEntities(boolean disableExternalEntities)
-
isEnableSecureProcessingFeature
public boolean isEnableSecureProcessingFeature()
-
setEnableSecureProcessingFeature
public void setEnableSecureProcessingFeature(boolean enableSecureProcessingFeature)
-
isDisableDTDs
public boolean isDisableDTDs()
-
setDisableDTDs
public void setDisableDTDs(boolean disableDTDs)
-
needsSecurity
protected boolean needsSecurity()
-
processWithSecureProcessing
protected T processWithSecureProcessing(Unmarshaller unmarshaller, InputStream entityStream, String charset) throws JAXBException
- Throws:
JAXBException
-
-