The structure of formatter definition mirrors the structure of the corresponding data. In the structure of data, there are data field, and composite of data fields. Accordingly, there are field format element and composite format element in the structure of formatter definition.
<format.xml> <format id="PersonFormat"> <record> <fString dataName="name" encoding="cp937"/> <selfLength/> <fInteger dataName="age" byteOrdering="host"/> <selfLength/> </record> </format> </format.xml>Where:
In this example, each tag is instantiated as a formatter element that can format or unformat the corresponding data element.
Generally speaking, there are three kinds of format element: composite format element, field format element and format decorator.
<?xml version="1.0"?> <btt.xml> <kColl id="components"> <kColl id="format"> <field id="initializer" value="com.ibm.btt.format.FormatInitializer" /> <field id="extFile" value="format.xml" /> <kColl id="classTable"> <field id="record" value="com.ibm.btt.format.impl.RecordFormat" /> <field id="indexed" value="com.ibm.btt.format.impl.IndexedFormat" /> <field id="fString" value="com.ibm.btt.format.impl.StringFormat" /> <field id="fInteger" value="com.ibm.btt.format.impl.IntegerFormat" /> <field id="fFloat" value="com.ibm.btt.format.impl.FloatFormat" /> <field id="fPacked" value="com.ibm.btt.format.impl.PackedFormat" /> <field id="fPackedDate" value="com.ibm.btt.format.impl.PackedDateFormat" /> <field id="hexDelim" value="com.ibm.btt.format.impl.HexDelimiter" /> <field id="fixedLength" value="com.ibm.btt.format.impl.FixedLength" /> <field id="maxLength" value="com.ibm.btt.format.impl.MaximumLength" /> <field id="nullCheck" value="com.ibm.btt.format.impl.NullCheckeDecorator" /> <field id="selfLength" value="com.ibm.btt.format.impl.SelfLength" /> <field id="format" value="com.ibm.btt.format.impl.FormatDefine" /> <field id="refFmt" value="com.ibm.btt.format.impl.ReferenceFormat" /> </kColl> </kColl> </kColl> </btt.xml>