Packageorg.spicefactory.parsley.xml.processor
Classpublic class XmlConfigurationLoader
InheritanceXmlConfigurationLoader Inheritance flash.events.EventDispatcher

Responsible for loading Parsley XML configuration files.



Public Properties
 PropertyDefined By
  currentFile : String
[read-only] The name of the file currently loading.
XmlConfigurationLoader
  loadedFiles : Array
[read-only] The files that were already loaded.
XmlConfigurationLoader
Public Methods
 MethodDefined By
  
XmlConfigurationLoader(files:Array, expressionContext:ExpressionContext)
Creates a new instance.
XmlConfigurationLoader
  
cancel():void
Cancels the loading operation.
XmlConfigurationLoader
  
load(domain:ApplicationDomain):void
Loads the XML configuration files.
XmlConfigurationLoader
Protected Methods
 MethodDefined By
  
handleError(message:String, cause:Object = null):void
Invoked when the loading operation for a single file failed.
XmlConfigurationLoader
  
handleLoadedFile(fileContent:String):void
Invoked when the loading operation for a single file has completed.
XmlConfigurationLoader
  
loadFile(file:String):void
Starts the loading operation for a single file.
XmlConfigurationLoader
  
preprocess(xml:XML):void
Preprocesses the loaded XML.
XmlConfigurationLoader
Property Detail
currentFileproperty
currentFile:String  [read-only]

The name of the file currently loading.


Implementation
    public function get currentFile():String
loadedFilesproperty 
loadedFiles:Array  [read-only]

The files that were already loaded. An Array of XmlFile instances.


Implementation
    public function get loadedFiles():Array
Constructor Detail
XmlConfigurationLoader()Constructor
public function XmlConfigurationLoader(files:Array, expressionContext:ExpressionContext)

Creates a new instance.

Parameters
files:Array — the names of the files to load
 
expressionContext:ExpressionContext — the expression context to use for preprocessing the loaded files
Method Detail
cancel()method
public function cancel():void

Cancels the loading operation.

handleError()method 
protected function handleError(message:String, cause:Object = null):void

Invoked when the loading operation for a single file failed.

Parameters

message:String — the error message
 
cause:Object (default = null) — the cause of the failure

handleLoadedFile()method 
protected function handleLoadedFile(fileContent:String):void

Invoked when the loading operation for a single file has completed.

Parameters

fileContent:String — the content of the file as a String (containing the loaded XML)

load()method 
public function load(domain:ApplicationDomain):void

Loads the XML configuration files.

Parameters

domain:ApplicationDomain — the ApplicationDomain for preprocessing the loaded files

loadFile()method 
protected function loadFile(file:String):void

Starts the loading operation for a single file.

Parameters

file:String — the name of the file to load

preprocess()method 
protected function preprocess(xml:XML):void

Preprocesses the loaded XML. This includes processing variable elements and include elements. For each include element the name of the file will be added to the internal list of files to load. After preprocessing variable and include nodes will be removed from the XML as the main XML-to-Object Mapper for Parsley XML configuration does not know/accept them (and wouldn't be able to deal with them).

Parameters

xml:XML — the loaded XML to preprocess