Package | org.spicefactory.lib.xml.mapper |
Class | public class ChoiceRegistry |
Inheritance | ChoiceRegistry Object |
Method | Defined By | ||
---|---|---|---|
getChoiceById(id:String):Choice
Returns the choice for the specified id. | ChoiceRegistry | ||
getChoiceByType(type:Class):Choice
Returns the choice for the specified type. | ChoiceRegistry | ||
mergeInto(choices:ChoiceRegistry):void
Merges the content of this registry into the specified registry. | ChoiceRegistry | ||
populateTypeChoices(mappers:Dictionary):void
Populates all existing type choices, extracting the corresponding mappers for
all existing choices which map to types and their subtypes. | ChoiceRegistry | ||
validate():void
Validates all registered choices and throws an error
if any one of them does not contain any mappings. | ChoiceRegistry |
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
|
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
|
Choice — the choice for the specified type
|
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
|
populateTypeChoices | () | method |
public function populateTypeChoices(mappers:Dictionary):void
Populates all existing type choices, extracting the corresponding mappers for all existing choices which map to types and their subtypes.
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.
|
validate | () | method |
public function validate():void
Validates all registered choices and throws an error if any one of them does not contain any mappings.