| Package | ch.capi.net.app |
| Class | public final class ApplicationFile |
| Inheritance | ApplicationFile Object |
ApplicationFile is always registered in
an IApplicationContext that will manage the unicity of each ApplicationFile.
Basically, an ApplicationFile just holds an ILoadableFile and stores
the dependencies of it.
See also
| Property | Defined By | ||
|---|---|---|---|
| applicationContext : IApplicationContext [read-only]
Defines the IApplicationContext of the ApplicationFile. | ApplicationFile | ||
| dependencies : Array [read-only]
Defines the dependencies. | ApplicationFile | ||
| global : Boolean
Defines if the ApplicationFile is global or not. | ApplicationFile | ||
| loadableFile : ILoadableFile
Defines the ILoadableFile. | ApplicationFile | ||
| name : String [read-only]
Defines the name. | ApplicationFile | ||
| priority : int
Defines the priority of the ApplicationFile. | ApplicationFile | ||
| properties : IProperties [read-only]
Defines the Properties of the linked ILoadableFile. | ApplicationFile | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new ApplicationFile object. | ApplicationFile | ||
addDependency(file:ApplicationFile):void
Add an ApplicationFile as dependency of this file. | ApplicationFile | ||
clearDependencies():void
Removes all the dependencies of the ApplicationFile. | ApplicationFile | ||
getData(asClass:String = null, appDomain:ApplicationDomain = null):*
Retrieves the data of the ILoadableFile linked to the ApplicationFile. | ApplicationFile | ||
getParents():Array
Get all the ApplicationFile that have this file as direct dependency. | ApplicationFile | ||
getProperty(key:*):*
Retrieves the value of the specified key from the properties of the ILoadableFile. | ApplicationFile | ||
isDependencyOf(file:ApplicationFile, recursiveSearch:Boolean = true):Boolean
Retrieves if the ApplicationFile is a dependency of the specified
ApplicationFile. | ApplicationFile | ||
removeDependency(file:ApplicationFile, recursiveSearch:Boolean = false):void
Removes a dependency from the ApplicationFile. | ApplicationFile | ||
setContext(value:IApplicationContext):void
this method is just used to communicate the context between the ApplicationFile and ApplicationContext classes
and shouldn't be used !
| ApplicationFile | ||
toString():String
Represents this ApplicationFile in a String. | ApplicationFile | ||
| Method | Defined By | ||
|---|---|---|---|
isDependencyRecursive(file:ApplicationFile):Boolean
Check if the dependency is safe for a ApplicationFile. | ApplicationFile | ||
| applicationContext | property |
applicationContext:IApplicationContext [read-only]
Defines the IApplicationContext of the ApplicationFile.
public function get applicationContext():IApplicationContext| dependencies | property |
dependencies:Array [read-only]
Defines the dependencies. This is an Array of ApplicationFile that
is duplicated from the original Array.
public function get dependencies():Array| global | property |
global:Boolean [read-write]
Defines if the ApplicationFile is global or not.
public function get global():Boolean public function set global(value:Boolean):void| loadableFile | property |
loadableFile:ILoadableFile [read-write]
Defines the ILoadableFile.
public function get loadableFile():ILoadableFile public function set loadableFile(value:ILoadableFile):void| name | property |
name:String [read-only]
Defines the name. The name is unique trough all the ApplicationFile objects.
public function get name():String| priority | property |
priority:int [read-write]
Defines the priority of the ApplicationFile. This value is only used if the ApplicationFile
is directly added in the ApplicationMassLoader.
public function get priority():int public function set priority(value:int):voidSee also
| properties | property |
properties:IProperties [read-only]
Defines the Properties of the linked ILoadableFile.
public function get properties():IPropertiesSee also
| ApplicationFile | () | Constructor |
public function ApplicationFile(name:String, context:IApplicationContext, loadableFile:ILoadableFile = null)
Creates a new ApplicationFile object.
name:String — The name. It must be unique !
| |
context:IApplicationContext — The IApplicationContext. If not specified, then the global context will be used.
| |
loadableFile:ILoadableFile (default = null) — The linked ILoadableFile.
|
ch.capi.errors:NameAlreadyExistsError If — the specified name already exists in the specified IApplicationContext.
|
| addDependency | () | method |
public function addDependency(file:ApplicationFile):void
Add an ApplicationFile as dependency of this file. It means that the specified
file is necessary to be loaded before the current ApplicationFile can
be executed.
The ApplicationFile added as dependency must be in the same IApplicationContext.
Parameters
file:ApplicationFile — The ApplicationFile to add.
|
ArgumentError If — the IApplicationContext is not the same.
| |
ch.capi.errors:DependencyNotSafeError If — the dependency is not safe.
|
| clearDependencies | () | method |
public function clearDependencies():void
Removes all the dependencies of the ApplicationFile.
| getData | () | method |
public function getData(asClass:String = null, appDomain:ApplicationDomain = null):*
Retrieves the data of the ILoadableFile linked to the ApplicationFile. If
the loadManagerObject is a URLLoader, then the data are returned else the
loadManagerObject itself is returned.
Parameters
asClass:String (default = null) — The class that should be returned by the method (cf ILoadableFile implementation).
| |
appDomain:ApplicationDomain (default = null) — The ApplicationDomain of the class.
|
* — The data of the ILoadableFile.
|
See also
| getParents | () | method |
public function getParents():Array
Get all the ApplicationFile that have this file as direct dependency.
Array — The parents.
|
| getProperty | () | method |
public function getProperty(key:*):*
Retrieves the value of the specified key from the properties of the ILoadableFile. If
the ILoadableFile is not defined, null is returned.
Parameters
key:* — The key.
|
* — The value or null.
|
See also
| isDependencyOf | () | method |
public function isDependencyOf(file:ApplicationFile, recursiveSearch:Boolean = true):Boolean
Retrieves if the ApplicationFile is a dependency of the specified
ApplicationFile.
Parameters
file:ApplicationFile — The parent ApplicationFile.
| |
recursiveSearch:Boolean (default = true) — Defines if the dependency must be searched recursively.
|
Boolean |
| isDependencyRecursive | () | method |
protected function isDependencyRecursive(file:ApplicationFile):Boolean
Check if the dependency is safe for a ApplicationFile.
Parameters
file:ApplicationFile — The file to add as a dependency.
|
Boolean — true is the dependency is safe.
|
| removeDependency | () | method |
public function removeDependency(file:ApplicationFile, recursiveSearch:Boolean = false):void
Removes a dependency from the ApplicationFile.
Parameters
file:ApplicationFile — The dependency to remove.
| |
recursiveSearch:Boolean (default = false) — Defines if the search of the dependency must recursive through the dependency tree.
The removal will be stopped after the first instance of the dependency has been found.
|
| setContext | () | method |
public function setContext(value:IApplicationContext):voidthis method is just used to communicate the context between the ApplicationFile and ApplicationContext classes and shouldn't be used !
Parameters
value:IApplicationContext |
| toString | () | method |
public function toString():String
Represents this ApplicationFile in a String. This gives just useful information
for debugging purpose.
String — A String representation of this ApplicationFile.
|