Package | org.puremvc.as3.utilities.air.xmldb.model |
Class | public class XMLDatabaseProxy |
Inheritance | XMLDatabaseProxy ![]() |
Implements | IXMLDatabaseProxy, org.puremvc.as3.interfaces.IProxy |
Property | Defined by | ||
---|---|---|---|
dbFile : File | XMLDatabaseProxy | ||
dbName : String | XMLDatabaseProxy | ||
xml : XML [read-only]
Cast the data object to its actual type.
| XMLDatabaseProxy |
Method | Defined by | ||
---|---|---|---|
XMLDatabaseProxy(proxyName:String = null, data:Object = null)
Constructor.
| XMLDatabaseProxy | ||
initialize(dbName:String, location:File):void
Initialize the XML database.
| XMLDatabaseProxy | ||
persist():void
Save the in memory XML Database to disk.
| XMLDatabaseProxy |
Method | Defined by | ||
---|---|---|---|
build():XML
Build a blank XML database.
| XMLDatabaseProxy | ||
parse():void
Parse the incoming XML database.
| XMLDatabaseProxy | ||
read():XML
Read the XML Database
| XMLDatabaseProxy | ||
write():void
Write the XML Database to disk.
| XMLDatabaseProxy |
dbFile | property |
protected var dbFile:File
dbName | property |
protected var dbName:String
xml | property |
xml:XML
[read-only]Cast the data object to its actual type.
This is a useful idiom for proxies. The PureMVC Proxy class defines a data property of type Object.
Here, we cast the generic data property to its actual type in a protected mode. This retains encapsulation, while allowing the instance (and subclassed instance) access to a strongly typed reference with a meaningful name.
Implementation protected function get xml():XML
XMLDatabaseProxy | () | constructor |
public function XMLDatabaseProxy(proxyName:String = null, data:Object = null)
Constructor.
ParametersproxyName:String (default = null )
|
|
data:Object (default = null )
|
build | () | method |
protected function build():XML
Build a blank XML database.
Override in subclass to return a skeleton database.
ReturnsXML — XML a blank XML database
|
initialize | () | method |
public function initialize(dbName:String, location:File):void
Initialize the XML database.
Read the file if it exists, or create one from scratch
This is called from the concrete subclass's constructor or later if you want to lazily initialize.
ParametersdbName:String |
|
location:File |
parse | () | method |
protected function parse():void
Parse the incoming XML database.
Override in subclass to parse the XML database into separate Proxies if need be.
Rather than clutter the concrete class with methods and properties for returning specific parts of the database, create separate proxies to tend specific areas of the XML database, and give them references to pieces of the XML document.
persist | () | method |
public function persist():void
Save the in memory XML Database to disk.
read | () | method |
protected function read():XML
Read the XML Database
ReturnsXML — XML the in memory representation of the XML
|
write | () | method |
protected function write():void
Write the XML Database to disk.