| Package | org.spicefactory.parsley.core.registry.impl |
| Class | public class SingletonObjectDefinitionWrapper |
| Inheritance | SingletonObjectDefinitionWrapper Object |
| Implements | SingletonObjectDefinition |
| Property | Defined 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 | ||
| Method | Defined By | ||
|---|---|---|---|
SingletonObjectDefinitionWrapper(wrappedDefinition:ObjectDefinition, id:String = null, lazy:Boolean = false, order:int, asyncInit:AsyncInitConfig = null)
Creates a new instance. | SingletonObjectDefinitionWrapper | ||
addProcessor(processor:ObjectProcessorConfig):void
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 | ||
| asyncInitConfig | property |
asyncInitConfig:AsyncInitConfigThe configuration for asynchronously initializing objects.
public function get asyncInitConfig():AsyncInitConfig public function set asyncInitConfig(value:AsyncInitConfig):void| frozen | property |
frozen:Boolean [read-only] Indicates whether this definition has been frozen. When true any attempt to modify this definition will lead to an Error.
public function get frozen():Boolean| id | property |
id:String [read-only]
public function get id():String| instantiator | property |
instantiator:ObjectInstantiatorThe object responsible for creating instances from this definition.
public function get instantiator():ObjectInstantiator public function set instantiator(value:ObjectInstantiator):void| lazy | property |
lazy:Boolean [read-only]
public function get lazy():Boolean| order | property |
order:int [read-only]
public function get order():int| processors | property |
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.
public function get processors():Array| registry | property |
registry:ObjectDefinitionRegistry [read-only] The registry this definition is associated with.
public function get registry():ObjectDefinitionRegistry| type | property |
type:ClassInfo [read-only] The type of the configured object.
public function get type():ClassInfo| SingletonObjectDefinitionWrapper | () | Constructor |
public function SingletonObjectDefinitionWrapper(wrappedDefinition:ObjectDefinition, id:String = null, lazy:Boolean = false, order:int, asyncInit:AsyncInitConfig = null)Creates a new instance.
ParameterswrappedDefinition: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
|
| addProcessor | () | method |
public function addProcessor(processor:ObjectProcessorConfig):voidAdds 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():voidFreezes 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):ObjectReturns the attribute for the specified key or null if no such attribute exists.
Parameters
key:Object — the key to return the value for
|
Object — the attribute for the specified key or null if no such attribute exists
|
| setAttribute | () | method |
public function setAttribute(key:Object, value:Object):voidSets 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
|