Package org.jboss.resteasy.plugins.providers.jaxb

## 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.Providers` | `providers` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractJAXBProvider()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Marshaller` | `decorateMarshaller​(Class type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, Marshaller marshaller)` |
    `static Unmarshaller` | `decorateUnmarshaller​(Class type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, Unmarshaller marshaller)` |
    `JAXBContext` | `findJAXBContext​(Class<?> type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, boolean reader)` |
    `static String` | `getCharset​(javax.ws.rs.core.MediaType mediaType)` | Gets the character set from media type.
    `protected Marshaller` | `getMarshaller​(Class<?> type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` | Retrieve JAXB marshaller.
    `boolean` | `isDisableDTDs()` |
    `boolean` | `isDisableExternalEntities()` |
    `boolean` | `isEnableSecureProcessingFeature()` |
    `boolean` | `isReadable​(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` |
    `protected abstract boolean` | `isReadWritable​(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` |
    `boolean` | `isWriteable​(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` |
    `protected boolean` | `needsSecurity()` |
    `protected T` | `processWithSecureProcessing​(Unmarshaller unmarshaller, InputStream entityStream, String charset)` |
    `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)` |
    `static void` | `setCharset​(javax.ws.rs.core.MediaType mediaType, Marshaller marshaller)` |
    `void` | `setDisableDTDs​(boolean disableDTDs)` |
    `void` | `setDisableExternalEntities​(boolean disableExternalEntities)` |
    `void` | `setEnableSecureProcessingFeature​(boolean enableSecureProcessingFeature)` |
    `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)` |

    - ### 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 javax.ws.rs.ext.MessageBodyWriter

      `getSize`

- - ### Field Detail

    - #### providers

          @Context
          protected javax.ws.rs.ext.Providers providers

  - ### Constructor Detail

    - #### AbstractJAXBProvider

          public AbstractJAXBProvider()

  - ### 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:
        `readFrom` in interface `javax.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:
        `writeTo` in interface `javax.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` - type
        `annotations` - annotations
        `mediaType` - 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:
        `isReadable` in interface `javax.ws.rs.ext.MessageBodyReader<T>`

    - #### isWriteable

          public boolean isWriteable​(Class<?> type,
                                     Type genericType,
                                     Annotation[] annotations,
                                     javax.ws.rs.core.MediaType mediaType)

      Specified by:
        `isWriteable` in interface `javax.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`