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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.xml.bind.Marshaller
decorateMarshaller
(Class type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Marshaller marshaller) static jakarta.xml.bind.Unmarshaller
decorateUnmarshaller
(Class type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Unmarshaller marshaller) jakarta.xml.bind.JAXBContext
findJAXBContext
(Class<?> type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, boolean reader) static String
getCharset
(jakarta.ws.rs.core.MediaType mediaType) Gets the character set from media type.protected jakarta.xml.bind.Marshaller
getMarshaller
(Class<?> type, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) Retrieve JAXB marshaller.boolean
boolean
boolean
boolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) protected abstract boolean
isReadWritable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) protected boolean
protected T
processWithSecureProcessing
(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 void
setCharset
(jakarta.ws.rs.core.MediaType mediaType, jakarta.xml.bind.Marshaller marshaller) void
setDisableDTDs
(boolean disableDTDs) void
setDisableExternalEntities
(boolean disableExternalEntities) void
setEnableSecureProcessingFeature
(boolean enableSecureProcessingFeature) 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) 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
Methods 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:
readFrom
in 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:
writeTo
in 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:
isReadable
in interfacejakarta.ws.rs.ext.MessageBodyReader<T>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteable
in 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
-