Packageorg.spicefactory.parsley.core.builder
Interfacepublic interface SingletonBuilder
Implementors DefaultSingletonBuilder

Builder for the definition of a singleton object.



Public Methods
 MethodDefined By
  
Builds and returns the final definition without registering it.
SingletonBuilder
  
Sets the additional decorators that should be processed for the definition.
SingletonBuilder
  
id(value:String):SingletonBuilder
Sets the (optional) id the object should be registered with.
SingletonBuilder
  
lazy(value:Boolean):SingletonBuilder
Specifies whether this object should be lazily initialized.
SingletonBuilder
  
Sets the initialization order value for this object.
SingletonBuilder
  
Builds, registers and returns the final definition.
SingletonBuilder
Method Detail
build()method
public function build():SingletonObjectDefinition

Builds and returns the final definition without registering it. An object that does not get registered cannot be used for injection and cannot be retrieved through the Context API. But this definition can be used as a nested (inline) reference or adding it to the Context dynamically at a later point.

Returns
SingletonObjectDefinition — the final definition produced by this builder
decorators()method 
public function decorators(value:Array):SingletonBuilder

Sets the additional decorators that should be processed for the definition. Since version 2.3 it is no longer recommended to programmatically create and apply decorators since the new configuration DSL provides a more convenient mechanism. This method should be used by tag implementations that allow to specify decorators as nested tags (like the root <Object> tag).

Parameters

value:Array — decorators that should be processed for the definition

Returns
SingletonBuilder — this builder for method chaining
id()method 
public function id(value:String):SingletonBuilder

Sets the (optional) id the object should be registered with.

Parameters

value:String — the id the object should be registered with

Returns
SingletonBuilder — this builder for method chaining
lazy()method 
public function lazy(value:Boolean):SingletonBuilder

Specifies whether this object should be lazily initialized. If set to false the object will be instantiated upon Context initialization.

Parameters

value:Boolean — whether this object should be lazily initialized

Returns
SingletonBuilder — this builder for method chaining
order()method 
public function order(value:int):SingletonBuilder

Sets the initialization order value for this object. Will be processed in ascending order. The default value is int.MAX_VALUE.

Parameters

value:int — the initialization order value for this object

Returns
SingletonBuilder — this builder for method chaining
register()method 
public function register():SingletonObjectDefinition

Builds, registers and returns the final definition. This method delegates to the build method to produce the final definition and then registers it with the underlying registry.

Returns
SingletonObjectDefinition — the final definition produced by this builder