Packageorg.spicefactory.parsley.core.builder
Interfacepublic interface ObjectDefinitionBuilder
Implementors DefaultObjectDefinitionBuilder

The core interface for applying configuration for a single object definition.



Public Properties
 PropertyDefined By
  registry : ObjectDefinitionRegistry
[read-only] The registry associated with this builder.
ObjectDefinitionBuilder
  typeInfo : ClassInfo
[read-only] The type of object to be created by this builder.
ObjectDefinitionBuilder
Public Methods
 MethodDefined By
  
Allows to specify options for a dynamic object and to build and register the final definition.
ObjectDefinitionBuilder
  
Allows to specify options for a singleton object and to build and register the final definition.
ObjectDefinitionBuilder
  
Sets this object as asynchronously initializing.
ObjectDefinitionBuilder
  
Allows to specify injections or simple values to be passed to the constructor when the target instance gets instantiated.
ObjectDefinitionBuilder
  
Sets the object responsible for creating instances from this definition.
ObjectDefinitionBuilder
  
method(name:String):MethodBuilder
Allows to specify injections or other features for a single method
ObjectDefinitionBuilder
  
Adds a processor for the objects configured by this definition.
ObjectDefinitionBuilder
  
Allows to specify injections or other features for a single property
ObjectDefinitionBuilder
  
Sets the instance that will replace (or wrap) the final object definition.
ObjectDefinitionBuilder
Property Detail
registryproperty
registry:ObjectDefinitionRegistry  [read-only]

The registry associated with this builder.


Implementation
    public function get registry():ObjectDefinitionRegistry
typeInfoproperty 
typeInfo:ClassInfo  [read-only]

The type of object to be created by this builder.


Implementation
    public function get typeInfo():ClassInfo
Method Detail
asDynamicObject()method
public function asDynamicObject():DynamicObjectBuilder

Allows to specify options for a dynamic object and to build and register the final definition. In contrast to a registered singleton, a dynamic object can spawn multiple instances from the same definition and get removed from the Context.

Returns
DynamicObjectBuilder — a builder that allows to specify options for a dynamic object object and to build and register the final definition
asSingleton()method 
public function asSingleton():SingletonBuilder

Allows to specify options for a singleton object and to build and register the final definition.

Returns
SingletonBuilder — a builder that allows to specify options for a singleton object and to build and register the final definition
asyncInit()method 
public function asyncInit():AsyncInitBuilder

Sets this object as asynchronously initializing. Such an object will not be considered as fully initialized before it has thrown its complete event. Only has an effect for singleton definition.

Returns
AsyncInitBuilder — a builder for asynchronous object initialization in case custom event types need to be specified
constructorArgs()method 
public function constructorArgs(... args):ObjectDefinitionBuilder

Allows to specify injections or simple values to be passed to the constructor when the target instance gets instantiated.

Parameters

... args

Returns
ObjectDefinitionBuilder — this builder for method chaining
instantiate()method 
public function instantiate(value:ObjectInstantiator):ObjectDefinitionBuilder

Sets the object responsible for creating instances from this definition.

Parameters

value:ObjectInstantiator — the object responsible for creating instances from this definition.

Returns
ObjectDefinitionBuilder — this builder for method chaining
method()method 
public function method(name:String):MethodBuilder

Allows to specify injections or other features for a single method

Parameters

name:String — the name of the method

Returns
MethodBuilder — a builder that allows to specify injections or other features for a single method
process()method 
public function process(processor:ObjectProcessor):ObjectProcessorBuilder

Adds a processor for the objects configured by this definition.

Parameters

processor:ObjectProcessor — the object processor to add

Returns
ObjectProcessorBuilder — a builder for configuring the processor
property()method 
public function property(name:String):PropertyBuilder

Allows to specify injections or other features for a single property

Parameters

name:String — the name of the property

Returns
PropertyBuilder — a builder that allows to specify injections or other features for a single property
replace()method 
public function replace(replacer:ObjectDefinitionReplacer):ObjectDefinitionBuilder

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

Returns
ObjectDefinitionBuilder — this builder for method chaining