Interface AdaptrisMarshaller

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String marshal​(java.lang.Object obj)
      Marshalls an object to XML.
      void marshal​(java.lang.Object obj, java.io.File file)
      Marshalls an object to XML.
      void marshal​(java.lang.Object obj, java.io.OutputStream outputStream)
      Marshalls an object to XML.
      void marshal​(java.lang.Object obj, java.io.Writer writer)
      Marshalls an object to XML.
      void marshal​(java.lang.Object obj, java.lang.String fileName)
      Marshalls an object to XML.
      void marshal​(java.lang.Object obj, java.net.URL fileUrl)
      Marshalls an XML representation of the passed Object to the file sytem location denoted by the passed URL.
      static void uncheckedMarshal​(AdaptrisMarshaller m, java.lang.Object o, AdaptrisMarshaller.MarshalOutputStream out)
      Convenience method to wrap marshalling activities with a RuntimeException .
      static java.lang.Object uncheckedUnmarshal​(AdaptrisMarshaller m, java.lang.Object o, AdaptrisMarshaller.MarshalInputStream in)
      Convenience method to wrap unmarshalling activities with a RuntimeException .
      java.lang.Object unmarshal​(URLString location)
      Unmarshals an Object from the passed URLString location.
      java.lang.Object unmarshal​(java.io.File file)
      Unmarshalls an Object based on the passed file.
      java.lang.Object unmarshal​(java.io.InputStream stream)
      Unmarshals an Object based on the passed InputStream.
      java.lang.Object unmarshal​(java.io.Reader reader)
      Unmarshalls an Object based on the passed Reader.
      java.lang.Object unmarshal​(java.lang.String xml)
      Unmarshalls an Object from the passed XML.
      java.lang.Object unmarshal​(java.net.URL fileUrl)
      Unmarshalls an Object based on the passed file system URL.
    • Method Detail

      • marshal

        java.lang.String marshal​(java.lang.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​(java.lang.Object obj,
                     java.lang.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​(java.lang.Object obj,
                     java.io.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​(java.lang.Object obj,
                     java.io.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​(java.lang.Object obj,
                     java.io.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​(java.lang.Object obj,
                     java.net.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

        java.lang.Object unmarshal​(java.lang.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

        java.lang.Object unmarshal​(java.io.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

        java.lang.Object unmarshal​(java.net.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

        java.lang.Object unmarshal​(java.io.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

        java.lang.Object unmarshal​(java.io.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

        java.lang.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