com.googlecode.openbeans
Class XMLDecoder

java.lang.Object
  extended by com.googlecode.openbeans.XMLDecoder

public class XMLDecoder
extends Object

XMLDecoder reads objects from xml created by XMLEncoder.

The API is similar to ObjectInputStream.


Constructor Summary
XMLDecoder(InputStream inputStream)
          Create a decoder to read from specified input stream.
XMLDecoder(InputStream inputStream, Object owner)
          Create a decoder to read from specified input stream.
XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener)
          Create a decoder to read from specified input stream.
XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl)
           
 
Method Summary
 void close()
          Close the input stream of xml data.
 ExceptionListener getExceptionListener()
          Returns the exception listener.
 Object getOwner()
          Returns the owner of this decoder.
 Object readObject()
          Reads the next object.
 void setExceptionListener(ExceptionListener listener)
          Sets the exception listener.
 void setOwner(Object owner)
          Sets the owner of this decoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 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 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


Copyright © 2013. All Rights Reserved.