|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.OutputStream
java.io.ObjectOutputStream
it.unimo.dbgroup.momis.XmlTools.XmlObjectOutput
XmlWriter wrapper that extends ObjectOutputStream.
This class is used by XmlWriter to call custom
writeObject(ObjectOutputStream out) methods.
You can also use this class as a stand alone object output serializer. XmlWriter whithout this class would'nt be able to serialize standard java object that use custom writeObject with an ObjectOutputStream as parameter.
This wrapper is provided to extends functionalities of XmlWriter to all java objects. You can think to XmlObjectOutput as a part of XmlWriter or as stand alone object that extends XmlWriter.
Remember that this class is a wrapper, so use XmlWriter if you can, it is more efficient.
For more details see XmlWriter methods.
XmlWriter| Nested Class Summary |
| Nested classes inherited from class java.io.ObjectOutputStream |
java.io.ObjectOutputStream.PutField |
| Field Summary | |
private XmlWriter |
_wrt
Reference to the wrapped XmlWriter instance. |
| Fields inherited from class java.io.ObjectOutputStream |
|
| Fields inherited from interface java.io.ObjectStreamConstants |
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING |
| Constructor Summary | |
XmlObjectOutput()
Create a stand alone wrapper. |
|
XmlObjectOutput(XmlWriter wrt)
Creates the wrapper and uses the specified XmlWriter object. |
|
| Method Summary | |
void |
close()
Does nothing. |
void |
defaultWriteObject()
Write the non-static and non-transient fields of the current class as XML child elements. |
protected void |
drain()
Does nothing. |
protected boolean |
enableReplaceObject(boolean enable)
Not supported. |
void |
flush()
Does nothing. |
XmlWriter |
getWriter()
Returns the XmlWriter object that this instance is wrapping. |
java.io.ObjectOutputStream.PutField |
putFields()
Does nothing, returns null. |
protected java.lang.Object |
replaceObject(java.lang.Object obj)
Not supported. |
void |
reset()
Does nothing. |
void |
useProtocolVersion(int version)
Does nothing. |
void |
write(byte[] b)
Write a byte array. |
void |
write(byte[] b,
int off,
int len)
Write leb bytes of a byte array beginning from offset off. |
void |
write(int data)
Writes a byte of data. |
void |
writeBoolean(boolean data)
Writes a boolean. |
void |
writeByte(int data)
Writes a byte. |
void |
writeBytes(java.lang.String data)
Writes a data string. |
void |
writeChar(int data)
Writes a character. |
void |
writeChars(java.lang.String data)
Writes a string. |
protected void |
writeClassDescriptor(java.io.ObjectStreamClass classdesc)
Does nothing. |
void |
writeDouble(double data)
Writes a 'double'. |
void |
writeFields()
Does nothing. |
void |
writeFloat(float data)
Writes a float. |
void |
writeInt(int data)
Writes an integer. |
void |
writeLong(long data)
Writes a long integer. |
protected void |
writeObjectOverride(java.lang.Object obj)
Overridden implementation for ObjectOutputStream.writeObject. |
void |
writeShort(int data)
Writes a short integer. |
protected void |
writeStreamHeader()
Does nothing. |
void |
writeUTF(java.lang.String s)
Writes a string. |
| Methods inherited from class java.io.ObjectOutputStream |
annotateClass, annotateProxyClass, writeObject, writeUnshared |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private XmlWriter _wrt
| Constructor Detail |
public XmlObjectOutput(XmlWriter wrt)
throws java.io.IOException
After this constructor returns, the calling method should call
XmlWriter.setObjectOutputWrapper(); with the new
XmlObjectOutput as parameter to ensure coerence.
If you are creating a stand alone XmlObjectOutput please don't use this construtor, call the no-args constructor instead.
wrt - XmlWriter that must be used.
public XmlObjectOutput()
throws java.io.IOException
| Method Detail |
protected void writeObjectOverride(java.lang.Object obj)
throws java.io.IOException
This method calls XmlWriter.writeObject to accomplish his task.
java.io.IOException
protected java.lang.Object replaceObject(java.lang.Object obj)
throws java.io.IOException
java.io.IOException
protected boolean enableReplaceObject(boolean enable)
throws java.lang.SecurityException
java.lang.SecurityException
protected void writeStreamHeader()
throws java.io.IOException
java.io.IOException
protected void writeClassDescriptor(java.io.ObjectStreamClass classdesc)
throws java.io.IOException
java.io.IOException
protected void drain()
throws java.io.IOException
java.io.IOExceptionpublic XmlWriter getWriter()
public void close()
throws java.io.IOException
java.io.IOException
public void writeBoolean(boolean data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeByte(int data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeShort(int data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeChar(int data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeInt(int data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeLong(long data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeFloat(float data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeDouble(double data)
throws java.io.IOException
Please see XmlWriter methods for more details.
java.io.IOException
public void writeBytes(java.lang.String data)
throws java.io.IOException
In this implementation the data string is written in XML
as a normal String object but each call to this method
will always produce an XML string definition element.
Reference elements are never produced by this method.
java.io.IOException
public void writeChars(java.lang.String data)
throws java.io.IOException
In this implementation the data string is written in XML
as a normal String object but each call to this method
will always produce an XML string definition element.
Reference elements are never produced by this method.
java.io.IOException
public void writeUTF(java.lang.String s)
throws java.io.IOException
In this implementation the data string is written in XML
as a normal String object but each call to this method
will always produce an XML string definition element.
Reference elements are never produced by this method.
java.io.IOException
public void useProtocolVersion(int version)
throws java.io.IOException
java.io.IOException
public void defaultWriteObject()
throws java.io.IOException
This method calls XmlWriter.defaultWrite() to accomplish his task.
java.io.IOException
public java.io.ObjectOutputStream.PutField putFields()
throws java.io.IOException
java.io.IOException
public void writeFields()
throws java.io.IOException
java.io.IOException
public void reset()
throws java.io.IOException
java.io.IOException
public void write(int data)
throws java.io.IOException
java.io.IOException
public void write(byte[] b)
throws java.io.IOException
This implementation will convert the array into a String and will write it to the DOM tree.
java.io.IOException
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
This implementation will convert the array portion into a String and will write it to the DOM tree.
java.io.IOException
public void flush()
throws java.io.IOException
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||