|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.beans.XMLDecoder
The XMLDecoder
class is used to read XML documents
created using the XMLEncoder
and is used just like
the ObjectInputStream
. For example, one can use
the following fragment to read the first object defined
in an XML document written by the XMLEncoder
class:
XMLDecoder d = new XMLDecoder( new BufferedInputStream( new FileInputStream("Test.xml"))); Object result = d.readObject(); d.close();
XMLEncoder
Constructor Summary | |
XMLDecoder(java.io.InputStream in)
Creates a new input stream for reading archives created by the XMLEncoder class. |
|
XMLDecoder(java.io.InputStream in,
java.lang.Object owner)
Creates a new input stream for reading archives created by the XMLEncoder class. |
|
XMLDecoder(java.io.InputStream in,
java.lang.Object owner,
ExceptionListener exceptionListener)
Creates a new input stream for reading archives created by the XMLEncoder class. |
Method Summary | |
void |
close()
This method closes the input stream associated with this stream. |
ExceptionListener |
getExceptionListener()
Gets the exception handler for this stream. |
java.lang.Object |
getOwner()
Gets the owner of this decoder. |
java.lang.Object |
readObject()
Reads the next object from the input. |
void |
setExceptionListener(ExceptionListener exceptionListener)
Sets the exception handler for this stream to exceptionListener . |
void |
setOwner(java.lang.Object owner)
Sets the owner of this decoder to owner . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLDecoder(java.io.InputStream in)
XMLEncoder
class.in
- The underlying stream.XMLEncoder.XMLEncoder(OutputStream)
public XMLDecoder(java.io.InputStream in, java.lang.Object owner)
XMLEncoder
class.in
- The underlying stream.owner
- The owner of this stream.public XMLDecoder(java.io.InputStream in, java.lang.Object owner, ExceptionListener exceptionListener)
XMLEncoder
class.in
- the underlying stream.owner
- the owner of this stream.Method Detail |
public void close()
public void setExceptionListener(ExceptionListener exceptionListener)
exceptionListener
.
The exception handler is notified when this stream catches recoverable
exceptions.exceptionListener
- The exception handler for this stream.getExceptionListener()
public ExceptionListener getExceptionListener()
setExceptionListener(java.beans.ExceptionListener)
public java.lang.Object readObject()
XMLEncoder.writeObject(java.lang.Object)
public void setOwner(java.lang.Object owner)
owner
.owner
- The owner of this decoder.getOwner()
public java.lang.Object getOwner()
setOwner(java.lang.Object)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |