Packagech.capi.net.app
Classpublic class ApplicationFileParser
InheritanceApplicationFileParser Inheritance Object

Parser of ApplicationFile objects. The XMLSchema and a XML validator can be found here.

See also

ApplicationFile
ApplicationMassLoader
ApplicationConfigLoader


Public Properties
 PropertyDefined By
  applicationContext : IApplicationContext
Defines the IApplicationContext.
ApplicationFileParser
  initializeFile : Function = null
Defines a callback method that is called when an ApplicationFile is created.
ApplicationFileParser
  loadableFileFactory : LoadableFileFactory
Defines the LoadableFileFactory to use to create the ILoadableFile objects.
ApplicationFileParser
Public Methods
 MethodDefined By
  
Creates a new ApplicationFileParser object.
ApplicationFileParser
  
createWithNewContext(contextName:String, loadableFileFactory:LoadableFileFactory = null):ApplicationFileParser
[static] Creates a new ApplicationFileParser using a new empty ApplicationContext.
ApplicationFileParser
  
parse(source:String, contextName:String = null, loadableFileFactory:LoadableFileFactory = null):IApplicationContext
[static] Parses the specified source String, using the specified LoadableFileFactory in a new ApplicationContext.
ApplicationFileParser
  
parseDependencies(node:XMLNode):void
Parses the ApplicationFile dependencies of the specified XMLNode.
ApplicationFileParser
  
parseFiles(node:XMLNode):void
Parses the ApplicationFile of the specified XMLNode.
ApplicationFileParser
  
parseNode(node:XMLNode):void
Parse the specified XMLNode.
ApplicationFileParser
  
parseVariables(node:XMLNode):void
Parses the variables of the specified XMLNode.
ApplicationFileParser
Protected Methods
 MethodDefined By
  
createApplicationFile(node:XMLNode, folderPath:String):ApplicationFile
Creates a ApplicationFile from the XMLNode.
ApplicationFileParser
  
createLoadableFile(url:String, type:String = null, appDomainPolicy:String = null, secDomainPolicy:String = null):ILoadableFile
Creates a ILoadableFile object.
ApplicationFileParser
  
Initialize the ApplicationFile.
ApplicationFileParser
  
putVariable(name:String, value:String):void
Put the specified variable and its value in the LoadableFileFactory.
ApplicationFileParser
Property Detail
applicationContextproperty
applicationContext:IApplicationContext  [read-write]

Defines the IApplicationContext.


Implementation
    public function get applicationContext():IApplicationContext
    public function set applicationContext(value:IApplicationContext):void
initializeFileproperty 
public var initializeFile:Function = null

Defines a callback method that is called when an ApplicationFile is created. If this property is not null it will be called after the properties have initialized, but before the dependencies have been added. The signature of the method should be the following : function(appFile:ApplicationFile, fileNode:XMLNode):void.

loadableFileFactoryproperty 
loadableFileFactory:LoadableFileFactory  [read-write]

Defines the LoadableFileFactory to use to create the ILoadableFile objects.


Implementation
    public function get loadableFileFactory():LoadableFileFactory
    public function set loadableFileFactory(value:LoadableFileFactory):void
Constructor Detail
ApplicationFileParser()Constructor
public function ApplicationFileParser(context:IApplicationContext, loadableFileFactory:LoadableFileFactory = null)

Creates a new ApplicationFileParser object.

Parameters
context:IApplicationContext — The ApplicationContext.
 
loadableFileFactory:LoadableFileFactory (default = null) — The LoadableFileFactory. If not defined, then the LoadableFileFactory.defaultLoadableFileFactory will be used.
Method Detail
createApplicationFile()method
protected function createApplicationFile(node:XMLNode, folderPath:String):ApplicationFile

Creates a ApplicationFile from the XMLNode.

Parameters

node:XMLNode — The XMLNode to parse.
 
folderPath:String — The path to be added as prefix for the file URL.

Returns
ApplicationFile — The created ApplicationFile.

Throws
ch.capi.errors:ParseError If — the url attribute is not defined.
createLoadableFile()method 
protected function createLoadableFile(url:String, type:String = null, appDomainPolicy:String = null, secDomainPolicy:String = null):ILoadableFile

Creates a ILoadableFile object.

Parameters

url:String — The url.
 
type:String (default = null) — The type issued from the LoadableFileFactory constants.
 
appDomainPolicy:String (default = null) — The ApplicationDomain policy.
 
secDomainPolicy:String (default = null) — The SecurityDomain policy.

Returns
ILoadableFile — The ILoadableFile created.

See also

createWithNewContext()method 
public static function createWithNewContext(contextName:String, loadableFileFactory:LoadableFileFactory = null):ApplicationFileParser

Creates a new ApplicationFileParser using a new empty ApplicationContext.

Parameters

contextName:String — The name of the new ApplicationContext.
 
loadableFileFactory:LoadableFileFactory (default = null) — The LoadableFileFactory. If not defined, then the LoadableFileFactory.defaultLoadableFileFactory will be used.

Returns
ApplicationFileParser — The created ApplicationFileParser.
initializeApplicationFile()method 
protected function initializeApplicationFile(appFile:ApplicationFile):void

Initialize the ApplicationFile. This method initialize the main properties of the specified ApplicationFile and its ILoadableFile.

Parameters

appFile:ApplicationFile — The ApplicationFile to initialize.


Throws
ch.capi.errors:ParseError If — there is a parse error.
parse()method 
public static function parse(source:String, contextName:String = null, loadableFileFactory:LoadableFileFactory = null):IApplicationContext

Parses the specified source String, using the specified LoadableFileFactory in a new ApplicationContext.

Parameters

source:String — The source String in XML format that matches the XMLSchema.
 
contextName:String (default = null) — Defines the name of the ApplicationContext. If no context name is specified, then the global ApplicationContext will be used.
 
loadableFileFactory:LoadableFileFactory (default = null) — The LoadableFileFactory. If not defined, then the LoadableFileFactory.defaultLoadableFileFactory will be used.

Returns
IApplicationContext — The new ApplicationContext that contains all the parsed ApplicationFile instances.

Throws
ch.capi.errors:DataError If — the contextName and the context attribute is null.
parseDependencies()method 
public function parseDependencies(node:XMLNode):void

Parses the ApplicationFile dependencies of the specified XMLNode.

Parameters

node:XMLNode — The XMLNode.

parseFiles()method 
public function parseFiles(node:XMLNode):void

Parses the ApplicationFile of the specified XMLNode.

Parameters

node:XMLNode — The XMLNode.

parseNode()method 
public function parseNode(node:XMLNode):void

Parse the specified XMLNode. The specified node must contains at least one subnode with all the files declaration. The second subnode will contains the dependencies.

Parameters

node:XMLNode — The XMLNode to parse.

parseVariables()method 
public function parseVariables(node:XMLNode):void

Parses the variables of the specified XMLNode.

Parameters

node:XMLNode — The XMLNode.

putVariable()method 
protected function putVariable(name:String, value:String):void

Put the specified variable and its value in the LoadableFileFactory.

Parameters

name:String — The variable name.
 
value:String — The variable value.