Packageorg.igniterealtime.xiff.data
Classpublic class XMLStanza
InheritanceXMLStanza Inheritance ExtensionContainer
ImplementsIXMLStanza
SubclassesBrowseItem, Extension, FormField, MUCItem, RosterItem, SearchItem, XMPPStanza

This is a base class for all classes that encapsulate XML stanza data. It provides a set of methods that faciliate easy manipulation of XML data.



Public Properties
 PropertyDefined by
 Inherited_exts : Object
ExtensionContainer
  XMLData : XML
[static]
XMLStanza
  XMLFactory : XMLDocument
[static]
XMLStanza
Public Methods
 MethodDefined by
  
Three types can exist: - message - presence - iq
XMLStanza
 Inherited
ExtensionContainer
  
addTextNode(parent:XMLNode, elementName:String, value:String):XMLNode
Adds a simple text node to the parent node specified.
XMLStanza
  
ensureNode(node:XMLNode, elementName:String):XMLNode
Ensures that a node with a specific element name exists in the stanza.
XMLStanza
  
exists(value:*):Boolean
[static] A helper method to determine if a value is both not null and not undefined.
XMLStanza
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(ns:String):Array
ExtensionContainer
 Inherited
getExtension(name:String):Extension
ExtensionContainer
  
getNode():XMLNode
XMLStanza
 Inherited
removeAllExtensions(ns:String):void
ExtensionContainer
 Inherited
ExtensionContainer
  
replaceTextNode(parent:XMLNode, original:XMLNode, elementName:String, value:String):XMLNode
Replaces one node in the stanza with another simple text node.
XMLStanza
  
setNode(node:XMLNode):Boolean
Sets the XML node that should be used for this stanza's internal XML representation.
XMLStanza
Property detail
XMLDataproperty
public static var XMLData:XML
XMLFactoryproperty 
public static var XMLFactory:XMLDocument
Constructor detail
XMLStanza()constructor
public function XMLStanza()

Three types can exist: - message - presence - iq

See also

Method detail
addTextNode()method
public function addTextNode(parent:XMLNode, elementName:String, value:String):XMLNode

Adds a simple text node to the parent node specified.

Parameters
parent:XMLNode — The parent node that the newly created node should be appended onto
 
elementName:String — The element name of the new node
 
value:String — The value of the new node

Returns
XMLNode — A reference to the new node
ensureNode()method 
public function ensureNode(node:XMLNode, elementName:String):XMLNode

Ensures that a node with a specific element name exists in the stanza. If it doesn't, then the node is created and returned.

Parameters
node:XMLNode — The node to ensure
 
elementName:String — The element name to check for existance

Returns
XMLNode — The node if it already exists, else a newly created node with the element name provided
exists()method 
public static function exists(value:*):Boolean

A helper method to determine if a value is both not null and not undefined.

Parameters
value:* — The value to check for existance

Returns
Boolean — Whether the value checked is both not null and not undefined
getNode()method 
public function getNode():XMLNode

Returns
XMLNode — a reference to the stanza in XML form.
replaceTextNode()method 
public function replaceTextNode(parent:XMLNode, original:XMLNode, elementName:String, value:String):XMLNode

Replaces one node in the stanza with another simple text node.

Parameters
parent:XMLNode — The parent node to start at when searching for replacement
 
original:XMLNode — The node to replace
 
elementName:String — The new node's element name
 
value:String — The new node's value

Returns
XMLNode — The newly created node
setNode()method 
public function setNode(node:XMLNode):Boolean

Sets the XML node that should be used for this stanza's internal XML representation.

Parameters
node:XMLNode

Returns
Boolean — Whether the node set was successful