Packageorg.spicefactory.parsley.dsl.core.impl
Classpublic class DefaultConstructorBuilder
InheritanceDefaultConstructorBuilder Inheritance AbstractParameterBuilder Inheritance Object
Implements ConstructorBuilder, ObjectDefinitionBuilderPart

Default ConstructorBuilder implementation.



Protected Properties
 PropertyDefined By
 Inheritedparams : Array
The parameters for the target function.
AbstractParameterBuilder
Public Methods
 MethodDefined By
  
Creates a new instance.
DefaultConstructorBuilder
  
apply(target:ObjectDefinition):void
Applies this builder part to the final definition
DefaultConstructorBuilder
  
Instructs the container to inject the matching object for all parameters of this constructor.
DefaultConstructorBuilder
  
Adds a reference by id to another object in the registry to the list of constructor arguments.
DefaultConstructorBuilder
  
injectByType(type:Class = null):ConstructorBuilder
Adds a reference by type to another object in the registry to the list of constructor arguments.
DefaultConstructorBuilder
  
Adds a definition of an object to be created at runtime to the list of constructor arguments.
DefaultConstructorBuilder
  
Adds a value to the list of constructor arguments.
DefaultConstructorBuilder
Protected Methods
 MethodDefined By
 Inherited
Adds a definition of an object to be created at runtime.
AbstractParameterBuilder
 Inherited
addIdReference(id:String):void
Adds a reference to another object in the Context by id.
AbstractParameterBuilder
 Inherited
addTypeReference(type:ClassInfo = null):void
Adds a reference to another object in the Context by type.
AbstractParameterBuilder
 Inherited
Adds references to other objects in the Context by type for all remaining parameters of the target function.
AbstractParameterBuilder
 Inherited
addValue(value:*):void
Adds a parameter value.
AbstractParameterBuilder
Constructor Detail
DefaultConstructorBuilder()Constructor
public function DefaultConstructorBuilder(context:ObjectDefinitionContext)

Creates a new instance.

Parameters
context:ObjectDefinitionContext — the context for this builder
Method Detail
apply()method
public function apply(target:ObjectDefinition):void

Applies this builder part to the final definition

Parameters

target:ObjectDefinition — the final definition to apply this part to

injectAllByType()method 
public function injectAllByType():void

Instructs the container to inject the matching object for all parameters of this constructor. Parameter types will be deduced by reflecting on the constructor's signature.

injectById()method 
public function injectById(id:String):ConstructorBuilder

Adds a reference by id to another object in the registry to the list of constructor arguments.

Parameters

id:String — the id of the referenced object

Returns
ConstructorBuilder — this builder for method chaining
injectByType()method 
public function injectByType(type:Class = null):ConstructorBuilder

Adds a reference by type to another object in the registry to the list of constructor arguments. If the type parameter is omitted it will be deduced by reflecting on the constructor's signature. Using this feature requires that only one object of a matching type is regisrered for the Context.

Parameters

type:Class (default = null) — the type of the referenced object

Returns
ConstructorBuilder — this builder for method chaining
injectFromDefinition()method 
public function injectFromDefinition(definition:DynamicObjectDefinition):ConstructorBuilder

Adds a definition of an object to be created at runtime to the list of constructor arguments. For each injection a new instance will be created from that definition.

Parameters

definition:DynamicObjectDefinition — the definition of the object

Returns
ConstructorBuilder — this builder for method chaining
value()method 
public function value(value:*):ConstructorBuilder

Adds a value to the list of constructor arguments. This may be a simple value or an instance that implements ResolvableValue to be resolved at the time the value will be injected into the constructor.

Parameters

value:* — the value to add

Returns
ConstructorBuilder — this builder for method chaining