Runtime tools : Core components : Typed data : Concepts : Converters
  
Converters
Converters transform business objects to Strings (formatting) and Strings to business objects (unformatting). The difference between converters and formatters is that converters only format or unformat a given object (a typed data) that does not have to be in the context while formatters format, unformat, and apply decorators to a set of objects located in different contexts.
One responsibility of a property descriptor is to identify the converters for the business object. The converters belong to following categories:
Default - The toolkit typically uses converters in this category to convert data between data elements and GUI presentation components (HTML or Java) and the result is readable by humans. This category of converter formats and unformats data without losing information and defines how to handle null values.
Note Default category converters return null when unformatting an empty String except when unformatting the String type, in which case it returns an empty String.
Serialization - The toolkit typically uses converters in this category to serialize data for client/server messaging and the result is not necessarily readable by humans. This category of converter formats and unformats data without losing information and defines how to handle null values.
Output - The toolkit uses converters in this category to convert data into a special non-reversible format for presentation only. Information may be lost in the conversion. For example, an output category converter may round a number to the nearest 1000.
XML - The toolkit uses converters in this category to render an object as an XML output stream.
Host - The toolkit uses converters in this category to convert data into a format understood by a legacy host. The host determines the rules used to do the conversion.
Each type in the toolkit must support a default category converter because its validator uses it to validate typed data. The other converter categories are optional. A single instance of a converter may support more than one category of conversion, and if coded appropriately, can support all categories. The toolkit allows you to add categories if needed.
Converters use attributes (such as pattern) to perform the formatting and unformatting of an object. You can define the attributes using parameters (defined as key-value pairs) within the converter definition or you can define them in the owning property descriptor. The converter first looks for the required parameters in the property descriptor before looking in its own Hashtable for the required parameters.
See
Converters implementation
Go up to
Concepts