Smack

org.jivesoftware.smackx.pubsub
Class SimplePayload

java.lang.Object
  extended by org.jivesoftware.smackx.pubsub.SimplePayload
All Implemented Interfaces:
PacketExtension

public class SimplePayload
extends Object
implements PacketExtension

The default payload representation for Item#getPayload(). It simply stores the XML payload as a string.

Author:
Robin Collier

Constructor Summary
SimplePayload(String elementName, String namespace, String xmlPayload)
          Construct a SimplePayload object with the specified element name, namespace and content.
 
Method Summary
 String getElementName()
          Returns the root element name.
 String getNamespace()
          Returns the root element XML namespace.
 String toString()
           
 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

SimplePayload

public SimplePayload(String elementName,
                     String namespace,
                     String xmlPayload)
Construct a SimplePayload object with the specified element name, namespace and content. The content must be well formed XML.

Parameters:
elementName - The root element name (of the payload)
namespace - The namespace of the payload, null if there is none
xmlPayload - The payload data
Method Detail

getElementName

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

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

getNamespace

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

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

toXML

public 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 String toString()
Overrides:
toString in class Object

Smack

Copyright © 2003-2007 Jive Software.