Packageorg.spicefactory.parsley.dsl.core.impl
Classpublic class DefaultMethodBuilder
InheritanceDefaultMethodBuilder Inheritance AbstractParameterBuilder Inheritance Object
Implements MethodBuilder, ObjectDefinitionBuilderPart

Default MethodBuilder implementation.



Protected Properties
 PropertyDefined By
 Inheritedparams : Array
The parameters for the target function.
AbstractParameterBuilder
Public Methods
 MethodDefined By
  
Creates a new instance.
DefaultMethodBuilder
  
apply(target:ObjectDefinition):void
Applies this builder part to the final definition
DefaultMethodBuilder
  
Configures this method as a command executor.
DefaultMethodBuilder
  
Configures this method as a command complete handler.
DefaultMethodBuilder
  
Configures this method as a command error handler.
DefaultMethodBuilder
  
Configures this method as a command result handler.
DefaultMethodBuilder
  
Configures this method to be invoked when the object has been removed from the Context or the Context gets destroyed.
DefaultMethodBuilder
  
factory():void
Configures this method as a factory method that produces the actual target instance to be made available for injection.
DefaultMethodBuilder
  
initMethod():void
Configures this method to be invoked after the object has been fully intialized.
DefaultMethodBuilder
  
Instructs the container to inject the matching object for all parameters of this method.
DefaultMethodBuilder
  
Adds a reference by id to another object in the registry to the list of method parameters.
DefaultMethodBuilder
  
injectByType(type:Class = null):MethodBuilder
Adds a reference by type to another object in the registry to the list of method parameters.
DefaultMethodBuilder
  
Adds a definition of an object to be created at runtime to the list of method parameters.
DefaultMethodBuilder
  
Configures this method as a message error handler.
DefaultMethodBuilder
  
Configures this method as a message handler.
DefaultMethodBuilder
  
DefaultMethodBuilder
  
Configures this method as an object lifecycle observer.
DefaultMethodBuilder
  
Adds a value to the list of method parameters.
DefaultMethodBuilder
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
DefaultMethodBuilder()Constructor
public function DefaultMethodBuilder(method:Method, context:ObjectDefinitionContext)

Creates a new instance.

Parameters
method:Method — the method to configure
 
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

command()method 
public function command():MessageHandlerBuilder

Configures this method as a command executor. The builder returned by this method should be used to specify further options for the command.

Returns
MessageHandlerBuilder — a builder to specify the options for the command
commandComplete()method 
public function commandComplete():MessageReceiverBuilder

Configures this method as a command complete handler. The builder returned by this method should be used to specify further options for the command complete handler.

Returns
MessageReceiverBuilder — a builder to specify the options for the command complete handler
commandError()method 
public function commandError():MessageReceiverBuilder

Configures this method as a command error handler. The builder returned by this method should be used to specify further options for the command error handler.

Returns
MessageReceiverBuilder — a builder to specify the options for the command error handler
commandResult()method 
public function commandResult():MessageReceiverBuilder

Configures this method as a command result handler. The builder returned by this method should be used to specify further options for the command result handler.

Returns
MessageReceiverBuilder — a builder to specify the options for the command result handler
destroyMethod()method 
public function destroyMethod():void

Configures this method to be invoked when the object has been removed from the Context or the Context gets destroyed. This is equivalent of using the [Destroy] metadata tag above the method in the class definition.

factory()method 
public function factory():void

Configures this method as a factory method that produces the actual target instance to be made available for injection. This is equivalent of using the [Factory] metadata tag above the method in the class definition. The type of the target instance will be deduced by reflecting on the return type of the method. Thus feature cannot be used to create a generic factory with Object as the return type. In such a case you should look into writing a custom RootConfigurationElement.

initMethod()method 
public function initMethod():void

Configures this method to be invoked after the object has been fully intialized. This is equivalent of using the [Init] metadata tag above the method in the class definition.

injectAllByType()method 
public function injectAllByType():void

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

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

Adds a reference by id to another object in the registry to the list of method parameters.

Parameters

id:String — the id of the referenced object

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

Adds a reference by type to another object in the registry to the list of method parameters. If the type parameter is omitted it will be deduced by reflecting on the method'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
MethodBuilder — this builder for method chaining
injectFromDefinition()method 
public function injectFromDefinition(definition:DynamicObjectDefinition):MethodBuilder

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

Parameters

definition:DynamicObjectDefinition — the definition of the object

Returns
MethodBuilder — this builder for method chaining
messageError()method 
public function messageError():MessageErrorBuilder

Configures this method as a message error handler. The builder returned by this method should be used to specify further options for the error handler.

Returns
MessageErrorBuilder — a builder to specify the options for the message error handler
messageHandler()method 
public function messageHandler():MessageHandlerBuilder

Configures this method as a message handler. The builder returned by this method should be used to specify further options for the handler.

Returns
MessageHandlerBuilder — a builder to specify the options for the message handler
messageInterceptor()method 
public function messageInterceptor():MessageReceiverBuilder

Returns
MessageReceiverBuilder
observe()method 
public function observe():ObserveMethodBuilder

Configures this method as an object lifecycle observer. The builder returned by this method should be used to specify further options for the observer.

Returns
ObserveMethodBuilder — a builder to specify the options for the observer
value()method 
public function value(value:*):MethodBuilder

Adds a value to the list of method parameters. 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 method.

Parameters

value:* — the value to add

Returns
MethodBuilder — this builder for method chaining