|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.ObjectOutputStream
|
+--JSX.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
|
| Field Summary |
| Constructor Summary | |
ObjectWriter()
Writes to System.out (convenient for testing) |
|
ObjectWriter(JSX.DataWriterI dataWriter)
For output other than XML (or to different XML formats) |
|
ObjectWriter(OutputStream outputStream)
|
|
ObjectWriter(Writer writer)
|
|
| Method Summary | |
protected void |
annotateClass(Class cl)
Not implemented |
void |
close()
|
void |
defaultWriteObject()
|
void |
disableExternalization()
|
protected void |
drain()
Not implemented |
protected boolean |
enableReplaceObject(boolean enable)
Not implemented |
void |
flush()
|
JSX.Alias |
getHash()
|
static void |
main(String[] args)
USAGE: java JSX.ObjectWriter className (defaults to JSX.Person) |
ObjectOutputStream.PutField |
putFields()
|
protected Object |
replaceObject(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(String s)
|
void |
writeChar(int v)
|
void |
writeChars(String s)
|
protected void |
writeClassDescriptor(ObjectStreamClass desc)
Not implemented |
void |
writeDouble(double v)
|
void |
writeFields()
|
void |
writeFloat(float v)
|
void |
writeInt(int v)
|
void |
writeLong(long v)
|
void |
writeObjectOverride(Object object)
|
void |
writeShort(int v)
|
protected void |
writeStreamHeader()
Not implemented |
void |
writeUnshared(Object obj)
|
void |
writeUTF(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 IOException
public ObjectWriter(OutputStream outputStream)
throws IOException
public ObjectWriter(JSX.DataWriterI dataWriter)
throws IOException
public ObjectWriter(Writer writer)
throws IOException
| Method Detail |
public static void main(String[] args)
throws Exception
Exceptionpublic void setPrettyPrint(boolean prettyPrint)
public void flush()
throws IOException
flush in interface ObjectOutputflush in class ObjectOutputStreamIOException
public void close()
throws IOException
close in interface ObjectOutputclose in class ObjectOutputStreamIOException
public void reset()
throws IOException
reset in class ObjectOutputStreamIOException
public void writeBoolean(boolean v)
throws IOException
writeBoolean in interface DataOutputwriteBoolean in class ObjectOutputStreamIOException
public void writeByte(int v)
throws IOException
writeByte in interface DataOutputwriteByte in class ObjectOutputStreamIOException
public void writeShort(int v)
throws IOException
writeShort in interface DataOutputwriteShort in class ObjectOutputStreamIOException
public void writeInt(int v)
throws IOException
writeInt in interface DataOutputwriteInt in class ObjectOutputStreamIOException
public void writeLong(long v)
throws IOException
writeLong in interface DataOutputwriteLong in class ObjectOutputStreamIOException
public void writeFloat(float v)
throws IOException
writeFloat in interface DataOutputwriteFloat in class ObjectOutputStreamIOException
public void writeDouble(double v)
throws IOException
writeDouble in interface DataOutputwriteDouble in class ObjectOutputStreamIOException
public void writeChar(int v)
throws IOException
writeChar in interface DataOutputwriteChar in class ObjectOutputStreamIOException
public void writeUTF(String str)
throws IOException
writeUTF in interface DataOutputwriteUTF in class ObjectOutputStreamIOException
public void writeBytes(String s)
throws IOException
writeBytes in interface DataOutputwriteBytes in class ObjectOutputStreamIOException
public void writeChars(String s)
throws IOException
writeChars in interface DataOutputwriteChars in class ObjectOutputStreamIOException
public void write(int b)
throws IOException
write in interface ObjectOutputwrite in class ObjectOutputStreamIOException
public void write(byte[] b)
throws IOException
write in interface ObjectOutputwrite in class ObjectOutputStreamIOException
public void write(byte[] b,
int off,
int len)
throws IOException
write in interface ObjectOutputwrite in class ObjectOutputStreamIOException
public void writeUnshared(Object obj)
throws IOException
writeUnshared in class ObjectOutputStreamIOException
protected Object replaceObject(Object obj)
throws IOException
replaceObject in class ObjectOutputStreamIOException
protected boolean enableReplaceObject(boolean enable)
throws SecurityException
enableReplaceObject in class ObjectOutputStreamSecurityException
protected void annotateClass(Class cl)
throws IOException
annotateClass in class ObjectOutputStreamIOException
protected void writeClassDescriptor(ObjectStreamClass desc)
throws IOException
writeClassDescriptor in class ObjectOutputStreamIOException
protected void writeStreamHeader()
throws IOException
writeStreamHeader in class ObjectOutputStreamIOException
protected void drain()
throws IOException
drain in class ObjectOutputStreamIOException
public void useProtocolVersion(int version)
throws IOException
useProtocolVersion in class ObjectOutputStreamIOExceptionpublic void setAutoClose(boolean autoClose)
public void setEmbedded(boolean embedded)
public void writeObjectOverride(Object object)
throws IOException
writeObjectOverride in class ObjectOutputStreamIOExceptionpublic JSX.Alias getHash()
public void disableExternalization()
public void defaultWriteObject()
throws IOException
defaultWriteObject in class ObjectOutputStreamIOException
public ObjectOutputStream.PutField putFields()
throws IOException
putFields in class ObjectOutputStreamIOException
public void writeFields()
throws IOException
writeFields in class ObjectOutputStreamIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||