Package org.somda.sdc.dpws.helper
Class JaxbMarshalling
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractIdleService
-
- org.somda.sdc.dpws.helper.JaxbMarshalling
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
public class JaxbMarshalling extends com.google.common.util.concurrent.AbstractIdleServiceCreates XML input and output streams from/to JAXB instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidmarshal(javax.xml.bind.JAXBElement<T> objectToMarshal, OutputStream outputStream)Marshals a JAXBElement into a stream.protected voidshutDown()protected voidstartUp()Objectunmarshal(InputStream inputStream)Takes an input stream and unmarshals it.Objectunmarshal(Reader reader)Takes a reader and unmarshals it.
-
-
-
Method Detail
-
startUp
protected void startUp() throws Exception- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
shutDown
protected void shutDown()
- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService
-
marshal
public <T> void marshal(javax.xml.bind.JAXBElement<T> objectToMarshal, OutputStream outputStream) throws javax.xml.bind.JAXBExceptionMarshals a JAXBElement into a stream.- Type Parameters:
T- type of the wrapped element- Parameters:
objectToMarshal- to marshaloutputStream- 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.
-
-