|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface enables classes implementing it to be written into a
XBE32-encoded stream, by means of the XBE32Writer.writeXBE32Object()
method.
Complex XBE32 Elements must call its writer.openComplexElement()
method first, then write all its attributes and inner elements with
the appropriate writer.writeXXXAttribute()
and/or
writer.writeXBE32Object()
methods, in order to write all its
subelements recursively. Finally, the writer.closeComplexElement()
method must be called:
public class Service implements XBE32Writable { public String type; public InetAddress addr; public short[] ports; public Options options; public void writeXBE32Object ( XBE32Writer writer ) { writer.openComplexElement(0x0001); writer.writeStringAttribute(0x2102, type); writer.writeOpaque4Attribute(0x2C03, addr.getAddress()); writer.writeInt16Attribute(0x2904, ports); writer.writeXBE32Object(options); writer.closeComplexElement(); } } public class Options implements XBE32Parseable, XBE32Writable { public boolean color; public Vector options; public Options() { options = new Vector(); } public void writeXBE32Object ( XBE32Writer writer ) { writer.openComplexElement(0xC005); writer.writeExtBooleanAttribute(0x00000006, "color", false, true, false); Enumeration enum = options.elements(); while (enum.hasMoreElements()) { XBE32Element elem = (XBE32Element) enum.nextElement(); writer.writeXBE32Object(elem); } writer.closeComplexElement(); } }
XBE32Writer.writeXBE32Object(XBE32Writable)
Method Summary | |
void |
writeXBE32Object(XBE32Writer writer)
Objects that are going to be serialized into a XBE32-encoded stream should implement this method. |
Method Detail |
public void writeXBE32Object(XBE32Writer writer)
writer
- the XBE32Writer to be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |