< prev index next >
src/java.desktop/share/classes/java/beans/XMLDecoder.java
Print this page
*** 35,49 ****
import org.xml.sax.InputSource;
import org.xml.sax.helpers.DefaultHandler;
/**
! * The <code>XMLDecoder</code> class is used to read XML documents
! * created using the <code>XMLEncoder</code> and is used just like
! * the <code>ObjectInputStream</code>. For example, one can use
* the following fragment to read the first object defined
! * in an XML document written by the <code>XMLEncoder</code>
* class:
* <pre>
* XMLDecoder d = new XMLDecoder(
* new BufferedInputStream(
* new FileInputStream("Test.xml")));
--- 35,49 ----
import org.xml.sax.InputSource;
import org.xml.sax.helpers.DefaultHandler;
/**
! * The {@code XMLDecoder} class is used to read XML documents
! * created using the {@code XMLEncoder} and is used just like
! * the {@code ObjectInputStream}. For example, one can use
* the following fragment to read the first object defined
! * in an XML document written by the {@code XMLEncoder}
* class:
* <pre>
* XMLDecoder d = new XMLDecoder(
* new BufferedInputStream(
* new FileInputStream("Test.xml")));
*** 71,81 ****
private Object[] array;
private int index;
/**
* Creates a new input stream for reading archives
! * created by the <code>XMLEncoder</code> class.
*
* @param in The underlying stream.
*
* @see XMLEncoder#XMLEncoder(java.io.OutputStream)
*/
--- 71,81 ----
private Object[] array;
private int index;
/**
* Creates a new input stream for reading archives
! * created by the {@code XMLEncoder} class.
*
* @param in The underlying stream.
*
* @see XMLEncoder#XMLEncoder(java.io.OutputStream)
*/
*** 83,93 ****
this(in, null);
}
/**
* Creates a new input stream for reading archives
! * created by the <code>XMLEncoder</code> class.
*
* @param in The underlying stream.
* @param owner The owner of this stream.
*
*/
--- 83,93 ----
this(in, null);
}
/**
* Creates a new input stream for reading archives
! * created by the {@code XMLEncoder} class.
*
* @param in The underlying stream.
* @param owner The owner of this stream.
*
*/
*** 95,127 ****
this(in, owner, null);
}
/**
* Creates a new input stream for reading archives
! * created by the <code>XMLEncoder</code> class.
*
* @param in the underlying stream.
* @param owner the owner of this stream.
* @param exceptionListener the exception handler for the stream;
! * if <code>null</code> the default exception listener will be used.
*/
public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener) {
this(in, owner, exceptionListener, null);
}
/**
* Creates a new input stream for reading archives
! * created by the <code>XMLEncoder</code> class.
*
! * @param in the underlying stream. <code>null</code> may be passed without
* error, though the resulting XMLDecoder will be useless
! * @param owner the owner of this stream. <code>null</code> is a legal
* value
* @param exceptionListener the exception handler for the stream, or
! * <code>null</code> to use the default
* @param cl the class loader used for instantiating objects.
! * <code>null</code> indicates that the default class loader should
* be used
* @since 1.5
*/
public XMLDecoder(InputStream in, Object owner,
ExceptionListener exceptionListener, ClassLoader cl) {
--- 95,127 ----
this(in, owner, null);
}
/**
* Creates a new input stream for reading archives
! * created by the {@code XMLEncoder} class.
*
* @param in the underlying stream.
* @param owner the owner of this stream.
* @param exceptionListener the exception handler for the stream;
! * if {@code null} the default exception listener will be used.
*/
public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener) {
this(in, owner, exceptionListener, null);
}
/**
* Creates a new input stream for reading archives
! * created by the {@code XMLEncoder} class.
*
! * @param in the underlying stream. {@code null} may be passed without
* error, though the resulting XMLDecoder will be useless
! * @param owner the owner of this stream. {@code null} is a legal
* value
* @param exceptionListener the exception handler for the stream, or
! * {@code null} to use the default
* @param cl the class loader used for instantiating objects.
! * {@code null} indicates that the default class loader should
* be used
* @since 1.5
*/
public XMLDecoder(InputStream in, Object owner,
ExceptionListener exceptionListener, ClassLoader cl) {
*** 206,221 ****
}
return true;
}
/**
! * Sets the exception handler for this stream to <code>exceptionListener</code>.
* The exception handler is notified when this stream catches recoverable
* exceptions.
*
* @param exceptionListener The exception handler for this stream;
! * if <code>null</code> the default exception listener will be used.
*
* @see #getExceptionListener
*/
public void setExceptionListener(ExceptionListener exceptionListener) {
if (exceptionListener == null) {
--- 206,221 ----
}
return true;
}
/**
! * Sets the exception handler for this stream to {@code exceptionListener}.
* The exception handler is notified when this stream catches recoverable
* exceptions.
*
* @param exceptionListener The exception handler for this stream;
! * if {@code null} the default exception listener will be used.
*
* @see #getExceptionListener
*/
public void setExceptionListener(ExceptionListener exceptionListener) {
if (exceptionListener == null) {
*** 251,261 ****
? this.array[this.index++]
: null;
}
/**
! * Sets the owner of this decoder to <code>owner</code>.
*
* @param owner The owner of this decoder.
*
* @see #getOwner
*/
--- 251,261 ----
? this.array[this.index++]
: null;
}
/**
! * Sets the owner of this decoder to {@code owner}.
*
* @param owner The owner of this decoder.
*
* @see #getOwner
*/
< prev index next >