Class JaxbMarshalling

  • All Implemented Interfaces:
    com.google.common.util.concurrent.Service

    public class JaxbMarshalling
    extends com.google.common.util.concurrent.AbstractIdleService
    Creates XML input and output streams from/to JAXB instances.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service

        com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
    • Method Detail

      • startUp

        protected void startUp()
                        throws Exception
        Specified by:
        startUp in class com.google.common.util.concurrent.AbstractIdleService
        Throws:
        Exception
      • shutDown

        protected void shutDown()
        Specified by:
        shutDown in class com.google.common.util.concurrent.AbstractIdleService
      • marshal

        public <T> void marshal​(javax.xml.bind.JAXBElement<T> objectToMarshal,
                                OutputStream outputStream)
                         throws javax.xml.bind.JAXBException
        Marshals a JAXBElement into a stream.
        Type Parameters:
        T - type of the wrapped element
        Parameters:
        objectToMarshal - to marshal
        outputStream - to marshal into
        Throws:
        javax.xml.bind.JAXBException - on marshalling errors.
      • unmarshal

        public Object unmarshal​(InputStream inputStream)
                         throws javax.xml.bind.JAXBException
        Takes an input stream and unmarshals it.
        Parameters:
        inputStream - the input stream to unmarshal.
        Returns:
        the unmarshalled SOAP envelope.
        Throws:
        javax.xml.bind.JAXBException - if unmarshalling fails.
      • unmarshal

        public Object unmarshal​(Reader reader)
                         throws javax.xml.bind.JAXBException
        Takes a reader and unmarshals it.
        Parameters:
        reader - the input stream to unmarshal.
        Returns:
        the unmarshalled SOAP envelope.
        Throws:
        javax.xml.bind.JAXBException - if unmarshalling fails.