Special Format Element

There are two format elements that do not extend CompositeFormat, FieldFormat or BaseDecorator. The special Format Element implements are com.ibm.btt.format.impl.FormatDefine and com.ibm.btt.format.impl.ReferenceFormat. They implement com.ibm.btt.format.FormatElement directly.

Table 1. Classes, attributes and sample definitions
Class Attributes Sample definition
FormatDefine

(used as a root format element in the format definition)

id:

a String that represents the id of the format definition.

<format id="PersonFormat">
    <record>
        <fString dataName="name" encoding="cp937"/>
        <selfLength/>
        <fInteger dataName="age" byteOrdering="host"/>
        <selfLength/>
    </record>  
</format>
ReferenceFormat

(handles the reference relationship between format definitions)

refId:

a String that represents the id of the referenced format element.

<format id="AnotherFormat">
    <record>
        <fString dataName="field1" encoding="cp937"/>
        <selfLength/>
        <refFmt dataName="field2" refId="PersonFormat"/>
        <selfLength/>
    </record>
</format>