Package javaa.beans

Class XMLDecoder

java.lang.Object
javaa.beans.XMLDecoder

public class XMLDecoder extends Object
XMLDecoder reads objects from xml created by XMLEncoder.

The API is similar to ObjectInputStream.

  • Constructor Details

    • XMLDecoder

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

      public XMLDecoder(InputStream inputStream, 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(InputStream inputStream, 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(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl)
  • Method Details

    • 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 Object getOwner()
      Returns the owner of this decoder.
      Returns:
      the owner of this decoder
    • readObject

      public Object readObject()
      Reads the next object.
      Returns:
      the next object
      Throws:
      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(Object owner)
      Sets the owner of this decoder.
      Parameters:
      owner - the owner of this decoder