Packageorg.igniterealtime.xiff.core
Classpublic class AbstractJID
InheritanceAbstractJID Inheritance Object
Subclasses EscapedJID, UnescapedJID

This is a base class for the JID (Jabber Identifier) classes.

This class should not be instantiated directly, but should be subclassed instead.

It provides functionality to determine if a JID is valid, as well as extract the node, domain and resource from the JID.

The structure of JID is defined in RFC3920:

See also

http://tools.ietf.org/html/rfc3920#section-3


Public Properties
 PropertyDefined By
  bareJID : String
[read-only] The JID without the resource.
AbstractJID
  domain : String
[read-only] The domain portion of the JID.
AbstractJID
  node : String
[read-only] The node portion of the JID.
AbstractJID
  resource : String
[read-only] The resource portion of the JID.
AbstractJID
Protected Properties
 PropertyDefined By
  _domain : String
AbstractJID
  jidNodeValidator : RegExp
[static]
AbstractJID
  _node : String
AbstractJID
  _resource : String
AbstractJID
Public Methods
 MethodDefined By
  
AbstractJID(inJID:String, validate:Boolean = false)
Creates a new AbstractJID object.
AbstractJID
  
escapedNode(n:String):String
[static] Provides functionality to convert a JID to an escaped format.
AbstractJID
  
toString():String
Converts JID represented by this class to a String.
AbstractJID
  
unescapedNode(n:String):String
[static] Provides functionality to return an escaped JID into a normal String.
AbstractJID
Property Detail
_domainproperty
protected var _domain:String

_nodeproperty 
protected var _node:String

_resourceproperty 
protected var _resource:String

bareJIDproperty 
bareJID:String  [read-only]

The JID without the resource.


Implementation
    public function get bareJID():String
domainproperty 
domain:String  [read-only]

The domain portion of the JID.


Implementation
    public function get domain():String
jidNodeValidatorproperty 
protected static var jidNodeValidator:RegExp

nodeproperty 
node:String  [read-only]

The node portion of the JID.


Implementation
    public function get node():String
resourceproperty 
resource:String  [read-only]

The resource portion of the JID.


Implementation
    public function get resource():String
Constructor Detail
AbstractJID()Constructor
public function AbstractJID(inJID:String, validate:Boolean = false)

Creates a new AbstractJID object. Used via EscapedJID or UnescapedJID.

Each allowable portion of a JID (node identifier, domain identifier, and resource identifier) MUST NOT be more than 1023 bytes in length, resulting in a maximum total size (including the @ and / separators) of 3071 bytes.

Parameters
inJID:String — The JID as a String.
 
validate:Boolean (default = false) — True if the JID should be validated.
Method Detail
escapedNode()method
public static function escapedNode(n:String):String

Provides functionality to convert a JID to an escaped format.

Parameters

n:String — The string to escape.

Returns
String — The escaped string. TODO: simplify with native methods

See also

toString()method 
public function toString():String

Converts JID represented by this class to a String.

Returns
String — The JID as a String.
unescapedNode()method 
public static function unescapedNode(n:String):String

Provides functionality to return an escaped JID into a normal String.

Parameters

n:String — The string to unescape.

Returns
String — The unescaped string.