Interface AdaptrisMarshaller

All Known Implementing Classes:
AbstractMarshaller, PreProcessingXStreamMarshaller, StatisticMarshaller, XStreamJsonMarshaller, XStreamMarshaller, XStreamMarshallerImpl

public interface AdaptrisMarshaller

Defines methods required to 'marshal' Java objects to XML.

  • Method Details

    • marshal

      String marshal(Object obj) throws CoreException
      Marshalls an object to XML.
      Parameters:
      obj - the Object to marshall to XML
      Returns:
      a XML representation of the Object
      Throws:
      CoreException - wrapping any underlying Exception
    • marshal

      void marshal(Object obj, String fileName) throws CoreException
      Marshalls an object to XML.
      Parameters:
      obj - the Object to marshall to XML
      fileName - the name of the file to write to
      Throws:
      CoreException - wrapping any underlying Exception
    • marshal

      void marshal(Object obj, File file) throws CoreException
      Marshalls an object to XML.
      Parameters:
      obj - the Object to marshall to XML
      file - the file to write to
      Throws:
      CoreException - wrapping any underlying Exception
    • marshal

      void marshal(Object obj, Writer writer) throws CoreException
      Marshalls an object to XML.
      Parameters:
      obj - the Object to marshall to XML
      writer - the writer to write to
      Throws:
      CoreException - wrapping any underlying Exception
    • marshal

      void marshal(Object obj, OutputStream outputStream) throws CoreException
      Marshalls an object to XML.
      Parameters:
      obj - the object to marshall to XML
      outputStream - the OutputStream to write to
      Throws:
      CoreException - wrapping any underlying Exception
    • marshal

      void marshal(Object obj, URL fileUrl) throws CoreException

      Marshalls an XML representation of the passed Object to the file sytem location denoted by the passed URL.

      Parameters:
      obj - the Object to marshall to XML
      fileUrl - the file system location to write to
      Throws:
      CoreException - wrapping any underlying Exception
    • unmarshal

      Object unmarshal(String xml) throws CoreException

      Unmarshalls an Object from the passed XML.

      Parameters:
      xml - the String to unmarshal
      Returns:
      an Object
      Throws:
      CoreException - wrapping any underlying Exception
    • unmarshal

      Object unmarshal(File file) throws CoreException

      Unmarshalls an Object based on the passed file.

      Parameters:
      file - a file containing XML to unmarshal
      Returns:
      an Object
      Throws:
      CoreException - wrapping any underlying Exception
    • unmarshal

      Object unmarshal(URL fileUrl) throws CoreException

      Unmarshalls an Object based on the passed file system URL.

      Parameters:
      fileUrl - the file system location to read from
      Returns:
      an Object
      Throws:
      CoreException - wrapping any underlying Exception
    • unmarshal

      Object unmarshal(Reader reader) throws CoreException

      Unmarshalls an Object based on the passed Reader.

      Parameters:
      reader - a Reader with XML to unmarshal
      Returns:
      an Object
      Throws:
      CoreException - wrapping any underlying Exception
    • unmarshal

      Object unmarshal(InputStream stream) throws CoreException

      Unmarshals an Object based on the passed InputStream.

      Parameters:
      stream - an InputStream of XML to unmarshal
      Returns:
      an Object
      Throws:
      CoreException - wrapping any underlying Exception
    • unmarshal

      Object unmarshal(URLString location) throws CoreException

      Unmarshals an Object from the passed URLString location.

      Parameters:
      location - the location to unmarshal from
      Returns:
      the unmarshalled Object
      Throws:
      CoreException - wrapping any underlying Exceptions
    • uncheckedMarshal

      static void uncheckedMarshal(AdaptrisMarshaller m, Object o, AdaptrisMarshaller.MarshalOutputStream out)
      Convenience method to wrap marshalling activities with a RuntimeException .
      Since:
      3.8.2
    • uncheckedUnmarshal

      Convenience method to wrap unmarshalling activities with a RuntimeException .
      Since:
      3.8.2