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:
jakarta.ws.rs.ext.MessageBodyReader<T>, jakarta.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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.xml.bind.MarshallerdecorateMarshaller(Class type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Marshaller marshaller) static jakarta.xml.bind.UnmarshallerdecorateUnmarshaller(Class type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Unmarshaller marshaller) jakarta.xml.bind.JAXBContextfindJAXBContext(Class<?> type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, boolean reader) static StringgetCharset(jakarta.ws.rs.core.MediaType mediaType) Gets the character set from media type.protected jakarta.xml.bind.MarshallergetMarshaller(Class<?> type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) Retrieve JAXB marshaller.booleanbooleanbooleanbooleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) protected abstract booleanisReadWritable(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) protected booleanprotected TprocessWithSecureProcessing(jakarta.xml.bind.Unmarshaller unmarshaller, InputStream entityStream, String charset) readFrom(Class<T> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) static voidsetCharset(jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Marshaller marshaller) voidsetDisableDTDs(boolean disableDTDs) voidsetDisableExternalEntities(boolean disableExternalEntities) voidsetEnableSecureProcessingFeature(boolean enableSecureProcessingFeature) voidwriteTo(T t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream outputStream) Methods inherited from class AbstractEntityProvider
getSizeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AsyncBufferedMessageBodyWriter
asyncWriteToMethods inherited from interface jakarta.ws.rs.ext.MessageBodyWriter
getSize
-
Field Details
-
providers
@Context protected jakarta.ws.rs.ext.Providers providers
-
-
Constructor Details
-
AbstractJAXBProvider
public AbstractJAXBProvider()
-
-
Method Details
-
findJAXBContext
public jakarta.xml.bind.JAXBContext findJAXBContext(Class<?> type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, boolean reader) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
decorateMarshaller
public static jakarta.xml.bind.Marshaller decorateMarshaller(Class type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Marshaller marshaller) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
decorateUnmarshaller
public static jakarta.xml.bind.Unmarshaller decorateUnmarshaller(Class type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Unmarshaller marshaller) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
readFrom
public T readFrom(Class<T> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException- Specified by:
readFromin interfacejakarta.ws.rs.ext.MessageBodyReader<T>- Throws:
IOException
-
writeTo
public void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream outputStream) throws IOException- Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<T>- Throws:
IOException
-
getMarshaller
protected jakarta.xml.bind.Marshaller getMarshaller(Class<?> type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) Retrieve JAXB marshaller.- Parameters:
type- typeannotations- annotationsmediaType- media type- Returns:
- jaxb marshaller
-
setCharset
public static void setCharset(jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Marshaller marshaller) throws jakarta.xml.bind.PropertyException - Throws:
jakarta.xml.bind.PropertyException
-
isReadWritable
protected abstract boolean isReadWritable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) -
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isReadablein interfacejakarta.ws.rs.ext.MessageBodyReader<T>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
-
getCharset
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(jakarta.xml.bind.Unmarshaller unmarshaller, InputStream entityStream, String charset) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-