Package | org.spicefactory.parsley.core.registry |
Interface | public interface ObjectDefinition |
Implementors | AbstractObjectDefinition |
SingletonObjectDefinition
and DynamicObjectDefinition
represent the concrete definition types used in an ObjectDefinitionRegistry
.
Property | Defined By | ||
---|---|---|---|
frozen : Boolean [read-only]
Indicates whether this definition has been frozen. | ObjectDefinition | ||
id : String [read-only]
The id the object should be registered with. | ObjectDefinition | ||
instantiator : ObjectInstantiator
The object responsible for creating instances from this definition. | ObjectDefinition | ||
processors : Array [read-only]
Returns all processor factories added to this instance. | ObjectDefinition | ||
registry : ObjectDefinitionRegistry [read-only]
The registry this definition is associated with. | ObjectDefinition | ||
type : ClassInfo [read-only]
The type of the configured object. | ObjectDefinition |
Method | Defined By | ||
---|---|---|---|
addProcessor(processor:ObjectProcessorConfig):void
Adds the specified processor to this definition. | ObjectDefinition | ||
freeze():void
Freezes this object definition. | ObjectDefinition | ||
getAttribute(key:Object):Object
Returns the attribute for the specified key or null if no such attribute exists. | ObjectDefinition | ||
setAttribute(key:Object, value:Object):void
Sets the attribute for the specified key and value. | ObjectDefinition |
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] The id the object should be registered with.
public function get id():String
instantiator | property |
instantiator:ObjectInstantiator
The object responsible for creating instances from this definition.
public function get instantiator():ObjectInstantiator
public function set instantiator(value:ObjectInstantiator):void
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
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
|
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
|