jimm.twice.ice.xml
Class Message

java.lang.Object
  extended byjimm.twice.ice.xml.Message
Direct Known Subclasses:
Add, BusinessTerm, Cancel, Cancellation, Capabilities, Confirmation, DeliveryPolicy, DeliveryRule, Description, Fault, GenericMetadata, GetPackage, GetPackages, GetStatus, Group, Header, Item, ItemRef, Location, Offer, OfferMetadata, OK, Package, PackageConfirmations, Packages, Packaging, Parameters, Ping, Reference, Remove, RemoveItem, Status, Subscribe, SubscribeFault, Subscription, Text, Transport

public class Message
extends java.lang.Object

The superclass of all ICE XML message chunks. Complete ICE messages have a header and a body and are sent within SOAP envelopes.

The toString method returns the message as XML.

Author:
Jim Menard, jimm@io.com
See Also:
SoapEnvelope

Field Summary
protected  Node node
           
 
Constructor Summary
Message(java.lang.String name)
          Constructor.
 
Method Summary
 Node addChild(Element el)
          This convenience method adds el as a child of our node (first creating a node to contain el).
 Message addChild(Message childMessage)
          This convenience method adds the node of message as a child of our node.
 Node addChild(Node node)
          This convenience method adds node as a child of our node.
 java.lang.Object getAttribute(java.lang.String key)
          This convenience method returns the XML tag's key attribute value.
 Node getNode()
           
 Tag getTag()
           
 void setAttribute(java.lang.String key, java.lang.Object value)
          This convenience method sets the XML tag's key attribute to value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

node

protected Node node
Constructor Detail

Message

public Message(java.lang.String name)
Constructor.

Parameters:
name - the XML element name
Method Detail

getNode

public Node getNode()

getTag

public Tag getTag()

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
This convenience method returns the XML tag's key attribute value.

Parameters:
key - the attribute name
Returns:
the attribute's value; may be null

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
This convenience method sets the XML tag's key attribute to value.

Parameters:
key - the attribute name
value - the attribute value

addChild

public Message addChild(Message childMessage)
This convenience method adds the node of message as a child of our node. Note: this method returns the Message childMessage instead of the child node.

Parameters:
childMessage - new child of this message
Returns:
childMessage

addChild

public Node addChild(Node node)
This convenience method adds node as a child of our node.

Parameters:
node - a DOM node
Returns:
node

addChild

public Node addChild(Element el)
This convenience method adds el as a child of our node (first creating a node to contain el).

Parameters:
el - an XML element
Returns:
the newly created child node

toString

public java.lang.String toString()