Class XmlCollectionJaxbProvider

    • Field Detail

      • xif

        private final javax.inject.Provider<javax.xml.stream.XMLInputFactory> xif
    • Constructor Detail

      • XmlCollectionJaxbProvider

        XmlCollectionJaxbProvider​(javax.inject.Provider<javax.xml.stream.XMLInputFactory> xif,
                                  javax.ws.rs.ext.Providers ps)
      • XmlCollectionJaxbProvider

        XmlCollectionJaxbProvider​(javax.inject.Provider<javax.xml.stream.XMLInputFactory> xif,
                                  javax.ws.rs.ext.Providers ps,
                                  javax.ws.rs.core.MediaType mt)
    • Method Detail

      • getXMLStreamReader

        protected final javax.xml.stream.XMLStreamReader getXMLStreamReader​(java.lang.Class<?> elementType,
                                                                            javax.ws.rs.core.MediaType mediaType,
                                                                            javax.xml.bind.Unmarshaller u,
                                                                            java.io.InputStream entityStream)
                                                                     throws javax.xml.stream.XMLStreamException
        Description copied from class: AbstractCollectionJaxbProvider
        Get the XMLStreamReader for unmarshalling.
        Specified by:
        getXMLStreamReader in class AbstractCollectionJaxbProvider
        Parameters:
        elementType - the individual element type.
        mediaType - the media type.
        u - the unmarshaller as a carrier of possible config options.
        entityStream - the input stream.
        Returns:
        the XMLStreamReader.
        Throws:
        javax.xml.stream.XMLStreamException - in case XMLStreamReader retrieval fails.
      • writeCollection

        public final void writeCollection​(java.lang.Class<?> elementType,
                                          java.util.Collection<?> 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,
                                          java.io.IOException
        Description copied from class: AbstractCollectionJaxbProvider
        Write a collection of JAXB objects as child elements of the root element.
        Specified by:
        writeCollection in class AbstractCollectionJaxbProvider
        Parameters:
        elementType - the element type in the collection.
        t - the collection to marshall
        mediaType - the media type
        c - the charset
        m - the marshaller
        entityStream - the output stream to marshall the collection
        Throws:
        javax.xml.bind.JAXBException - in case the marshalling of element collection fails.
        java.io.IOException - in case of any other I/O error while marshalling the collection of JAXB objects.