Class XMLDecoder


  • public class XMLDecoder
    extends java.lang.Object
    XMLDecoder reads objects from xml created by XMLEncoder. ObjectInputStream.
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLDecoder​(java.io.InputStream inputStream)
      Create a decoder to read from specified input stream.
      XMLDecoder​(java.io.InputStream inputStream, java.lang.Object owner)
      Create a decoder to read from specified input stream.
      XMLDecoder​(java.io.InputStream inputStream, java.lang.Object owner, ExceptionListener listener)
      Create a decoder to read from specified input stream.
      XMLDecoder​(java.io.InputStream inputStream, java.lang.Object owner, ExceptionListener listener, java.lang.ClassLoader cl)  
    • Constructor Detail

      • XMLDecoder

        public XMLDecoder​(java.io.InputStream inputStream)
        Create a decoder to read from specified input stream.
        Parameters:
        inputStream - an input stream of xml
      • XMLDecoder

        public XMLDecoder​(java.io.InputStream inputStream,
                          java.lang.Object owner)
        Create a decoder to read from specified input stream.
        Parameters:
        inputStream - an input stream of xml
        owner - the owner of this decoder
      • XMLDecoder

        public XMLDecoder​(java.io.InputStream inputStream,
                          java.lang.Object owner,
                          ExceptionListener listener)
        Create a decoder to read from specified input stream.
        Parameters:
        inputStream - an input stream of xml
        owner - the owner of this decoder
        listener - listen to the exceptions thrown by the decoder
      • XMLDecoder

        public XMLDecoder​(java.io.InputStream inputStream,
                          java.lang.Object owner,
                          ExceptionListener listener,
                          java.lang.ClassLoader cl)
    • Method Detail

      • close

        public void close()
        Close the input stream of xml data.
      • getExceptionListener

        public ExceptionListener getExceptionListener()
        Returns the exception listener.
        Returns:
        the exception listener
      • getOwner

        public java.lang.Object getOwner()
        Returns the owner of this decoder.
        Returns:
        the owner of this decoder
      • readObject

        public java.lang.Object readObject()
        Reads the next object.
        Returns:
        the next object
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if no more objects to read
      • setExceptionListener

        public void setExceptionListener​(ExceptionListener listener)
        Sets the exception listener.
        Parameters:
        listener - an exception listener
      • setOwner

        public void setOwner​(java.lang.Object owner)
        Sets the owner of this decoder.
        Parameters:
        owner - the owner of this decoder