Packageorg.spicefactory.lib.xml.mapper
Classpublic class ChoiceRegistry
InheritanceChoiceRegistry Inheritance Object

Internal registry for all choices available to a group of mappings.



Public Methods
 MethodDefined By
  
Returns the choice for the specified id.
ChoiceRegistry
  
Returns the choice for the specified type.
ChoiceRegistry
  
initialize(mappers:Dictionary):void
Initializes all existing choices, extracting the corresponding mappers for all existing choices which map to types and their subtypes.
ChoiceRegistry
  
Merges the content of this registry into the specified registry.
ChoiceRegistry
Method Detail
getChoiceById()method
public function getChoiceById(id:String):Choice

Returns the choice for the specified id. If such a choice does not exist yet, a new one will be created.

Parameters

id:String — the id to return the choice for

Returns
Choice — the choice for the specified id
getChoiceByType()method 
public function getChoiceByType(type:Class):Choice

Returns the choice for the specified type. If such a choice does not exist yet, a new one will be created.

Parameters

type:Class — the type to return the choice for

Returns
Choice — the choice for the specified type
initialize()method 
public function initialize(mappers:Dictionary):void

Initializes all existing choices, extracting the corresponding mappers for all existing choices which map to types and their subtypes. Also validates all existing choices and throws an Error if one of them is empty.

Parameters

mappers:Dictionary — the mappings to fill the choices with, the keys in the Dictionary are the types (classes) of the mappings, the values are the actual mappers.

mergeInto()method 
public function mergeInto(choices:ChoiceRegistry):void

Merges the content of this registry into the specified registry.

Parameters

choices:ChoiceRegistry — the registry to merge the content of this registry into