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

Validating and Testing the Custom Message Definition

The following topics provide instructions for validating and testing the custom message definitions:

Validating the Custom Message Definition

You can validate the encoding rules, along with the message definition in XML format, by clicking the validation button in the XSD Editor. If encoding rules are present, they are validated following validation of the XML grammar and semantics. An example output showing multiple errors is shown in the following figure.

Figure 20 Example Validation Result

image:Figure described in content.

Testing the Encoder Runtime Behavior

The Encoder Tester allows you to test the Encoder's runtime behavior at design time. To display the tester dialog, right-click the XSD file to display its context menu and select Encoder > Test, as shown in the following figure.

Figure 21 Starting the Encoder Tester

image:Figure described in content.

The Test Encoding dialog is shown in the following figure. The various fields are described briefly in the table following the figure. After the Decode test is complete, the result is placed in an XML file inside the current project. This file can then be validated as described in the preceding section. There is no automatic method for validating the Encode result, however.

Figure 22 Test Encoding Dialog

image:Image of Test Encoding Dialog.

Table 14 Test Encoding Dialog Fields

Section
Field Caption
Description
Meta
Select an Element
Specifies the top-level element whose structure you want to test.
XSD File
Identifies the XSD file you have selected for testing.
Input
Decode/Encode
Option buttons to select the direction of data flow for the test. Specifies whether encoding or decoding behavior is being tested.
From/To String
Specifies that the input or output data is in string format. If not checked, byte format is assumed.
Data File
Specifies the data file to use in the Decode test.
XML Source File
Specifies the source file to use in the Encode test.
Source/Result Coding
Specifies the encoding of the serialized data. See Data Encoding
Output
File Name
Specifies the file name to use for the test result.
Folder
Specifies the folder in which you want the output file to be placed.
Overwrite Output
Specifies whether or not you want to overwrite any existing output file having the same name.
Created File
Confirms that the output file has been created, along with the location.
Debug
Verbose Level

Specifies the level of detail contained in the log file. The options are:

  • None
  • Info

  • Fine

  • Finer

  • Finest