Packagecom.threerings.util
Classpublic class XmlUtil



Public Methods
 MethodDefined by
  
getAttr(xml:XML, name:String, defaultValue:Function, parseFunction:* = null):*
[static]
XmlUtil
  
getBooleanAttr(xml:XML, name:String, defaultValue:*):Boolean
[static]
XmlUtil
  
getEnumAttr(xml:XML, name:String, enumClazz:Class, defaultValue:*):*
[static]
XmlUtil
  
getIntAttr(xml:XML, name:String, defaultValue:*):int
[static]
XmlUtil
  
getNumberAttr(xml:XML, name:String, defaultValue:*):Number
[static]
XmlUtil
  
getSingleChild(xml:XML, name:String, defaultValue:*):XML
[static]
XmlUtil
  
getStringArrayAttr(xml:XML, name:String, stringMapping:Array, defaultValue:*):int
[static]
XmlUtil
  
getStringAttr(xml:XML, name:String, defaultValue:*):String
[static]
XmlUtil
  
getUintAttr(xml:XML, name:String, defaultValue:*):uint
[static]
XmlUtil
  
hasAttribute(xml:XML, name:String):Boolean
[static]
XmlUtil
  
hasChild(xml:XML, name:String):Boolean
[static]
XmlUtil
  
newXML(value:Object, settings:Object = null):XML
[static] Parse the 'value' object into XML safely.
XmlUtil
  
safeOp(fn:Function, settings:Object = null):*
[static] Perform an operation on XML that takes place using the specified settings, and restores the XML settings to their previous values.
XmlUtil
  
toString(xml:XML, settings:Object = null):String
[static] Call toString() on the specified XML object safely.
XmlUtil
  
toXMLString(xml:XML, settings:Object = null):String
[static] Call toXMLString() on the specified XML object safely.
XmlUtil
Protected Methods
 MethodDefined by
  
parseStringMember(stringVal:String, stringMapping:Array):int
[static]
XmlUtil
Method detail
getAttr()method
public static function getAttr(xml:XML, name:String, defaultValue:Function, parseFunction:* = null):*Parameters
xml:XML
 
name:String
 
defaultValue:Function
 
parseFunction:* (default = null)

Returns
*
getBooleanAttr()method 
public static function getBooleanAttr(xml:XML, name:String, defaultValue:*):BooleanParameters
xml:XML
 
name:String
 
defaultValue:*

Returns
Boolean
getEnumAttr()method 
public static function getEnumAttr(xml:XML, name:String, enumClazz:Class, defaultValue:*):*Parameters
xml:XML
 
name:String
 
enumClazz:Class
 
defaultValue:*

Returns
*
getIntAttr()method 
public static function getIntAttr(xml:XML, name:String, defaultValue:*):intParameters
xml:XML
 
name:String
 
defaultValue:*

Returns
int
getNumberAttr()method 
public static function getNumberAttr(xml:XML, name:String, defaultValue:*):NumberParameters
xml:XML
 
name:String
 
defaultValue:*

Returns
Number
getSingleChild()method 
public static function getSingleChild(xml:XML, name:String, defaultValue:*):XMLParameters
xml:XML
 
name:String
 
defaultValue:*

Returns
XML
getStringArrayAttr()method 
public static function getStringArrayAttr(xml:XML, name:String, stringMapping:Array, defaultValue:*):intParameters
xml:XML
 
name:String
 
stringMapping:Array
 
defaultValue:*

Returns
int
getStringAttr()method 
public static function getStringAttr(xml:XML, name:String, defaultValue:*):StringParameters
xml:XML
 
name:String
 
defaultValue:*

Returns
String
getUintAttr()method 
public static function getUintAttr(xml:XML, name:String, defaultValue:*):uintParameters
xml:XML
 
name:String
 
defaultValue:*

Returns
uint
hasAttribute()method 
public static function hasAttribute(xml:XML, name:String):BooleanParameters
xml:XML
 
name:String

Returns
Boolean
hasChild()method 
public static function hasChild(xml:XML, name:String):BooleanParameters
xml:XML
 
name:String

Returns
Boolean
newXML()method 
public static function newXML(value:Object, settings:Object = null):XML

Parse the 'value' object into XML safely. This is equivalent to new XML(value) but offers protection from other code that may have changing the default settings used for parsing XML. Also, if you would like to use non-standard parsing settings this method will protect other code from being broken by you.

Parameters
value:Object — the value to parse into XML.
 
settings:Object (default = null) — an Object containing your desired XML settings, or null (or omitted) to use the default settings.

Returns
XML

See also

XML.setSettings()
parseStringMember()method 
protected static function parseStringMember(stringVal:String, stringMapping:Array):intParameters
stringVal:String
 
stringMapping:Array

Returns
int
safeOp()method 
public static function safeOp(fn:Function, settings:Object = null):*

Perform an operation on XML that takes place using the specified settings, and restores the XML settings to their previous values.

Parameters
fn:Function — a function to be called with no arguments.
 
settings:Object (default = null) — an Object containing your desired XML settings, or null (or omitted) to use the default settings.

Returns
* — the return value of your function, if any.

See also

XML.setSettings()
XML.settings()
toString()method 
public static function toString(xml:XML, settings:Object = null):String

Call toString() on the specified XML object safely. This is equivalent to xml.toString() but offers protection from other code that may have changed the default settings used for stringing XML. Also, if you would like to use the non-standard printing settings this method will protect other code from being broken by you.

Parameters
xml:XML — the xml value to Stringify.
 
settings:Object (default = null) — an Object containing your desired XML settings, or null (or omitted) to use the default settings.

Returns
String

See also

XML.toString()
XML.setSettings()
toXMLString()method 
public static function toXMLString(xml:XML, settings:Object = null):String

Call toXMLString() on the specified XML object safely. This is equivalent to xml.toXMLString() but offers protection from other code that may have changed the default settings used for stringing XML. Also, if you would like to use the non-standard printing settings this method will protect other code from being broken by you.

Parameters
xml:XML — the xml value to Stringify.
 
settings:Object (default = null) — an Object containing your desired XML settings, or null (or omitted) to use the default settings.

Returns
String

See also

XML.toXMLString()
XML.setSettings()