Packageorg.igniterealtime.xiff.data.im
Classpublic class RosterItem
InheritanceRosterItem Inheritance XMLStanza Inheritance ExtensionContainer
ImplementsISerializable

This class is used internally by the RosterExtension class for managing items received and sent as roster data. Usually, each item in the roster represents a single contact, and this class is used to represent, abstract, and serialize/deserialize this data.

See also

org.igniterealtime.xiff.data.im.RosterExtension


Public Properties
 PropertyDefined by
  askType : String
The ask type for this roster item.
RosterItem
 Inherited_exts : Object
ExtensionContainer
  groupCount : uint
[read-only]
RosterItem
  groupNames : Array
[read-only] Gets a list of all the groups associated with this roster item.
RosterItem
  jid : EscapedJID
The JID for this roster item.
RosterItem
  name : String
The display name for this roster item.
RosterItem
  pending : Boolean
[read-only] Convenience routine to determine if a roster item is considered "pending" or not.
RosterItem
  subscription : String
The subscription type for this roster item.
RosterItem
 InheritedXMLData : XML
[static]
XMLStanza
 InheritedXMLFactory : XMLDocument
[static]
XMLStanza
Public Methods
 MethodDefined by
  
RosterItem(parent:XMLNode = null)
RosterItem
 Inherited
ExtensionContainer
  
addGroupNamed(groupName:String):void
Adds a group to the roster item.
RosterItem
 Inherited
addTextNode(parent:XMLNode, elementName:String, value:String):XMLNode
Adds a simple text node to the parent node specified.
XMLStanza
  
deserialize(node:XMLNode):Boolean
Deserializes the RosterItem data.
RosterItem
 Inherited
ensureNode(node:XMLNode, elementName:String):XMLNode
Ensures that a node with a specific element name exists in the stanza.
XMLStanza
 Inherited
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
 Inherited
getNode():XMLNode
XMLStanza
 Inherited
removeAllExtensions(ns:String):void
ExtensionContainer
  
RosterItem
 Inherited
ExtensionContainer
  
removeGroupByName(groupName:String):Boolean
RosterItem
 Inherited
replaceTextNode(parent:XMLNode, original:XMLNode, elementName:String, value:String):XMLNode
Replaces one node in the stanza with another simple text node.
XMLStanza
  
serialize(parent:XMLNode):Boolean
Serializes the RosterItem data to XML for sending.
RosterItem
 Inherited
setNode(node:XMLNode):Boolean
Sets the XML node that should be used for this stanza's internal XML representation.
XMLStanza
Public Constants
 ConstantDefined by
  ELEMENT_NAME : String = "item"
[static]
RosterItem
Property detail
askTypeproperty
askType:String  [read-write]

The ask type for this roster item. Ask types have been enumerated by static variables in the RosterExtension:

Implementation
    public function get askType():String
    public function set askType(value:String):void
groupCountproperty 
groupCount:uint  [read-only]Implementation
    public function get groupCount():uint
groupNamesproperty 
groupNames:Array  [read-only]

Gets a list of all the groups associated with this roster item.

Implementation
    public function get groupNames():Array
jidproperty 
jid:EscapedJID  [read-write]

The JID for this roster item.

Implementation
    public function get jid():EscapedJID
    public function set jid(value:EscapedJID):void
nameproperty 
name:String  [read-write]

The display name for this roster item.

Implementation
    public function get name():String
    public function set name(value:String):void
pendingproperty 
pending:Boolean  [read-only]

Convenience routine to determine if a roster item is considered "pending" or not.

Implementation
    public function get pending():Boolean
subscriptionproperty 
subscription:String  [read-write]

The subscription type for this roster item. Subscription types have been enumerated by static variables in the RosterExtension:

Implementation
    public function get subscription():String
    public function set subscription(value:String):void
Constructor detail
RosterItem()constructor
public function RosterItem(parent:XMLNode = null)Parameters
parent:XMLNode (default = null)
Method detail
addGroupNamed()method
public function addGroupNamed(groupName:String):void

Adds a group to the roster item. Contacts in the roster can be associated with multiple groups.

Parameters
groupName:String — The name of the group to add
deserialize()method 
public function deserialize(node:XMLNode):Boolean

Deserializes the RosterItem data.

Parameters
node:XMLNode — The XML node associated this data

Returns
Boolean — An indicator as to whether deserialization was successful
removeAllGroups()method 
public function removeAllGroups():void
removeGroupByName()method 
public function removeGroupByName(groupName:String):BooleanParameters
groupName:String

Returns
Boolean
serialize()method 
public function serialize(parent:XMLNode):Boolean

Serializes the RosterItem data to XML for sending.

Parameters
parent:XMLNode — The parent node that this item should be serialized into

Returns
Boolean — An indicator as to whether serialization was successful
Constant detail
ELEMENT_NAMEconstant
public static const ELEMENT_NAME:String = "item"