Class XmlJaxbElementProvider

    • Field Detail

      • spf

        private final javax.inject.Provider<javax.xml.parsers.SAXParserFactory> spf
    • Constructor Detail

      • XmlJaxbElementProvider

        public XmlJaxbElementProvider​(javax.inject.Provider<javax.xml.parsers.SAXParserFactory> spf,
                                      javax.ws.rs.ext.Providers ps)
      • XmlJaxbElementProvider

        public XmlJaxbElementProvider​(javax.inject.Provider<javax.xml.parsers.SAXParserFactory> spf,
                                      javax.ws.rs.ext.Providers ps,
                                      javax.ws.rs.core.MediaType mt)
    • Method Detail

      • readFrom

        protected final javax.xml.bind.JAXBElement<?> readFrom​(java.lang.Class<?> type,
                                                               javax.ws.rs.core.MediaType mediaType,
                                                               javax.xml.bind.Unmarshaller unmarshaller,
                                                               java.io.InputStream entityStream)
                                                        throws javax.xml.bind.JAXBException
        Description copied from class: AbstractJaxbElementProvider
        Read JAXB element from an entity stream.
        Specified by:
        readFrom in class AbstractJaxbElementProvider
        Parameters:
        type - the type that is to be read from the entity stream.
        mediaType - the media type of the HTTP entity.
        unmarshaller - JAXB unmarshaller to be used.
        entityStream - the InputStream of the HTTP entity. The caller is responsible for ensuring that the input stream ends when the entity has been consumed. The implementation should not close the input stream.
        Returns:
        JAXB element representing the entity.
        Throws:
        javax.xml.bind.JAXBException - in case entity unmarshalling fails.
      • writeTo

        protected final void writeTo​(javax.xml.bind.JAXBElement<?> t,
                                     javax.ws.rs.core.MediaType mediaType,
                                     java.nio.charset.Charset c,
                                     javax.xml.bind.Marshaller m,
                                     java.io.OutputStream entityStream)
                              throws javax.xml.bind.JAXBException
        Description copied from class: AbstractJaxbElementProvider
        Write JAXB element to an entity stream.
        Specified by:
        writeTo in class AbstractJaxbElementProvider
        Parameters:
        t - JAXB element to be written to an entity stream.
        mediaType - the media type of the HTTP entity.
        c - character set to be used.
        m - JAXB unmarshaller to be used.
        entityStream - the InputStream of the HTTP entity. The caller is responsible for ensuring that the input stream ends when the entity has been consumed. The implementation should not close the input stream.
        Throws:
        javax.xml.bind.JAXBException - in case entity marshalling fails.