Packageorg.spicefactory.parsley.core.builder.impl
Classpublic class ObjectDefinitionContext
InheritanceObjectDefinitionContext Inheritance Object

Represents the context for a single object definition build process.



Public Properties
 PropertyDefined By
  registry : ObjectDefinitionRegistry
[read-only] The registry associated with the definition.
ObjectDefinitionContext
  targetType : ClassInfo
[read-only] The type of the class to be configured.
ObjectDefinitionContext
Public Methods
 MethodDefined By
  
ObjectDefinitionContext(targetType:ClassInfo, registry:ObjectDefinitionRegistry, assemblers:Array)
Creates a new instance.
ObjectDefinitionContext
  
Adds a part to the builder that gets executed when building the final definition.
ObjectDefinitionContext
  
processDefinition(target:ObjectDefinition, additionalDecorators:Array, builder:ObjectDefinitionBuilder):ObjectDefinition
Processes the specified definition, applying all builder parts added to this context, all decorators assembled by this context and the specified additional decorators and finally invoking the definition replacer (if specified).
ObjectDefinitionContext
  
Sets the instance that will replace (or wrap) the final object definition.
ObjectDefinitionContext
  
Sets the instantiator to apply to the target definition.
ObjectDefinitionContext
Protected Methods
 MethodDefined By
  
processDecorators(definition:ObjectDefinition, additionalDecorators:Array, builder:ObjectDefinitionBuilder):void
Processes the decorators for this builder.
ObjectDefinitionContext
Property Detail
registryproperty
registry:ObjectDefinitionRegistry  [read-only]

The registry associated with the definition.


Implementation
    public function get registry():ObjectDefinitionRegistry
targetTypeproperty 
targetType:ClassInfo  [read-only]

The type of the class to be configured.


Implementation
    public function get targetType():ClassInfo
Constructor Detail
ObjectDefinitionContext()Constructor
public function ObjectDefinitionContext(targetType:ClassInfo, registry:ObjectDefinitionRegistry, assemblers:Array)

Creates a new instance.

Parameters
targetType:ClassInfo — the type of the target object
 
registry:ObjectDefinitionRegistry — the registry the definition is associated with
 
assemblers:Array — the assemblers to use to assemble the decorators for the target definition
Method Detail
addBuilderPart()method
public function addBuilderPart(part:ObjectDefinitionBuilderPart):void

Adds a part to the builder that gets executed when building the final definition.

Parameters

part:ObjectDefinitionBuilderPart — the part to add to the builder

processDecorators()method 
protected function processDecorators(definition:ObjectDefinition, additionalDecorators:Array, builder:ObjectDefinitionBuilder):void

Processes the decorators for this builder. This implementation processes all decorators obtained through the decorator assemblers registered for the core Configuration instance (usually one assembler processing metadata tags) along with decorators which were explicitly added, possibly through some additional configuration mechanism like MXML or XML.

Parameters

definition:ObjectDefinition — the definition to process
 
additionalDecorators:Array — the decorators to process in addition to the ones added through the assemblers
 
builder:ObjectDefinitionBuilder — the builder for the definition

processDefinition()method 
public function processDefinition(target:ObjectDefinition, additionalDecorators:Array, builder:ObjectDefinitionBuilder):ObjectDefinition

Processes the specified definition, applying all builder parts added to this context, all decorators assembled by this context and the specified additional decorators and finally invoking the definition replacer (if specified). If no replacer was specified this method usually should return the definition that was passed in.

Parameters

target:ObjectDefinition — the target definition to process
 
additionalDecorators:Array — decorators to add to the ones extracted by the standard assemblers
 
builder:ObjectDefinitionBuilder — the builder of the specified definition

Returns
ObjectDefinition — the final definition to use
setDefinitionReplacer()method 
public function setDefinitionReplacer(replacer:ObjectDefinitionReplacer):void

Sets the instance that will replace (or wrap) the final object definition. This is an advanced feature. From all the builtin tags only the Factory tag uses this hook.

Parameters

replacer:ObjectDefinitionReplacer — the instance that will replace the final object definition

setInstantiator()method 
public function setInstantiator(instantiator:ObjectInstantiator):void

Sets the instantiator to apply to the target definition.

Parameters

instantiator:ObjectInstantiator — the instantiator to apply to the target definition