Packageorg.spicefactory.parsley.core.scope.impl
Classpublic class DefaultScopeExtensions
InheritanceDefaultScopeExtensions Inheritance Object
Implements ScopeExtensions

Default implementation of the ScopeExtensions interface.



Public Methods
 MethodDefined By
  
DefaultScopeExtensions(types:Dictionary, initCallback:Function)
Creates a new instance.
DefaultScopeExtensions
  
forType(type:Class):Object
Obtains the extension of the specified type.
DefaultScopeExtensions
  
hasType(type:Class):Boolean
Indicates whether this object contains an extension of the specified type.
DefaultScopeExtensions
Constructor Detail
DefaultScopeExtensions()Constructor
public function DefaultScopeExtensions(types:Dictionary, initCallback:Function)

Creates a new instance.

Parameters
types:Dictionary — all extensions for this instance mapped by type
 
initCallback:Function — the callback to invoke when creating a new instance of a scope extension
Method Detail
forType()method
public function forType(type:Class):Object

Obtains the extension of the specified type. When using this method the scope must contain exactly one instance of a matching type, otherwise an Error will be thrown.

Parameters

type:Class — the type of extenstion to obtain

Returns
Object — the extension with a matching type
hasType()method 
public function hasType(type:Class):Boolean

Indicates whether this object contains an extension of the specified type.

Parameters

type:Class — the type of extension to check

Returns
Boolean — true if this object contains an extension of the specified type