Package javaa.beans
Class XMLEncoder
java.lang.Object
javaa.beans.Encoder
javaa.beans.XMLEncoder
XMLEncoder extends 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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Callflush()first, then write out xml footer and close the underlying output stream.voidflush()Writes out all objects since last flush to the output stream.getOwner()Returns the owner of this encoder.voidSets the owner of this encoder.voidwriteExpression(Expression oldExp) Records the expression so that it can be written out later, then calls super implementation.voidRecords the object so that it can be written out later, then calls super implementation.voidwriteStatement(Statement oldStat) Records the statement so that it can be written out later, then calls super implementation.Methods inherited from class javaa.beans.Encoder
get, getExceptionListener, getPersistenceDelegate, remove, setExceptionListener, setPersistenceDelegate
-
Constructor Details
-
XMLEncoder
Construct aXMLEncoder.- Parameters:
out- the output stream where xml is written to
-
-
Method Details
-
close
public void close()Callflush()first, then write out xml footer and close the underlying output stream. -
flush
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 written. Then all pending objects since last flush are written.
-
getOwner
Returns the owner of this encoder.- Returns:
- the owner of this encoder
-
setOwner
Sets the owner of this encoder.- Parameters:
owner- the owner to set
-
writeExpression
Records the expression so that it can be written out later, then calls super implementation.- Overrides:
writeExpressionin classEncoder- Parameters:
oldExp- the expression to write. The target, arguments, and return value of the expression are all old objects.
-
writeObject
Records the object so that it can be written out later, then calls super implementation.- Overrides:
writeObjectin classEncoder- Parameters:
o- the object to encode
-
writeStatement
Records the statement so that it can be written out later, then calls super implementation.- Overrides:
writeStatementin classEncoder- Parameters:
oldStat- a statement of old objects
-