Smack

org.jivesoftware.smackx.pubsub
Class NodeExtension

java.lang.Object
  extended by org.jivesoftware.smackx.pubsub.NodeExtension
All Implemented Interfaces:
PacketExtension
Direct Known Subclasses:
AffiliationsExtension, ConfigurationEvent, FormNode, GetItemsRequest, Item, ItemsExtension, OptionsExtension, PublishItem, SubscribeExtension, Subscription, SubscriptionsExtension, UnsubscribeExtension

public class NodeExtension
extends java.lang.Object
implements PacketExtension

A class which represents a common element within the pubsub defined schemas. One which has a node as an attribute. This class is used on its own as well as a base class for many others, since the node is a central concept to most pubsub functionality.

Author:
Robin Collier

Constructor Summary
NodeExtension(PubSubElementType elem)
          Constructs a NodeExtension with an element name specified by PubSubElementType.
NodeExtension(PubSubElementType elem, java.lang.String nodeId)
          Constructs a NodeExtension with an element name specified by PubSubElementType and the specified node id.
 
Method Summary
 java.lang.String getElementName()
          Returns the root element name.
 java.lang.String getNamespace()
          Returns the root element XML namespace.
 java.lang.String getNode()
          Gets the node id
 java.lang.String toString()
           
 java.lang.String toXML()
          Returns the XML representation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeExtension

public NodeExtension(PubSubElementType elem,
                     java.lang.String nodeId)
Constructs a NodeExtension with an element name specified by PubSubElementType and the specified node id.

Parameters:
elem - Defines the element name and namespace
nodeId - Specifies the id of the node

NodeExtension

public NodeExtension(PubSubElementType elem)
Constructs a NodeExtension with an element name specified by PubSubElementType.

Parameters:
elem - Defines the element name and namespace
Method Detail

getNode

public java.lang.String getNode()
Gets the node id

Returns:
The node id

getElementName

public java.lang.String getElementName()
Description copied from interface: PacketExtension
Returns the root element name.

Specified by:
getElementName in interface PacketExtension
Returns:
the element name.

getNamespace

public java.lang.String getNamespace()
Description copied from interface: PacketExtension
Returns the root element XML namespace.

Specified by:
getNamespace in interface PacketExtension
Returns:
the namespace.

toXML

public java.lang.String toXML()
Description copied from interface: PacketExtension
Returns the XML representation of the PacketExtension.

Specified by:
toXML in interface PacketExtension
Returns:
the packet extension as XML.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Smack

Copyright © 2003-2007 Jive Software.