Packagech.capi.core
Classpublic final class ApplicationFile

Represents an application file.

See also

ApplicationFileParser
ApplicationMassLoader


Public Properties
 PropertyDefined by
  applicationContext : ApplicationContext
[read-only] Defines the ApplicationContext 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
Public Methods
 MethodDefined by
  
ApplicationFile(name:String, loadableFile:ILoadableFile = null, context:ApplicationContext = null)
Creates a new ApplicationFile object.
ApplicationFile
  
Add an ApplicationFile as dependency for this file.
ApplicationFile
  
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
  
getFile(name:String, context:ApplicationContext = null):ApplicationFile
[static] Retrieves the specified ApplicationFile.
ApplicationFile
  
getParents():Array
Get all the ApplicationFile that have this file as directed dependency.
ApplicationFile
  
Retrieves if the ApplicationFile is a direct dependency of the specified ApplicationFile.
ApplicationFile
  
removeDependency(file:ApplicationFile, recursiveSearch:Boolean = false):void
Removes a dependency from the ApplicationFile.
ApplicationFile
  
ApplicationFile
Protected Methods
 MethodDefined by
  
Check if the dependency is safe for a ApplicationFile.
ApplicationFile
Property detail
applicationContextproperty
applicationContext:ApplicationContext  [read-only]

Defines the ApplicationContext of the ApplicationFile.

Implementation
    public function get applicationContext():ApplicationContext
dependenciesproperty 
dependencies:Array  [read-only]

Defines the dependencies. This is an Array of ApplicationFile that is duplicated from the original Array.

Implementation
    public function get dependencies():Array
globalproperty 
global:Boolean  [read-write]

Defines if the ApplicationFile is global or not.

Implementation
    public function get global():Boolean
    public function set global(value:Boolean):void
loadableFileproperty 
loadableFile:ILoadableFile  [read-write]

Defines the ILoadableFile.

Implementation
    public function get loadableFile():ILoadableFile
    public function set loadableFile(value:ILoadableFile):void
nameproperty 
name:String  [read-only]

Defines the name. The name is unique trough all the ApplicationFile objects.

Implementation
    public function get name():String
Constructor detail
ApplicationFile()constructor
public function ApplicationFile(name:String, loadableFile:ILoadableFile = null, context:ApplicationContext = null)

Creates a new ApplicationFile object.

Parameters
name:String — The name. It must be unique !
 
loadableFile:ILoadableFile (default = null) — The linked ILoadableFile.
 
context:ApplicationContext (default = null) — The ApplicationContext. If not specified, then the global context will be used.

Throws
NameAlreadyExistsError — If the specified name already exists into the specified ApplicationContext.
Method detail
addDependency()method
public function addDependency(file:ApplicationFile):void

Add an ApplicationFile as dependency for 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 into the same ApplicationContext.

Parameters
file:ApplicationFile — The ApplicationFile to add.

Throws
— If the ApplicationContext is not the same.
 
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.

Returns
* — The data of the ILoadableFile.

See also

getFile()method 
public static function getFile(name:String, context:ApplicationContext = null):ApplicationFile

Retrieves the specified ApplicationFile. This method is just an encapsulation to retrieve the file throught the ApplicationContext.

Parameters
name:String — The name of the file to retrieve.
 
context:ApplicationContext (default = null) — The ApplicationContext. If not specified, the global context will be used.

Returns
ApplicationFile — The ApplicationFile or null.
getParents()method 
public function getParents():Array

Get all the ApplicationFile that have this file as directed dependency.

Returns
Array — The parents.
isDependencyOf()method 
public function isDependencyOf(file:ApplicationFile):Boolean

Retrieves if the ApplicationFile is a direct dependency of the specified ApplicationFile.

Parameters
file:ApplicationFile — The parent ApplicationFile.

Returns
Boolean
isDependencySafe()method 
protected function isDependencySafe(file:ApplicationFile):Boolean

Check if the dependency is safe for a ApplicationFile.

Parameters
file:ApplicationFile — The file to add as a dependency.

Returns
Booleantrue 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 trought the dependency tree. The removal will be stopped after the first instance of the dependency has been found.
setContext()method 
public function setContext(value:ApplicationContext):voidParameters
value:ApplicationContext