| java.lang.Object java.beans.Encoder java.beans.XMLEncoder
XMLEncoder | public class XMLEncoder extends Encoder (Code) | | XMLEncoder exnteds Encoder to write out the
encoded statements and expressions in xml format. The xml can be read by
XMLDecoder later to restore objects and their states.
The API is similar to ObjectOutputStream .
|
Method Summary | |
public void | close() Call flush() first, then write out xml footer and close
the underlying output stream. | public void | flush() Writes out all objects since last flush to the output stream.
The implementation write the xml header first if it has not been
writtern. | public Object | getOwner() Returns the owner of this encoder. | public void | setOwner(Object owner) Sets the owner of this encoder. | public void | writeExpression(Expression oldExp) Records the expression so that it can be writtern out later, then calls
super implementation. | public void | writeObject(Object o) Records the object so that it can be writtern out later, then calls super
implementation. | public void | writeStatement(Statement oldStat) Records the statement so that it can be writtern out later, then calls
super implementation. |
XMLEncoder | public XMLEncoder(OutputStream out)(Code) | | Construct a XMLEncoder .
Parameters: out - the output stream where xml is writtern to |
close | public void close()(Code) | | Call flush() first, then write out xml footer and close
the underlying output stream.
|
flush | public void flush()(Code) | | Writes out all objects since last flush to the output stream.
The implementation write the xml header first if it has not been
writtern. Then all pending objects since last flush are writtern.
|
getOwner | public Object getOwner()(Code) | | Returns the owner of this encoder.
the owner of this encoder |
setOwner | public void setOwner(Object owner)(Code) | | Sets the owner of this encoder.
Parameters: owner - the owner to set |
writeExpression | public void writeExpression(Expression oldExp)(Code) | | Records the expression so that it can be writtern out later, then calls
super implementation.
|
writeObject | public void writeObject(Object o)(Code) | | Records the object so that it can be writtern out later, then calls super
implementation.
|
writeStatement | public void writeStatement(Statement oldStat)(Code) | | Records the statement so that it can be writtern out later, then calls
super implementation.
|
|
|