Format Builder
How Do I?
Create a Message Format
Create a Group
Create a Field
Create a Comment
Create a Reference
Save a Document
Use Format Tester
Debug Format Definitions
Search for Values
Search for Offsets
Use the Debug Log
Specify Delimiters
Create a Message Format
The first step in creating a Message Format Definition file is to create a message format (the root node of a message format file).
To create a message format:
Create a Group
Groups define fields that are related in some way (for example, the fields PAYDATE
, HOURS
, and RATE
could be part of the PAYINFO
group). You can create a group as a child of the message format item, as a child of another group, or as a sibling of a group or field.
To create a group:
- Select an item in the tree view in the left pane.
- Choose Insert—>Group—>As Child if you want to create the group as the child of the message format or another group. Choose Insert—>Group—>As Sibling if you want to create the group as the sibling of another group or a field. The Group Details window displays in the right pane.
- Click Apply to save your changes to the message format file, or click Reset to discard your changes to the detail window and reset all fields to the last saved value.
Note: The Apply and Reset buttons are only enabled once changes are made to the detail panel's components.
Create a Field
Fields are a sequence of bytes that have some meaning to an application. (For example, the field EMPNAME
contains an employee name.) You can create a field as a child of the message format item, as a child of a group, or as a sibling of a group or another field.
To create a field:
- Select an item in the tree view in the left pane.
- Choose Insert—>Field—>As Child if you want to create the field as the child of the message format or group. Choose Insert—>Field—>As Sibling if you want to create the group as the sibling of another group or a field. The Field Details window displays in the right pane.
- Click Apply to save your changes to the message format file, or click Reset to discard your changes to the detail window and reset all fields to the last saved value.
Note: The Apply and Reset buttons are only enabled once changes are made to the detail panel's components.
Create a Comment
Comments contain notes about the message format or the data transformed by the message format. Comments are included in the message format definition for informational purposes only. You can create a comment as a child or sibling of any message format, group, or field.
To create a comment:
- Select an item in the tree view in the left pane.
- Choose Insert—>Comment—>As Child if you want to create the comment as the child of the selected item. Choose Insert—>Comment—>As Sibling if you want to create the comment as the sibling of the selected item. The Comment Details window displays in the right pane.
- Click Apply to save your changes to the message format file, or click Reset to discard your changes to the detail window and reset all fields to the last saved value.
Note: The Apply and Reset buttons are only enabled once changes are made to the detail panel's components.
Create a Reference
References indicate that the description of the field or group format has been previously defined and you want to reuse this description without re-entering the data. Reference fields or groups have the same format as the original field or group, but you can change only the optional setting and the occurrence setting for the reference field or group. For example, if you have a "bill to" address and a "ship to" address in your data and the format for the address is the same, you only need to define the address format once. You can create the "bill to" address definition and create a reference for the "ship to" address.
Note: References are named exactly the same as the original item. For example, the "bill to" address definition and the "ship to" address definition would be named the same. If you want to reuse a group definition, create a generic group and embed it within a specific group. For example, in the previous example, you can create an address group within a bill_to group and reference address within a ship_to group.
To create a reference:
- Select a field or group in the tree pane.
- Choose the proper sibling in the tree.
- Choose Edit—>Paste—>As Reference.
- Click Apply to save your changes to the message format file, or click Reset to discard your changes to the detail window and reset all fields to the last saved value.
Note: The Apply and Reset buttons are only enabled once changes are made to the detail panel's components.
Save a Document
To save a message format file for the first time:
- Choose File—>Save As. The Save As dialog displays.
- Navigate to the directory where you want to save the file.
- In the File Name text box, type the name you want to assign to the file.
- If no extension has been given, Format Builder automatically assigns the extension
.MFL
to message format files.
- Click Save As to save the file in the specified location with the specified name and extension.
To save a message format file using the same name, choose File—>Save. The file is saved in the same location with the same name and extension.
To save a message format file using a different name, choose File—>Save As and follow steps 1 through 5 above.
Use Format Tester
Format Tester parses and reformats data as a validation test. Using Format Tester, you can make sure the message formats you build using Format Builder produce the expected results.
Format Tester is available from Format Builder.
To Start Format Tester
- In Format Builder, open a message format document (MFL file).
Note: To run Format Tester, you must have a message format document open in Format Builder.
- From the Format Builder menu bar, choose Tools—>Test.
- The Format Tester dialog box is displayed.
Note: Format Tester uses the currently loaded message definition document.
Refer to Format Tester for more information.
Debug Format Definitions
Search for Values
Search for Offsets
Use the Debug Log
Search for Values
The find feature allows you to search for hex or text values in the non-XML data.
To search for values:
- From within the Format Tester, choose File—>Open Non-XML to open the non-XML data file you want to search.
- Choose Edit—>Find. The Find dialog opens.
- Enter data in the fields as appropriate (see Search for Values for more information).
- Click OK to begin the Search operation.
Search for Offsets
The Goto feature allows you to move the cursor in the Non-XML editor to a byte offset you specify.
To move to a specified offset:
- Choose Edit—>Find. The Goto dialog opens.
- Click OK to begin the Search operation.
Use the Debug Log
The debug log allows you to save your debug information to a text file.
To use the debug log, choose File—>Debug Log. A dialog displays allowing you to enter a new path and file name or choose an existing file in which to save the debug information.
Note: If you select an existing file, the new debug information is appended to the end of the file.
Specify Delimiters
You can specify delimiters in Format Builder by entering the correct syntax. For example, to specify a tab character as the delimiter (`\u009'), enter the construct \t
to match it.
Table 13-1 Character Delimiters
Construct
|
Matches
|
x
|
The character x
|
\\
|
The backlash
|
\0n
|
The character with octal value 0n (<= n <= 7)
|
\0nn
|
The character with octal value 0nn (0 <= n <= 7)
|
\0mnn
|
The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7)
|
\xhh
|
The character with hexadecimal value 0xhh
|
\uhhhh
|
The character with hexadecimal value 0xhhhh
|
\t
|
The tab character ('\u0009')
|
\n
|
The newline (line feed) character ('\u000A')
|
\r
|
The carriage-return character ('\u000D')
|
\f
|
The form-feed character ('\u000C')
|
\a
|
The alert (bell) character ('\u0007')
|
\e
|
The escape character ('\u001B')
|
\cx
|
The control character corresponding to x
|
For more information, visit the following URL:
http://java.sun.com/j2se/1.4/docs/api/java/util/regex/Pattern.html