Packageorg.spicefactory.parsley.core.registry.impl
Classpublic class SingletonObjectDefinitionWrapper
InheritanceSingletonObjectDefinitionWrapper Inheritance Object
Implements SingletonObjectDefinition

A simple wrapper around an existing root object definition.



Public Properties
 PropertyDefined By
  asyncInitConfig : AsyncInitConfig
The configuration for asynchronously initializing objects.
SingletonObjectDefinitionWrapper
  frozen : Boolean
[read-only] Indicates whether this definition has been frozen.
SingletonObjectDefinitionWrapper
  id : String
[read-only]
SingletonObjectDefinitionWrapper
  instantiator : ObjectInstantiator
The object responsible for creating instances from this definition.
SingletonObjectDefinitionWrapper
  lazy : Boolean
[read-only]
SingletonObjectDefinitionWrapper
  order : int
[read-only]
SingletonObjectDefinitionWrapper
  processors : Array
[read-only] Returns all processor factories added to this instance.
SingletonObjectDefinitionWrapper
  registry : ObjectDefinitionRegistry
[read-only] The registry this definition is associated with.
SingletonObjectDefinitionWrapper
  type : ClassInfo
[read-only] The type of the configured object.
SingletonObjectDefinitionWrapper
Public Methods
 MethodDefined By
  
SingletonObjectDefinitionWrapper(wrappedDefinition:ObjectDefinition, id:String = null, lazy:Boolean = false, order:int, asyncInit:AsyncInitConfig = null)
Creates a new instance.
SingletonObjectDefinitionWrapper
  
Adds the specified processor to this definition.
SingletonObjectDefinitionWrapper
  
freeze():void
Freezes this object definition.
SingletonObjectDefinitionWrapper
  
getAttribute(key:Object):Object
Returns the attribute for the specified key or null if no such attribute exists.
SingletonObjectDefinitionWrapper
  
setAttribute(key:Object, value:Object):void
Sets the attribute for the specified key and value.
SingletonObjectDefinitionWrapper
Property Detail
asyncInitConfigproperty
asyncInitConfig:AsyncInitConfig

The configuration for asynchronously initializing objects.


Implementation
    public function get asyncInitConfig():AsyncInitConfig
    public function set asyncInitConfig(value:AsyncInitConfig):void
frozenproperty 
frozen:Boolean  [read-only]

Indicates whether this definition has been frozen. When true any attempt to modify this definition will lead to an Error.


Implementation
    public function get frozen():Boolean
idproperty 
id:String  [read-only]


Implementation
    public function get id():String
instantiatorproperty 
instantiator:ObjectInstantiator

The object responsible for creating instances from this definition.


Implementation
    public function get instantiator():ObjectInstantiator
    public function set instantiator(value:ObjectInstantiator):void
lazyproperty 
lazy:Boolean  [read-only]


Implementation
    public function get lazy():Boolean
orderproperty 
order:int  [read-only]


Implementation
    public function get order():int
processorsproperty 
processors:Array  [read-only]

Returns all processor factories added to this instance. Modifications on the returned Array are not reflected within the definition. The Array will contain instances of ObjectProcessorConfig.


Implementation
    public function get processors():Array
registryproperty 
registry:ObjectDefinitionRegistry  [read-only]

The registry this definition is associated with.


Implementation
    public function get registry():ObjectDefinitionRegistry
typeproperty 
type:ClassInfo  [read-only]

The type of the configured object.


Implementation
    public function get type():ClassInfo
Constructor Detail
SingletonObjectDefinitionWrapper()Constructor
public function SingletonObjectDefinitionWrapper(wrappedDefinition:ObjectDefinition, id:String = null, lazy:Boolean = false, order:int, asyncInit:AsyncInitConfig = null)

Creates a new instance.

Parameters
wrappedDefinition:ObjectDefinition — the definition to wrap
 
id:String (default = null) — the id the object should be registered with
 
lazy:Boolean (default = false) — whether the object is lazy initializing
 
order:int (default = NaN) — whether the object should be treated as a singleton
 
asyncInit:AsyncInitConfig (default = null) — the initialization order for non-lazy singletons
Method Detail
addProcessor()method
public function addProcessor(processor:ObjectProcessorConfig):void

Adds the specified processor to this definition. The processor will get invoked for each new instance created from this definition.

Parameters

processor:ObjectProcessorConfig — the configuration for the processor to add to this definition

freeze()method 
public function freeze():void

Freezes this object definition. After calling this method any attempt to modify this definition will lead to an Error.

getAttribute()method 
public function getAttribute(key:Object):Object

Returns the attribute for the specified key or null if no such attribute exists.

Parameters

key:Object — the key to return the value for

Returns
Object — the attribute for the specified key or null if no such attribute exists
setAttribute()method 
public function setAttribute(key:Object, value:Object):void

Sets the attribute for the specified key and value. This hook might be used in rare cases where one ObjectProcessor might set values another processor might need to access to perform its task. Most processors should only have self-contained logic. It is recommended to use Class instances as keys and not Strings to avoid naming conflicts.

Parameters

key:Object — the key of the attribute
 
value:Object — the value of the attribute