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 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 interface jakarta.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 interface jakarta.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 - type
      annotations - annotations
      mediaType - 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 interface jakarta.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 interface jakarta.ws.rs.ext.MessageBodyWriter<T>
    • getCharset

      public static String getCharset(jakarta.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(jakarta.xml.bind.Unmarshaller unmarshaller, InputStream entityStream, String charset) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException