Class XMLSerializer

    • Constructor Detail

      • XMLSerializer

        public XMLSerializer()
      • XMLSerializer

        public XMLSerializer​(java.nio.charset.Charset charset)
    • Method Detail

      • getCharset

        public java.nio.charset.Charset getCharset()
      • readObject

        public Element readObject​(java.io.InputStream inputStream)
                           throws java.io.IOException,
                                  SerializationException
        Description copied from interface: Serializer
        Reads an object from an input stream.
        Specified by:
        readObject in interface Serializer<Element>
        Parameters:
        inputStream - The data stream from which the object will be read.
        Returns:
        The deserialized object.
        Throws:
        java.io.IOException - for any errors accessing or reading the object.
        SerializationException - for any formatting errors encountered while deserializing the object.
      • writeObject

        public void writeObject​(Element element,
                                java.io.OutputStream outputStream)
                         throws java.io.IOException,
                                SerializationException
        Description copied from interface: Serializer
        Writes an object to an output stream.
        Specified by:
        writeObject in interface Serializer<Element>
        Parameters:
        element - The object to serialize.
        outputStream - The data stream to which the object will be written.
        Throws:
        java.io.IOException - for any errors accessing or reading the object.
        SerializationException - for any formatting errors encountered while deserializing the object.
      • getMIMEType

        public java.lang.String getMIMEType​(Element object)
        Description copied from interface: Serializer
        Returns the MIME type of the data read and written by this serializer.
        Specified by:
        getMIMEType in interface Serializer<Element>
        Parameters:
        object - If provided, allows the serializer to attach parameters to the returned MIME type containing more detailed information about the data. If null, the base MIME type is returned.
        Returns:
        The MIME type of the current data.