Packageorg.spicefactory.parsley.core.registry
Interfacepublic interface ObjectDefinition
Implementors AbstractObjectDefinition

Represents the configuration for a single object definition. The sub-interfaces SingletonObjectDefinition and DynamicObjectDefinition represent the concrete definition types used in an ObjectDefinitionRegistry.



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined By
  
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
Property Detail
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]

The id the object should be registered with.


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
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
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