Class FSDMsg

java.lang.Object
org.jpos.util.FSDMsg
All Implemented Interfaces:
Cloneable, Loggeable

public class FSDMsg extends Object implements Loggeable, Cloneable
General purpose, Field Separator delimited message.

How to use

The message format (or schema) is defined in xml files containing a schema element, with an optional id attribute, and multiple field elements. A field element is made up of the following attributes:

id
The name of the field. This is used in calls to set(String, String). It should be unique amongst the fields in an FSDMsg.
length
The maximum length of the data allowed in this field. Fixed length fields will be padded to this length. A zero length is allowed, and can be useful to define extra separator characters in the message.
type
The type of the included data, including an optional separator for marking the end of the field and the beginning of the next one. The data type is defined by the first char of the type, and the separator is defined by the following chars. If a field separator is specified, then no padding is done on values for this field.
key
If this optional attribute has a value of "true", then fields from another schema, specified by the value, are appended to this schema.
separator
An optional attribute containing the separator for the field. This is the preferred method of specifying the separator. See the list of optional

Possible types are:

A
Alphanumeric. Padding if any is done with spaces to the right.
B
Binary. Padding, if any, is done with zeros to the left.
K
Constant. The value is specified by the field content. No padding is done.
N
Numeric. Padding, if any, is done with zeros to the left.

Supported field separators are:

FS
Field separator using '034' as the separator.
US
Field separator using '037' as the separator.
GS
Group separator using '035' as the separator.
RS
Row separator using '036' as the separator.
PIPE
Field separator using '|' as the separator.
EOF
End of File - no separator character is emitted, but also no padding is done. Also if the end of file is reached parsing a message, then no exception is thrown.
DS
A dummy separator. This is similar to EOF, but the message stream must not end before it is allowed.
EOM
End of message separator. This reads all bytes available in the stream.

Key fields allow you to specify a tree of possible message formats. The key fields are the fork points of the tree. Multiple key fields are supported. It is also possible to have more key fields specified in appended schemas.

Since:
1.4.7