Custom field
Field number
Field number (in the range 2 - 127) of the fields that should be encoded/decoded using these custom field settings.
CustomField
implementation that encodes/decodes text values that are composed of multiple sub-values, each separated by a delimiter.
Delimiter
Delimiter that separates the sub-values, e.g. ;
.
End with delimiter
If true
, the encoded value will always end with a delimiter; if false
the last sub-value is not followed by a delimiter (if the encoded value in this case ends with a delimiter, this indicates the last sub-value is the empty string).
CustomField
implementation that encodes/decodes numeric values that are composed of multiple sub-values, each with a pre-defined fixed length.
Lengths
Comma separated list of the fixed lengths of each sub-value (from left to right), e.g. 4,12,8
.
CustomField
implementation that encodes/decodes text values that are composed of multiple sub-values, each with a pre-defined fixed length.
Lengths
Comma separated list of the fixed lengths of each sub-value (from left to right), e.g. 4,12,8
.
CustomField
implementation that encodes/decodes DateTime
values using a configurable format pattern.
Pattern
Pattern string for parsing/printing DateTime values, e.g. yyyyMMddHHmmss
.
CustomField
implementation that decodes fields containing a (nested) IsoMessage
.
Internally, a BytesToXmlTransformer
is used to parse the ISO8583 bytes into an IsoMessage
object and to serialize these objects to XML. Because the nested message may not contain a message type and messages without a type cannot be parsed, this decoder can add one to the nested message: such a modified message will always be of type 0x9999
. The message factory of the provided transformer therefore needs to be configured for the expected message type(s), or for type 0x9999
if the messages don't contain a message type.
This decoder can also shift the bits of the primary bitmap of the nested message, which is useful in situations where this bitmap is not quite a standard ISO8583 bitmap as used for "normal", non-nested messages. For example, when the first bit of the primary bitmap of the nested message is used for the first field instead of indicating the presence of a secondary bitmap, you can still parse the message if you shift the bitmap 1 bit to the right.
Note that this strictly is a decoder, intended to be used when parsing ISO8583 messages. This class is not an encoder that can be used to create new ISO8583 messages.
Use binary messages
Sets whether to create and parse messages in binary or in ASCII format.
Default is false
(create and parse ASCII messages).
Parse maps
Registers the parse maps to be used when parsing messages.
By default no parse maps are registered, but they are required for parsing messages.
Custom fields
Registers custom field encoder/decoders that are used for parsing and creating messages.
By default no custom field encoders/decoders are registered.
Misses type header
If true, incoming messages are expected to not contain the type header. Since this header is required for parsing ISO8583 messages, this decoder will add the message type 0x9999
to all messages. If false
, it is expected the message already contains the correct type header.
Default is false
, indicating that incoming messages do contain the type header.
Shift bitmap
Shifts the primary bitmap in the message the specified number of bits to the right. Use 0
for no shifting, or a negative value for shifting to the left.
Default is 0
, which disables any bitmap shifting.
Note: The shifting method of this class only works on messages with an 8 byte binary bitmap.
ISO header length
Sets the expected length of the ISO header for the messages this transformer will receive, after which the message type and the rest of the message must come.
Default is 0
, which indicates no header (first field of the message is expected to specify the message type).
Allow empty messages
If true
, ISO8583 messages that don't contain any fields after parsing will not cause an exception but will generate an empty <iso8583:message type="..."/>
XML message.
A message can be empty for one of the following reasons: 1 - the message couldn't correctly be parsed because it contained a field that wasn't specified in the parse map (this points to a real problem, as there apparently is a mismatch between the message definition and the actual messages) 2 - the message didn't contain any of the fields specified in the parse map (fields are always optional, so this technically is correct) 3 - the parse map for the message type is empty and the message too (which also is technically correct)
Default is false
, which causes a (runtime) exception to be thrown when parsing results in an empty message. In most cases this is the "correct" behaviour, as empty messages are most likely caused by reason #1 (see above).
Convert bitmaps
In situations where incoming messages use the ASCII format but the bitmaps are using the binary format (which is unusual and not supported by j8583, but allowed by ISO8583), the bitmaps (primary and optionally secondary) need to be converted to ASCII before the MessageFactory
can parse it. In these cases you should set this property to true
and make sure the message factory uses ASCII messages.
Default is false
, which doesn't convert the bitmaps.
Character encoding
Sets the character encoding used for parsing and encoding ALPHA, LLVAR and LLLVAR fields.
Default is the value of the file.encoding
system property.
Ignore last missing field
Setting this property to true avoids getting a ParseException when parsing messages that don't have the last field specified in the bitmap. This is common with certain providers where field 128 is specified in the bitmap but not actually included in the messages.
Default is false
.
CustomField
implementation that encodes fields containing a (nested) IsoMessage
.
Internally, an XmlToBytesTransformer
is used to deserialize XML into an IsoMessage
object and to encode these objects to ISO8583. Because the outgoing message may be required to not contain a message type, this encoder can remove the type header from the nested message.
This encoder can also shift the bits of the primary bitmap of the nested message, which is useful in situations where this bitmap is required to be not quite a standard ISO8583 bitmap as used for "normal", non-nested messages. For example, when the first bit of the primary bitmap of the nested message is used for the first field instead of indicating the presence of a secondary bitmap, you can create the correct outgoing message if you shift the bitmap 1 bit to the left.
Note that this strictly is an encoder, intended to be used when creating ISO8583 messages. This class is not a decoder that can be used to parse ISO8583 messages.
Use binary messages
Sets whether to create and parse messages in binary or in ASCII format.
Default is false
(create and parse ASCII messages).
Custom fields
Registers custom field encoder/decoders that are used for parsing and creating messages.
By default no custom field encoders/decoders are registered.
Remove type header
If true
, outgoing messages are expected to not contain the type header. Since this header is normally always present in ISO8583 messages, this encoder will remove the header from all messages. If false
, the type header is not removed.
Default is false
, indicating that outgoing messages should contain the type header.
Shift bitmap
Shifts the primary bitmap in the outgoing message the specified number of bits to the right. Use 0
for no shifting, or a negative value for shifting to the left.
Default is 0
, which disables any bitmap shifting.
Note: The shifting method of this class only works on messages with an 8 byte binary bitmap.
Convert bitmaps
In situations where outgoing messages use the ASCII format but the bitmaps should be using the binary format (which is unusual and not supported by j8583, but allowed by ISO8583), the bitmaps (primary and optionally secondary) need to be converted to binary. In these cases you should set this property to true
and make sure the message factory uses ASCII messages.
Default is false
, which doesn't convert the bitmaps.
Assign date
Sets whether the current date should be set in field 7 on newly created messages.
Default is false
.
Character encoding
Sets the character encoding used for parsing and encoding ALPHA, LLVAR and LLLVAR fields.
Default is the value of the file.encoding
system property.
EXT
Sets the ETX character to be sent at the end of the message.
Default is -1
, which indicates nothing should be sent as terminator.
Force secondary bitmap
Sets whether to include a secondary bitmap when creating messages even if it's not needed.
Default is false
.
Trace number generator type
TraceNumberGenerator
used to generate trace numbers that should be set in field 11 on newly created messages.
Default is empty
, indicating no trace numbers should be set in field 11 on newly created messages.
ISO headers
Sets the ISO headers to be used when creating messages.
By default, no ISO headers are used when creating messages of any type.
CustomField
implementation that encodes/decodes Triple DES encrypted + Base64 encoded values.
Key
Triple DES key for encrypting/decrypting values, e.g. 194837294857593owc2394ow
.
CustomField
implementation that decodes String values (possibly containing 'unsafe' bytes) as Base64 String values, and encodes Base64 String values as String values (possibly containing 'unsafe' bytes).
By using this encoder, it's possible to use ALPHA
, LLVAR
or LLLVAR
fields to store binary data. Please note that this is not recommended: if possible, use a BINARY
, LLBIN
or LLLBIN
field instead.
Auto-detect Base64
If true, the input during encoding is scanned to see if it's a Base64 string or not. If it is, it will be decoded and the resulting bytes will be converted to the output string. If not, the input is returned unaltered.
If false, when the input is not a Base64 string an exception will be thrown.
Default is false.
Charset
Sets the character set used for encoding/decoding a byte[]
as a String. You probably want to use the exact same character set the MessageFactory is using.
Default is the value of the file.encoding
system property.
Simple implementation of a TraceNumberGenerator
with an internal number that is increased in memory but is not stored anywhere.
Initial trace number
The value for the first generated trace number; a number between 1 and 999999.
Required