|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.io.OutputStream
java.io.ObjectOutputStream
JSX.ObjectWriter
public class ObjectWriter
ObjectWriter can be used in place of ObjectOutputStream, to serialize object graphs to XML, instead of the binary format. It implements all the core features of ObjectOutputStream. ObjectWriter does not require classes to implement java.io.Serialization, nor is serialVersionUID needed for class evolution.
| Nested Class Summary | |
|---|---|
class |
ObjectWriter.PutFieldImpl
|
| Nested classes/interfaces inherited from class java.io.ObjectOutputStream |
|---|
java.io.ObjectOutputStream.PutField |
| Field Summary |
|---|
| Fields inherited from interface java.io.ObjectStreamConstants |
|---|
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, 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_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING |
| Constructor Summary | |
|---|---|
ObjectWriter()
Writes to System.out (convenient for testing) |
|
ObjectWriter(DataWriterI dataWriter)
For output other than XML (or to different XML formats) |
|
ObjectWriter(java.io.OutputStream outputStream)
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.Class targetClass,
java.lang.Class mementoClass)
|
protected void |
annotateClass(java.lang.Class cl)
Not implemented |
void |
close()
|
void |
defaultWriteObject()
|
void |
disableExternalization()
|
protected void |
drain()
Not implemented |
protected boolean |
enableReplaceObject(boolean enable)
Not implemented |
void |
flush()
|
Alias |
getHash()
|
static void |
main(java.lang.String[] args)
USAGE: java JSX.ObjectWriter className (defaults to JSX.Person) |
java.io.ObjectOutputStream.PutField |
putFields()
|
protected java.lang.Object |
replaceObject(java.lang.Object obj)
now implemented |
void |
reset()
|
void |
setAutoClose(boolean autoClose)
(extension) For more than one writeObject() call in the one ObjectWriter, forming a single XML document. |
void |
setEmbedded(boolean embedded)
(extension) For embedding within a SOAP envelope, or any other enclosing XML. |
void |
setPrettyPrint(boolean prettyPrint)
(extension) Set to false to turn off indentation and newlines |
void |
useProtocolVersion(int version)
Not implemented |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
void |
writeBoolean(boolean v)
|
void |
writeByte(int v)
|
void |
writeBytes(java.lang.String s)
|
void |
writeChar(int v)
|
void |
writeChars(java.lang.String s)
|
protected void |
writeClassDescriptor(java.io.ObjectStreamClass desc)
Not implemented |
void |
writeDouble(double v)
|
void |
writeFields()
|
void |
writeFloat(float v)
|
void |
writeInt(int v)
|
void |
writeLong(long v)
|
void |
writeObjectOverride(java.lang.Object object)
|
void |
writeShort(int v)
|
protected void |
writeStreamHeader()
Not implemented |
void |
writeUnshared(java.lang.Object obj)
|
void |
writeUTF(java.lang.String str)
|
| Methods inherited from class java.io.ObjectOutputStream |
|---|
annotateProxyClass, writeObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectWriter()
throws java.io.IOException
java.io.IOException
public ObjectWriter(java.io.OutputStream outputStream)
throws java.io.IOException
java.io.IOException
public ObjectWriter(DataWriterI dataWriter)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionpublic void setPrettyPrint(boolean prettyPrint)
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in interface java.io.ObjectOutputflush in class java.io.ObjectOutputStreamjava.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.io.ObjectOutputclose in class java.io.ObjectOutputStreamjava.io.IOException
public void reset()
throws java.io.IOException
reset in class java.io.ObjectOutputStreamjava.io.IOException
public void writeBoolean(boolean v)
throws java.io.IOException
writeBoolean in interface java.io.DataOutputwriteBoolean in class java.io.ObjectOutputStreamjava.io.IOException
public void writeByte(int v)
throws java.io.IOException
writeByte in interface java.io.DataOutputwriteByte in class java.io.ObjectOutputStreamjava.io.IOException
public void writeShort(int v)
throws java.io.IOException
writeShort in interface java.io.DataOutputwriteShort in class java.io.ObjectOutputStreamjava.io.IOException
public void writeInt(int v)
throws java.io.IOException
writeInt in interface java.io.DataOutputwriteInt in class java.io.ObjectOutputStreamjava.io.IOException
public void writeLong(long v)
throws java.io.IOException
writeLong in interface java.io.DataOutputwriteLong in class java.io.ObjectOutputStreamjava.io.IOException
public void writeFloat(float v)
throws java.io.IOException
writeFloat in interface java.io.DataOutputwriteFloat in class java.io.ObjectOutputStreamjava.io.IOException
public void writeDouble(double v)
throws java.io.IOException
writeDouble in interface java.io.DataOutputwriteDouble in class java.io.ObjectOutputStreamjava.io.IOException
public void writeChar(int v)
throws java.io.IOException
writeChar in interface java.io.DataOutputwriteChar in class java.io.ObjectOutputStreamjava.io.IOException
public void writeUTF(java.lang.String str)
throws java.io.IOException
writeUTF in interface java.io.DataOutputwriteUTF in class java.io.ObjectOutputStreamjava.io.IOException
public void writeBytes(java.lang.String s)
throws java.io.IOException
writeBytes in interface java.io.DataOutputwriteBytes in class java.io.ObjectOutputStreamjava.io.IOException
public void writeChars(java.lang.String s)
throws java.io.IOException
writeChars in interface java.io.DataOutputwriteChars in class java.io.ObjectOutputStreamjava.io.IOException
public void write(int b)
throws java.io.IOException
write in interface java.io.DataOutputwrite in interface java.io.ObjectOutputwrite in class java.io.ObjectOutputStreamjava.io.IOException
public void write(byte[] b)
throws java.io.IOException
write in interface java.io.DataOutputwrite in interface java.io.ObjectOutputwrite in class java.io.ObjectOutputStreamjava.io.IOException
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in interface java.io.DataOutputwrite in interface java.io.ObjectOutputwrite in class java.io.ObjectOutputStreamjava.io.IOException
public void writeUnshared(java.lang.Object obj)
throws java.io.IOException
writeUnshared in class java.io.ObjectOutputStreamjava.io.IOException
protected java.lang.Object replaceObject(java.lang.Object obj)
throws java.io.IOException
replaceObject in class java.io.ObjectOutputStreamjava.io.IOException
protected boolean enableReplaceObject(boolean enable)
throws java.lang.SecurityException
enableReplaceObject in class java.io.ObjectOutputStreamjava.lang.SecurityException
protected void annotateClass(java.lang.Class cl)
throws java.io.IOException
annotateClass in class java.io.ObjectOutputStreamjava.io.IOException
protected void writeClassDescriptor(java.io.ObjectStreamClass desc)
throws java.io.IOException
writeClassDescriptor in class java.io.ObjectOutputStreamjava.io.IOException
protected void writeStreamHeader()
throws java.io.IOException
writeStreamHeader in class java.io.ObjectOutputStreamjava.io.IOException
protected void drain()
throws java.io.IOException
drain in class java.io.ObjectOutputStreamjava.io.IOException
public void useProtocolVersion(int version)
throws java.io.IOException
useProtocolVersion in class java.io.ObjectOutputStreamjava.io.IOExceptionpublic void setAutoClose(boolean autoClose)
public void setEmbedded(boolean embedded)
public void writeObjectOverride(java.lang.Object object)
throws java.io.IOException
writeObjectOverride in class java.io.ObjectOutputStreamjava.io.IOExceptionpublic Alias getHash()
public void add(java.lang.Class targetClass,
java.lang.Class mementoClass)
public void disableExternalization()
public void defaultWriteObject()
throws java.io.IOException
defaultWriteObject in class java.io.ObjectOutputStreamjava.io.IOException
public java.io.ObjectOutputStream.PutField putFields()
throws java.io.IOException
putFields in class java.io.ObjectOutputStreamjava.io.IOException
public void writeFields()
throws java.io.IOException
writeFields in class java.io.ObjectOutputStreamjava.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||