Packageorg.spicefactory.lib.reflect
Interfacepublic interface Converter
Implementors BooleanConverter, ClassConverter, ClassInfoConverter, DateConverter, EnumerationConverter, IntConverter, NoOpConverter, NumberConverter, StringConverter, UintConverter

Interface to be implemented by objects responsible for any necessary type conversion. Instances implementing this interface will be registered with Type.addConverter and will be used in Parameter and Property instances to convert method parameters or property values if they do not match the required target type. Spicelib contains several builtin Converters for some of the top level types like Boolean, String, Number or Date. Applications can register additional Converters as required. Usually a single implementation is responsible for converting to one specific target type like Date.



Public Methods
 MethodDefined By
  
convert(value:*, domain:ApplicationDomain = null):*
Converts the specified value to the target type this Converter is implemented for.
Converter
Method Detail
convert()method
public function convert(value:*, domain:ApplicationDomain = null):*

Converts the specified value to the target type this Converter is implemented for. Implementations should return the value unchanged if it is already of the target type.

Parameters

value:* — the value to be converted
 
domain:ApplicationDomain (default = null) — the domain to use for reflection (only used by some converter implementations)

Returns
* — the converted value

Throws
ConversionError — if conversion failed