XMLs

Provides facilities for dealing with XMLs-structured data.  This format is used for transfering complex data types between various languages and systems in a simple, human-readable and editable way.  This is similar to JSON and other text-based serialization systems but is easier to read/write and implement in a variety of ways.  Refer to the BNMAPI documentation for a detailed description of the XMLs format and mnemonics available for implementation.

__/ REQUIREMENTS \__

ActionScript 3.0 (or later)

__/ IMPORTS \__

nothing

__/ EXTENDS \__

flash.xml.* flash.utils.ByteArray com.bnm.api.CoreData com.bnm.api.instances.ErrorBroadcast com.bnm.api.instances.Exception

__/ IMPLEMENTS \__

nothing

__/ NOTICE \__

©opyright 2008 Bay New Media.  All rights, as stipulated in the The MIT License, are reserved.

This ActionScript library is licensed and released under the MIT License (http://www.opensource.org/licenses/mit-license.php).  Please refer to the accompanying text file “license.txt”, which should be distributed with every package and version of this library, for information on usage, distribution, copying, and other important information.

Please visit http://www.baynewmedia.com/ or email con.nosp@m.tact@baynewm.nosp@m.edia.com for information, questions, concerns, or bug reports.

__/ NOTES \__

This class is commented using the NaturalDocs documentation system.  It is intended to be easily read both from the direct source code and from an adaptation that is generated as hyperlinked HTML.  The NaturalDocs specification used in this class’ documentation is version 1.35 though older versions may probably be used safely.  For more information, please visit: http://www.naturaldocs.org/

The BNMAPI is officially available (primary sources) on Source Forge (http://sourceforge.net/projects/bnmapi/), on the Bay New Media site (http;//www.baynewmedia.com/), on the PeaBee project site (http://www.peabee.com/), and through the Bay New Media SVM repository server (visit http://www.baynewmedia.com/ for more information).  Downloads from other sources may not be complete or up-to-date.

If you’re interested in joining the BNMAPI project in any capacity (development, testing, distribution, etc.), please visit us on Source Forge or the Bay New Media web site.

Summary
XMLsProvides facilities for dealing with XMLs-structured data.
Variables
XMLs_version(String) A string version of the XMLs document version supported by this class.
_dataObject(Object) A generic object used to store deserialized data if not target is provided for this purpose.
Functions and Properties
XMLsThe constructor method for the class.
data
data
parseData
createDataFromNode
getDataTypeMnemonic
createString
createNumber
createInteger
createUnsigned
createBoolean
createObject
createXML
createMethod
createByte
getValue
getVariable
verifyXMLs

Variables

XMLs_version

private static var XMLs_version: String

(String) A string version of the XMLs document version supported by this class.  This is used to compare the supplied XMLs version with this version to ensure compatibility.  If the document does not specify a version, this version number is assigned and used though this is not recommended since compatibilty cannot be guaranteed.

_dataObject

private var _dataObject: Object

(Object) A generic object used to store deserialized data if not target is provided for this purpose.

Functions and Properties

XMLs

public function XMLs(...args)

The constructor method for the class.

Parameters

...  (untyped, optional): A number of parameters may be supplied directly to the constructor to avoid having to make extra method calls.  Possible argument assignments include (in order): data (XML or XMLList, optional): The XMLs data to parse into this class instance.  This is stored in the internal `data` reference unless a target is supplied. target (unyped, optional): A target into which to parse the data.  If not supplied, the internal data reference is used instead.  The target must be a dynamic type.

Returns

XMLs: A reference to the newly created class instance.

Broadcasts

nothing

Throws

nothing

data

public function get data():Object

data

public function set data(xmlData: *)

parseData

private function parseData(xmlData: *):void

createDataFromNode

private function createDataFromNode(nodeRef: *,
parentObject: *):void

getDataTypeMnemonic

private function getDataTypeMnemonic(mString: String):String

createString

private function createString(sourceXML: XML,
targetObject: *)

createNumber

private function createNumber(sourceXML: XML,
targetObject: *)

createInteger

private function createInteger(sourceXML: XML,
targetObject: *)

createUnsigned

private function createUnsigned(sourceXML: XML,
targetObject: *)

createBoolean

private function createBoolean(sourceXML: XML,
targetObject: *)

createObject

private function createObject(sourceXML: XML,
targetObject: *):Object

createXML

private function createXML(sourceXML: XML,
targetObject: *)

createMethod

private function createMethod(sourceXML: XML,
targetObject: *)

createByte

private function createByte(sourceXML: XML,
targetObject: *)

getValue

private function getValue(sourceXML: XML):String

getVariable

private function getVariable(sourceXML: XML,
targetObject: *):String

verifyXMLs

private function verifyXMLs(startNode: XML):Boolean
The Introspection class is used to analyze, or “introspect”, a running application.
private static var XMLs_version: String
(String) A string version of the XMLs document version supported by this class.
private var _dataObject: Object
(Object) A generic object used to store deserialized data if not target is provided for this purpose.
public function XMLs(...args)
The constructor method for the class.
public function get data():Object
private function parseData(xmlData: *):void
private function createDataFromNode(nodeRef: *,
parentObject: *):void
private function getDataTypeMnemonic(mString: String):String
private function createString(sourceXML: XML,
targetObject: *)
private function createNumber(sourceXML: XML,
targetObject: *)
private function createInteger(sourceXML: XML,
targetObject: *)
private function createUnsigned(sourceXML: XML,
targetObject: *)
private function createBoolean(sourceXML: XML,
targetObject: *)
private function createObject(sourceXML: XML,
targetObject: *):Object
private function createXML(sourceXML: XML,
targetObject: *)
private function createMethod(sourceXML: XML,
targetObject: *)
private function createByte(sourceXML: XML,
targetObject: *)
private function getValue(sourceXML: XML):String
private function getVariable(sourceXML: XML,
targetObject: *):String
private function verifyXMLs(startNode: XML):Boolean