com.waveset.util
Class XmlObjectWrapper

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.util.XmlObjectWrapper
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject

public abstract class XmlObjectWrapper
extends AbstractXmlObject

Convenient base class for XmlObjects which just introduce a new element to wrap some other XmlObject as the payload. A class just needs to subclass this class and override the getElement, getPayload, and setPayload methods. toXml and parseXml are already handled.


Field Summary
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace, code_id
 
Constructor Summary
XmlObjectWrapper()
           
XmlObjectWrapper(org.w3c.dom.Element element)
           
 
Method Summary
protected abstract  java.lang.Object getPayload()
          Subclass must override to return the arbitrary XmlObject payload.
protected abstract  void setPayload(java.lang.Object payload)
          Subclass must override to receive the arbitrary XmlObject payload.
 void toXml(java.lang.StringBuffer b, int indent)
          Serialize into a buffer with optional indentation.
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getElementName, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlObjectWrapper

public XmlObjectWrapper()

XmlObjectWrapper

public XmlObjectWrapper(org.w3c.dom.Element element)
                 throws WavesetException
Method Detail

getPayload

protected abstract java.lang.Object getPayload()
Subclass must override to return the arbitrary XmlObject payload. This is called upon serialization.


setPayload

protected abstract void setPayload(java.lang.Object payload)
Subclass must override to receive the arbitrary XmlObject payload. This is called upon serialization.


toXml

public final void toXml(java.lang.StringBuffer b,
                        int indent)
Description copied from class: AbstractXmlObject
Serialize into a buffer with optional indentation. This must be implemented by the subclass.

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject