Class | Purpose |
---|---|
RecordFormat | Formats a keyed collection by concatenating the strings resulting from formatting the collection's elements. The RecordFormat iterates through its sequence of formatters and, for each formatter, it searches for the data element with a matching name in the keyed collection. When the RecordFormat instance finds the data element, it invokes the formatter's format method on the data element and appends the result to the formatted string. If a formatter element is a ConstantFormat instance, the RecordFormat instance appends its value to the formatted string. For unformatting, RecordFormat calls the extract method on each formatter element to parse individual substrings within the formatted string. |
XMLFormat | XMLFormat extends RecordFormat to create an XML compliant formatted string. The formatted string contains a formatted substring for each data element in the keyed collection. For example, if the formatter element <fString dataName="Amount"/> is applied to the data element <field id="Amount" value="2000"/>, the result is the XML compliant <Amount>2000</Amount> string. As an option, the XML string can contain the type of each data element in the formatter. If this is the case, the XML string is <Amount dataType="field">2000</Amount> . |
DynamicRecordFormat | DynamicRecordFormat extends RecordFormat. It differs from RecordFormat in its behavior when unformatting a string. This formatter does not throw an exception if the toolkit does not find the data element to which the formatter element refers in the context hierarchy. Instead, it dynamically creates the missing data elements during the unformat process. With this formatter, you do not need to define in the context all the data elements referenced in the formatter definition. |
DynamicXMLFormat | DynamicXMLFormat extends KeyedCollectionFormat. It formats and unformats all the data elements in a keyed collection or in a context. If you are working with a context, you can also add data elements belonging to another context to the formatter definition. The result of the formatting process is a compliant XML string, just as with the XMLFormat. As an option, you can also include the name of the collection containing the data elements in the resulting string. As with the dynamic record formatter, the formatter dynamically creates any data elements missing in the context hierarchy or the keyed collection during the unformatting process. |
DataMapperFormat | DataMapperFormat extends RecordFormat to map data between two contexts by automatically applying two inner formatters. The input formatter element unformats data from the source context into a formatted string and the output formatter element formatters the string to update the destination context. |
DataMapperConverterFormat | DataMapperConverterFormat extends DataMapperFormat to use typed data converters to map the data instead of building an intermediate string. This improves performance when transferring data. The typed data converters must implement the convertTo and convertFrom methods. For examples of this formatter, see DataMapperConverterFormat definition examples. This formatter can map between contexts by reference so that it assigns values to the destination context by reference instead of creating new objects. The formatter can also use a specified converter to map the data. |
TypedDataElementFormat | TypedDataElementFormat is a special formatter for typed data elements. The formatter uses the converter for the conversion type in the data element's descriptor to perform the formatting and unformatting. The definition for the formatter specifies the conversion type. The default conversion type is "default". |
You can implement different subclasses depending on your formatting needs.