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

Defining a Delimiter List

As an example, we shall create a delimiter list for the simple Encoder structure shown in the following figure.

Figure 14 Sample Encoder Tree

image:Image of Encoder node tree.

To create a delimiter list

  1. In the XSD Editor, select the node for which you want to define a set of delimiters (this example uses the root node, which is designated Element_1).

    By default, the value for the Node Type property is set to delimited and the value for the Delimiter List property appears as not specified.


    Note - The Node Type values for elements and fields also are delimited by default, so they automatically pick up the delimiters specified for their ancestors unless you define new delimiter lists for them.


  2. Click the ellipsis button in the Delimiter List value field to display the Delimiter List Editor, which is initially blank.
  3. Click Add Level to add a level to the delimiter list, then click Add Delimiter to add a delimiter to the selected level. Click in the Bytes field to activate it for editing and type in the delimiter characters.
  4. Press Enter to set the delimiter value. The list should appear as shown in the following figure.

    Figure 15 Delimiter List Editor - Add Delimiter

    image:Image of Delimiter List Editor with one Level and one Delimiter.
  5. Continue adding levels and delimiters as required, as shown in the following figure.

    Figure 16 Delimiter List Editor - Add Levels and Delimiters

    image:Image of Delimiter List Editor with multiple Levels and multiple Delimiters.
  6. Click OK to close the editor and save your work.
  7. The value for the Delimiter List property will now indicate the number of delimiter levels that are specified, as shown in the following figure.

    Figure 17 Element_1 - Delimiters Specified

    image:Image of Element_1 node Properties panel.
  8. The properties for Element_2 are displayed in the following figure. It automatically picks up the delimiters for Level 2, since the existing delimiter list is defined for Element_1. Defining another delimiter list here would override the existing list.

    Figure 18 Element_2 Properties

    image:Image of Element_2 node Properties panel.
  9. Leave the Node Type property for Field_1 set to delimited; it automatically picks up the delimiters for Level 3 from the list defined for Element_1, as displayed in the following figure. Again, the Delimiter List property remains not specified.

    Figure 19 Field_1 Properties

    image:Image of Field_1 node Properties panel.
  10. Once you have defined your delimiter list, you should test the Encoder to verify that it parses correctly.