Packageorg.igniterealtime.xiff.data.im
Classpublic class RosterItem
InheritanceRosterItem Inheritance XMLStanza Inheritance ExtensionContainer Inheritance Object
Implements INodeProxy

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
http://xmpp.org/extensions/xep-0144.html
http://tools.ietf.org/html/rfc3921#section-8


Public Properties
 PropertyDefined By
  askType : String
The ask type for this roster item.
RosterItem
  groupCount : int
[read-only] Get the number of group elements in this roster item.
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
 Inheritedxml : XML
The XML node that should be used for this stanza's internal XML representation, base of the XMLStanza, XML element.
ExtensionContainer
Public Methods
 MethodDefined By
  
RosterItem(parent:XML = null)
RosterItem
 Inherited
Add extension to the list of the given namespace and insert to the XML element as a child.
ExtensionContainer
  
addGroupNamed(groupName:String):void
Adds a group to the roster item.
RosterItem
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(nameSpace:String):Array
ExtensionContainer
 Inherited
getAttribute(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
getChildAttribute(elem:String, name:String):String
Convinience method for getting child element attribute value from the XML.
XMLStanza
 Inherited
getChildField(elem:String, name:String):String
Convinience method for getting child element value from the XML.
XMLStanza
 Inherited
getExtension(elementName:String):IExtension
Get the extension having the given element name.
ExtensionContainer
 Inherited
getField(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
removeAllExtensions(nameSpace:String):void
ExtensionContainer
  
Remove all group elements
RosterItem
 Inherited
removeExtension(extension:IExtension):Boolean
ExtensionContainer
 Inherited
removeFields(name:String):void
Helper method for removing all child elements that have the given name.
XMLStanza
  
removeGroupByName(groupName:String):Boolean
Remove a single group with the given name
RosterItem
 Inherited
setAttribute(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
setChildAttribute(elem:String, name:String, value:String):void
Convinience method for setting an attribute for a child element of the XML.
XMLStanza
 Inherited
setChildField(elem:String, name:String, value:String):void
Convinience method for setting a value for a child element of the XML.
XMLStanza
 Inherited
setField(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
toString():String
Converts the base stanza XML to a string.
XMLStanza
Public Constants
 ConstantDefined By
 InheritedDEFAULT_NS : Namespace
[static] Default XML namespace.
XMLStanza
  ELEMENT_NAME : String = item
[static]
RosterItem
 InheritedFLASH_NS : Namespace
[static]
XMLStanza
 InheritedSTREAM_NS : Namespace
[static]
XMLStanza
Property Detail
askTypeproperty
askType:String

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:int  [read-only]

Get the number of group elements in this roster item.


Implementation
    public function get groupCount():int
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

The JID for this roster item. Required.


Implementation
    public function get jid():EscapedJID
    public function set jid(value:EscapedJID):void
nameproperty 
name:String

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

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

See also

Constructor Detail
RosterItem()Constructor
public function RosterItem(parent:XML = null)

Parameters
parent:XML (default = null) — The parent XML
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

removeAllGroups()method 
public function removeAllGroups():void

Remove all group elements

removeGroupByName()method 
public function removeGroupByName(groupName:String):Boolean

Remove a single group with the given name

Parameters

groupName:String

Returns
Boolean
Constant Detail
ELEMENT_NAMEConstant
public static const ELEMENT_NAME:String = item