org.jabber.jabberbeans
Class XMLData

java.lang.Object
  |
  +--org.jabber.jabberbeans.XMLData
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Agent, BrowseItem, ContentPacket, DefaultExtension, Handshake, HashExtension, IQAgents, IQAuth, IQAutoUpdate, IQPass, IQPrivate, IQSearchResult, IQTime, IQVersion, KeepAlive.KeepAlivePacket, Log, OOB, PacketError, Roster, RosterItem, UpdateInfo, XAutoUpdate, XConference, XDelay, XMLStreamError, XMLStreamHeader

public abstract class XMLData
extends java.lang.Object
implements java.io.Serializable

an XMLData object is the root class of a heirarchy of objects, all which serialize themselves to XML data.

See Also:
Serialized Form

Constructor Summary
XMLData()
           
 
Method Summary
protected static boolean appendAttrib(java.lang.StringBuffer retval, java.lang.String name, java.lang.Object value)
          appendAttrib outputs an attribute if needed.
protected static boolean appendAttrib(java.lang.StringBuffer retval, java.lang.String name, java.lang.String value)
          appendAttrib outputs an attribute if needed.
protected static boolean appendChild(java.lang.StringBuffer retval, java.lang.String name, boolean value)
          appendChild outputs an element if needed.
protected static boolean appendChild(java.lang.StringBuffer retval, java.lang.String name, java.lang.String value)
          appendChild adds the XML for a child 'element' to a StringBuffer, as a helper to appendItem.
abstract  void appendItem(java.lang.StringBuffer retval)
          appendItem appends the XML representation of the current packet data to the specified StringBuffer.
protected static void escapeString(java.lang.StringBuffer retval, java.lang.String data)
           
 java.lang.String toString()
          toString is a serializer for the data contained in the object to an equivalent snippet of XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLData

public XMLData()
Method Detail

toString

public java.lang.String toString()
toString is a serializer for the data contained in the object to an equivalent snippet of XML stream.

Overrides:
toString in class java.lang.Object
Returns:
a String value which contains the XML representation of this object

appendItem

public abstract void appendItem(java.lang.StringBuffer retval)
appendItem appends the XML representation of the current packet data to the specified StringBuffer.

Parameters:
retval - The StringBuffer to append to

appendChild

protected static final boolean appendChild(java.lang.StringBuffer retval,
                                           java.lang.String name,
                                           java.lang.String value)
appendChild adds the XML for a child 'element' to a StringBuffer, as a helper to appendItem.

Parameters:
retval - a StringBuffer value
name - a String value
value - a String value
Returns:
a bool which is true if the element was generated. This is used for any shortcuts in the outputted XML

appendChild

protected static final boolean appendChild(java.lang.StringBuffer retval,
                                           java.lang.String name,
                                           boolean value)
appendChild outputs an element if needed. If value=false it does not output the tag.

Parameters:
retval - a StringBuffer value
name - a String value
value - a boolean value
Returns:
a bool which is true if the element was generated. This is used for any shortcuts in the outputted XML

appendAttrib

protected static final boolean appendAttrib(java.lang.StringBuffer retval,
                                            java.lang.String name,
                                            java.lang.String value)
appendAttrib outputs an attribute if needed. If value=null it will not output the attribute. Note that it outputs in the format:

&qout; attrib=value&qout;, or it puts a proceeding space in front of the attribute, and no trailing space. This is for optimizing the XML generation.

Parameters:
retval - a StringBuffer value
name - a String value
value - a boolean value
Returns:
a bool which is true if the attribute was generated. This is used for any shortcuts in the outputted XML

appendAttrib

protected static final boolean appendAttrib(java.lang.StringBuffer retval,
                                            java.lang.String name,
                                            java.lang.Object value)
appendAttrib outputs an attribute if needed. If value=null it will not output the attribute. Note that it outputs in the format:

&qout; attrib=value&qout;, or it puts a proceeding space in front of the attribute, and no trailing space. This is for optimizing the XML generation.

Parameters:
retval - a StringBuffer value
name - a String value
value - a Object value, which supports toString()
Returns:
a bool which is true if the attribute was generated. This is used for any shortcuts in the outputted XML

escapeString

protected static final void escapeString(java.lang.StringBuffer retval,
                                         java.lang.String data)