Package javaa.beans
Class XMLDecoder
java.lang.Object
javaa.beans.XMLDecoder
XMLDecoder
reads objects from xml created by
XMLEncoder
.
The API is similar to ObjectInputStream
.
-
Constructor Summary
ConstructorsConstructorDescriptionXMLDecoder
(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
Modifier and TypeMethodDescriptionvoid
close()
Close the input stream of xml data.Returns the exception listener.getOwner()
Returns the owner of this decoder.Reads the next object.void
setExceptionListener
(ExceptionListener listener) Sets the exception listener.void
Sets the owner of this decoder.
-
Constructor Details
-
XMLDecoder
Create a decoder to read from specified input stream.- Parameters:
inputStream
- an input stream of xml
-
XMLDecoder
Create a decoder to read from specified input stream.- Parameters:
inputStream
- an input stream of xmlowner
- the owner of this decoder
-
XMLDecoder
Create a decoder to read from specified input stream.- Parameters:
inputStream
- an input stream of xmlowner
- the owner of this decoderlistener
- 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
Returns the exception listener.- Returns:
- the exception listener
-
getOwner
Returns the owner of this decoder.- Returns:
- the owner of this decoder
-
readObject
Reads the next object.- Returns:
- the next object
- Throws:
ArrayIndexOutOfBoundsException
- if no more objects to read
-
setExceptionListener
Sets the exception listener.- Parameters:
listener
- an exception listener
-
setOwner
Sets the owner of this decoder.- Parameters:
owner
- the owner of this decoder
-