Packageorg.spicefactory.parsley.core.registry
Interfacepublic interface ObjectDefinitionRegistry extends flash.events.IEventDispatcher
Implementors DefaultObjectDefinitionRegistry

A registry for object definitions.

All builtin Context implementations use such a registry internally.



Public Properties
 PropertyDefined By
  builders : ObjectDefinitionBuilderFactory
[read-only] A factory for obtaining builders for object definitions.
ObjectDefinitionRegistry
  context : Context
[read-only] The Context associated with this registry.
ObjectDefinitionRegistry
  domain : ApplicationDomain
[read-only] The ApplicationDomain to use for reflection.
ObjectDefinitionRegistry
  frozen : Boolean
[read-only] Indicates whether this registry has been frozen.
ObjectDefinitionRegistry
  properties : ConfigurationProperties
[read-only] Properties that may be used to build or process ObjectDefinitions.
ObjectDefinitionRegistry
Public Methods
 MethodDefined By
  
containsDefinition(id:String):Boolean
Checks whether this registry contains a definition with the specified id.
ObjectDefinitionRegistry
  
freeze():void
Freezes this registry.
ObjectDefinitionRegistry
  
getAllDefinitionsByType(type:Class):Array
Returns all definitions that match the specified type.
ObjectDefinitionRegistry
  
Returns the definition with the specified id or null if no such definition exists.
ObjectDefinitionRegistry
  
Returns the definition for the specified type or null if no such definition exists.
ObjectDefinitionRegistry
  
getDefinitionCount(type:Class = null):uint
Returns the number of definitions in this registry that match the specified type.
ObjectDefinitionRegistry
  
getDefinitionIds(type:Class = null):Array
Returns the ids of the definitions in this registry that match the specified type.
ObjectDefinitionRegistry
  
Registers an object definition with this registry.
ObjectDefinitionRegistry
  
Unregisters an object definition from this registry.
ObjectDefinitionRegistry
Events
 Event Summary Defined By
  Dispatched when configuration for this registry has been frozen.ObjectDefinitionRegistry
Property Detail
buildersproperty
builders:ObjectDefinitionBuilderFactory  [read-only]

A factory for obtaining builders for object definitions.


Implementation
    public function get builders():ObjectDefinitionBuilderFactory
contextproperty 
context:Context  [read-only]

The Context associated with this registry. During processing of ObjectDefinitions the configured property of the Context is still false and any attempt to fetch objects from the Context will lead to an Error. It is primarily exposed in case an extension wants to keep a reference to the Context for later use.


Implementation
    public function get context():Context
domainproperty 
domain:ApplicationDomain  [read-only]

The ApplicationDomain to use for reflection.


Implementation
    public function get domain():ApplicationDomain
frozenproperty 
frozen:Boolean  [read-only]

Indicates whether this registry has been frozen. When true any attempt to modify this registry or any of the definitions it contains will lead to an Error.


Implementation
    public function get frozen():Boolean
propertiesproperty 
properties:ConfigurationProperties  [read-only]

Properties that may be used to build or process ObjectDefinitions.


Implementation
    public function get properties():ConfigurationProperties
Method Detail
containsDefinition()method
public function containsDefinition(id:String):Boolean

Checks whether this registry contains a definition with the specified id.

Parameters

id:String — the id to check

Returns
Boolean — true if this registry contains an definition with the specified id
freeze()method 
public function freeze():void

Freezes this registry. After calling this method any attempt to modify this registry or any of the definitions it contains will lead to an Error.

getAllDefinitionsByType()method 
public function getAllDefinitionsByType(type:Class):Array

Returns all definitions that match the specified type. This includes subclasses or objects implementing the interface in case the type parmeter is an interface. When no match is found an empty Array will be returned.

Parameters

type:Class — the type for which all definitions should be returned

Returns
Array — all definitions that match the specified type
getDefinition()method 
public function getDefinition(id:String):ObjectDefinition

Returns the definition with the specified id or null if no such definition exists.

Parameters

id:String — the id of the definition

Returns
ObjectDefinition — the definition with the specified id
getDefinitionByType()method 
public function getDefinitionByType(type:Class):ObjectDefinition

Returns the definition for the specified type or null if no such definition exists. This method will throw an Error if it finds more than one match.

Parameters

type:Class — the type for which the definition should be returned

Returns
ObjectDefinition — the definition for the specified type
getDefinitionCount()method 
public function getDefinitionCount(type:Class = null):uint

Returns the number of definitions in this registry that match the specified type. If the type parameter is omitted the number of all definitions in this registry will be returned.

Parameters

type:Class (default = null) — the type to check for matches

Returns
uint — the number of definitions in this registry that match the specified type
getDefinitionIds()method 
public function getDefinitionIds(type:Class = null):Array

Returns the ids of the definitions in this registry that match the specified type. If the type parameter is omitted the ids of all definitions in this registry will be returned.

Parameters

type:Class (default = null) — the type to check for matches

Returns
Array — the ids of the definitions in this registry that match the specified type
registerDefinition()method 
public function registerDefinition(definition:ObjectDefinition):void

Registers an object definition with this registry.

Parameters

definition:ObjectDefinition — the definition to add to this registry

unregisterDefinition()method 
public function unregisterDefinition(definition:ObjectDefinition):void

Unregisters an object definition from this registry.

Parameters

definition:ObjectDefinition — the definition to remove from this registry

Event Detail
frozen Event
Event Object Type: org.spicefactory.parsley.core.events.ObjectDefinitionRegistryEvent
ObjectDefinitionRegistryEvent.type property = org.spicefactory.parsley.core.events.ObjectDefinitionRegistryEvent.FROZEN

Dispatched when configuration for this registry has been frozen. After this event has been dispatched any attempt to modify this registry or any of the definitions it contains will lead to an Error.

Constant for the type of event fired when configuration for a registry has been frozen. After this event has been dispatched any attempt to modify the registry or any of the definitions it contains will lead to an Error.