Class ObjectMarshallerImpl<T>

java.lang.Object
net.ihe.gazelle.common.marshaller.ObjectMarshallerImpl<T>
Type Parameters:
T - the kind of object to be marshalled
All Implemented Interfaces:
ObjectMarshaller<T>

public class ObjectMarshallerImpl<T> extends Object implements ObjectMarshaller<T>
Marshaller of an object T.
Author:
Abderrazek Boufahja
  • Constructor Details

    • ObjectMarshallerImpl

      public ObjectMarshallerImpl(Class<T> cl)
      Create an object marshaller.
      Parameters:
      cl - the type of class to marshall (it shall be T.class)
  • Method Details

    • marshall

      public void marshall(T t, OutputStream os) throws jakarta.xml.bind.JAXBException
      The marshalling is pretty formatted.
      Specified by:
      marshall in interface ObjectMarshaller<T>
      Parameters:
      t - the object to marshall
      os - the output stream
      Throws:
      jakarta.xml.bind.JAXBException - if there are a problem.
    • unmarshall

      public T unmarshall(InputStream is) throws jakarta.xml.bind.JAXBException
      simple unmarshalling method.
      Specified by:
      unmarshall in interface ObjectMarshaller<T>
      Parameters:
      is - input stream
      Returns:
      an instance of T
      Throws:
      jakarta.xml.bind.JAXBException - if there are a problem