JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS Custom Encoders User's Guide     Java CAPS Documentation
search filter icon
search icon

Document Information

Designing Custom Encoders

Understanding the Encoder Framework

Abstract Message Structure

Parent, Child, and Sibling Nodes

Root Nodes

Non-leaf Nodes

Leaf Nodes

Creating the Abstract Message Definition

Recursive Structure

Binary Data Types

Applying Custom Encoding to an XSD

To Apply the Custom Encoder to an XSD

Editing Encoding Properties

Encoding Properties

Node Type Default Values

Order Property

Data Encoding

Matching Data Patterns

Defining Byte Patterns

Specifying Pattern Alignment

Specifying Delimiters

Delimiter List

Delimiter Properties

Delimiter Levels

Delimiter Type

Escape Option

Precedence

Optional

Terminator

Delimiter Characters (Bytes)

Escape Sequences

Multiple Delimiters

Anchored and Detached Delimiters

Begin and End Delimiters

Constant and Embedded Delimiters

Defining a Delimiter List

To create a delimiter list

Validating and Testing the Custom Message Definition

Validating the Custom Message Definition

Testing the Encoder Runtime Behavior

Using Custom Encoders in JBI Projects

To Use a Custom Encoder in a JBI Project

About Data Parsing and Serialization

Encoding Process

encodeToString() Method

encodeToBytes() Method

encodeToStream() Method

encodeToWriter() Method

Decoding Process

decodeFromString() Method

decodeFromBytes() Method

decodeFromStream() Method

decodeFromReader() Method

Setting Delimiters

Matching Data Patterns

One of the parsing techniques that can be applied to the decoding of an input data stream is that of matching a specific byte pattern within a data sequence. You can accomplish this in a Custom Encoder by using the Match and Align field-node properties, when the Node Type is either delimited or fixedLength. During the decode operation, a field is successfully matched if it complies with the value of the Match property, interpreted according to the value of the Align property, as set for that field.

Defining Byte Patterns

The value you enter for the Match property defines the byte pattern for the data you want to match. As an example, a value of abc has been entered into the value field shown in the following figure. This provides a reference for the Alignment property, as shown in the next section.

If the Node Type property is set to fixedLength, and the Fixed Length Type property is specified as determined by regex match, the Alignment property is automatically set to regex and the regular expression (regex) must be entered into the Match value field.

Selecting the No Match check box reverses the situation, resulting in a match if the field contents (data) are not equal to the byte pattern entered in the Match field.

Figure 4 Match Property

image:Figure described in content.

Specifying Pattern Alignment

The align property supplements the match property, specifying criteria on which to base the match. The default value is blind; if this is specified, the match property has no meaning.

Figure 5 Align Property Menu

image:Figure described in content.

Table 7 Align Parameter Options

Option
Description
blind
Always performs a match (pass-through). Any value set for the Match property is ignored. This is the default value.
exact
When an input byte sequence exactly matches the specified byte pattern (for example, [abc]), the decode method matches the field to the input byte sequence.
begin
When the leading bytes of an input byte sequence match the value set for the Match property (for example, [abc......]), the decode method matches the field to the input byte sequence.
final
When the trailing bytes of an input byte sequence match the value set for the Match property (for example, [......abc]), the decode method matches the field to the input byte sequence.
inter
When the input byte sequence contains a byte pattern that includes the value set for the Match property, (for example, [...abc...]), the decode method matches the field to the input byte sequence.
super
When an input byte sequence is a subsequence of the value set for the Match property (for example, [bc]), the decode method matches the field to the input byte sequence.
oneof
If the value set for the Match property is a repeating pattern of the form <separator><value>... (for example, [\mon\wed\fri]), and the input byte sequence contains a byte pattern that matches one of the <value> entries (for example, [wed]), the decode method matches the field to the input byte sequence.
regex
When an input byte sequence exactly matches the regular expression specified in the Match property, the decode method matches the field to the input byte sequence. The Alignment property is automatically set to regex when the Fixed Length Type property is specified as determined by regex match.

Note - The value entered for the match property is interpreted as a Latin1 string, rather than following the specified encoding.