Packagech.capi.net.app
Interfacepublic interface IApplicationContext
Implementors ApplicationContext

Represents a context for the ApplicationFile.



Public Properties
 PropertyDefined By
  name : String
[read-only] Defines the name of the ApplicationContext.
IApplicationContext
Public Methods
 MethodDefined By
  
Add the specified ApplicationFile to the current ApplicationContext.
IApplicationContext
  
clear():void
Clear all the ApplicationFile of the ApplicationContext.
IApplicationContext
  
enumerateAll(excludeGlobalFiles:Boolean = false):Array
Enumerates all the ApplicationFile contained in the ApplicationContext.
IApplicationContext
  
Enumerates all the global ApplicationFile contained in the ApplicationContext.
IApplicationContext
  
Enumerates all the ApplicationFile that doesn't have any dependency.
IApplicationContext
  
Enumerates all the ApplicationFile that are on the root of the tree.
IApplicationContext
  
Get the ApplicationFile linked to the specified name.
IApplicationContext
  
getFileByProps(props:Object, strict:Boolean = false):ApplicationFile
Retrieves the first ApplicationFile that matches the specified properties.
IApplicationContext
  
getFilesByProps(props:Object, strict:Boolean = false):Array
Retrieves all the files that matche the specified properties.
IApplicationContext
  
removeFile(file:ApplicationFile, recursiveRemoval:Boolean = false):void
Remove the specified ApplicationFile from the ApplicationContext.
IApplicationContext
Property Detail
nameproperty
name:String  [read-only]

Defines the name of the ApplicationContext.


Implementation
    public function get name():String
Method Detail
addFile()method
public function addFile(file:ApplicationFile):void

Add the specified ApplicationFile to the current ApplicationContext. If the context of the ApplicationFile is already specified, this method will throw an error.

This method will also check that all dependencies of the specified ApplicationFile are already in the current ApplicationContext. If they are in no ApplicationContext they will be added in the current one, otherwise an error will be thrown.

Parameters

file:ApplicationFile — The ApplicationFile.


Throws
ArgumentError If — the ApplicationContext of the file is not null.
 
ArguemntError If — one of the dependencies is in another ApplicationContext.
 
NameAlreadyExistsError If — the name of the ApplicationFile is already taken.
clear()method 
public function clear():void

Clear all the ApplicationFile of the ApplicationContext. The context property of the ApplicationFile instances are reset to null to let the Garbate Collector take care of the ApplicationContext instance.

enumerateAll()method 
public function enumerateAll(excludeGlobalFiles:Boolean = false):Array

Enumerates all the ApplicationFile contained in the ApplicationContext.

Parameters

excludeGlobalFiles:Boolean (default = false) — Defines if the global files must be excluded.

Returns
Array — An Array containing the enumerated ApplicationFile.
enumerateGlobals()method 
public function enumerateGlobals():Array

Enumerates all the global ApplicationFile contained in the ApplicationContext.

Returns
Array — An Array containing the enumerated ApplicationFile.
enumerateLeaves()method 
public function enumerateLeaves():Array

Enumerates all the ApplicationFile that doesn't have any dependency.

Returns
Array — An Array containing all the ApplicationFile that doesn't have any dependency.

See also

enumerateRoots()method 
public function enumerateRoots():Array

Enumerates all the ApplicationFile that are on the root of the tree. That means that no other ApplicationFile have it as dependency.

Returns
Array — An Array containing all the ApplicationFile that are not in any dependency.

See also

getFile()method 
public function getFile(name:String):ApplicationFile

Get the ApplicationFile linked to the specified name.

Parameters

name:String — The name of the ApplicationFile.

Returns
ApplicationFile — The ApplicationFile or null if the file doesn't exist.

Throws
Error If — there is no ApplicationFile matching the specified name.
getFileByProps()method 
public function getFileByProps(props:Object, strict:Boolean = false):ApplicationFile

Retrieves the first ApplicationFile that matches the specified properties.

Parameters

props:Object — An Object containing the properties to match.
 
strict:Boolean (default = false) — Defines if the check must be strict or not.

Returns
ApplicationFile — The first ApplicationFile instance that matches the properties or null.

See also

getFilesByProps()method 
public function getFilesByProps(props:Object, strict:Boolean = false):Array

Retrieves all the files that matche the specified properties.

Parameters

props:Object — An Object containing the properties to match.
 
strict:Boolean (default = false) — Defines if the check must be strict or not.

Returns
Array — An Array of ILoadableFile that matche the specified properties.

See also

removeFile()method 
public function removeFile(file:ApplicationFile, recursiveRemoval:Boolean = false):void

Remove the specified ApplicationFile from the ApplicationContext. All the ApplicationFile having the specified file as dependency, will have it removed.

If the recursiveRemoval argument is set to true, then all the dependencies of the specified file will also be removed from the ApplicationContext. In the other case, all the dependencies of the specified ApplicationFile are cleared.

Parameters

file:ApplicationFile — The ApplicationFile to remove.
 
recursiveRemoval:Boolean (default = false) — If the removal must be applied on all the dependencies of the file.


Throws
flash.errors:IllegalOperationError If — the file is not in the ApplicationContext.