Packageorg.spicefactory.parsley.core.registry.impl
Classpublic class AbstractObjectDefinition
InheritanceAbstractObjectDefinition Inheritance Object
Implements ObjectDefinition
Subclasses DefaultDynamicObjectDefinition, DefaultSingletonObjectDefinition

Abstract base class for all ObjectDefinition implementations.



Public Properties
 PropertyDefined By
  frozen : Boolean
[read-only] Indicates whether this definition has been frozen.
AbstractObjectDefinition
  id : String
[read-only]
AbstractObjectDefinition
  instantiator : ObjectInstantiator
The object responsible for creating instances from this definition.
AbstractObjectDefinition
  processors : Array
[read-only] Returns all processor factories added to this instance.
AbstractObjectDefinition
  registry : ObjectDefinitionRegistry
[read-only] The registry this definition is associated with.
AbstractObjectDefinition
  type : ClassInfo
[read-only] The type of the configured object.
AbstractObjectDefinition
Public Methods
 MethodDefined By
  
Creates a new instance.
AbstractObjectDefinition
  
Adds the specified processor to this definition.
AbstractObjectDefinition
  
freeze():void
Freezes this object definition.
AbstractObjectDefinition
  
getAttribute(key:Object):Object
Returns the attribute for the specified key or null if no such attribute exists.
AbstractObjectDefinition
  
Populates this definition with all configuration artifacts from the specified source.
AbstractObjectDefinition
  
setAttribute(key:Object, value:Object):void
Sets the attribute for the specified key and value.
AbstractObjectDefinition
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]


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
Constructor Detail
AbstractObjectDefinition()Constructor
public function AbstractObjectDefinition(type:ClassInfo, id:String, registry:ObjectDefinitionRegistry)

Creates a new instance.

Parameters
type:ClassInfo — the type to create a definition for
 
id:String — the id the object should be registered with
 
registry:ObjectDefinitionRegistry — the registry this definition belongs to
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
populateFrom()method 
public function populateFrom(source:ObjectDefinition):void

Populates this definition with all configuration artifacts from the specified source.

Parameters

source:ObjectDefinition — the definition to copy all configuration artifacts from

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