| |
|
| java.lang.Object java.beans.XMLDecoder
XMLDecoder | public class XMLDecoder (Code) | | 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();
For more information you might also want to check out
Long Term Persistence of JavaBeans Components: XML Schema,
an article in The Swing Connection.
See Also: XMLEncoder See Also: java.io.ObjectInputStream since: 1.4 version: 1.38 05/05/07 author: Philip Milne |
XMLDecoder | public XMLDecoder(InputStream in, Object owner)(Code) | | Creates a new input stream for reading archives
created by the XMLEncoder class.
Parameters: in - The underlying stream. Parameters: owner - The owner of this stream. |
XMLDecoder | public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener)(Code) | | Creates a new input stream for reading archives
created by the XMLEncoder class.
Parameters: in - the underlying stream. Parameters: owner - the owner of this stream. Parameters: exceptionListener - the exception handler for the stream;if null the default exception listener will be used. |
XMLDecoder | public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener, ClassLoader cl)(Code) | | Creates a new input stream for reading archives
created by the XMLEncoder class.
Parameters: in - the underlying stream. null may be passed withouterror, though the resulting XMLDecoder will be useless Parameters: owner - the owner of this stream. null is a legalvalue Parameters: exceptionListener - the exception handler for the stream, ornull to use the default Parameters: cl - the class loader used for instantiating objects. null indicates that the default class loader shouldbe used since: 1.5 |
close | public void close()(Code) | | This method closes the input stream associated
with this stream.
|
getExceptionListener | public ExceptionListener getExceptionListener()(Code) | | Gets the exception handler for this stream.
The exception handler for this stream. Will return the default exception listener if this has not explicitly been set. See Also: XMLDecoder.setExceptionListener |
setExceptionListener | public void setExceptionListener(ExceptionListener exceptionListener)(Code) | | Sets the exception handler for this stream to exceptionListener .
The exception handler is notified when this stream catches recoverable
exceptions.
Parameters: exceptionListener - The exception handler for this stream;if null the default exception listener will be used. See Also: XMLDecoder.getExceptionListener |
setOwner | public void setOwner(Object owner)(Code) | | Sets the owner of this decoder to owner .
Parameters: owner - The owner of this decoder. See Also: XMLDecoder.getOwner |
|
|
|