Index Changes

Difference between version and version     

Back to Understanding The Encoder Framework, or Understanding The Encoder Framework Info


At line 1 changed 1 line.
!!!About Data Parsing and Serialization
This Wiki page is obsolete.
At line 3 removed 69 lines.
The parsing and serializing operations require data to be in byte-array form, so different methods for encoding and decoding data must be used to accommodate different input and output data formats. These different methods incorporate various stages of character conversion using specific character sets.
!!Encoding Process
Internally, the encoder requires the data input and output to be in bytes. The encoding process uses the {{serializing charset}}, as illustrated in the following figure.
__Figure 1-24 Encoding Process__
[{Image src='Encoder_Coding_marshal.gif' width='' height='' align='left|center|right' }]
!!encodeToString() Method
The {{encodeToString()}} method requires conversion to produce an output string after encoding from a byte[] field. This method also requires conversion when encoding from a string field, since the parser requires the data in bytes, and conversion again to produce an output string. The {{encodeToString()}} process uses the {{serializing charset}}, as illustrated in the following figure.
__Figure 1-25 encodeToString()__
[{Image src='Encoder_Coding_marshalToString.gif' width='' height='' align='left|center|right' }]
!!encodeToBytes() Method
The {{encodeToBytes()}} method requires conversion to produce bytes after encoding from a string field. Following serialization, this method also requires conversion to produce an output (in bytes) having a different format from that used by the parser. If the same format is desired, then the {{output charset}} is left undefined, the {{serializing charset}} property is substituted by default, and the double conversion is bypassed. The {{encodeToBytes()}} process uses both the {{serializing charset}} and the {{output charset}}, as illustrated in the following figure.
__Figure 1-26 encodeToBytes()__
[{Image src='Encoder_Coding_marshalToBytes.gif' width='' height='' align='left|center|right' }]
!!encodeToStream() Method
Encodes an XML representation of a message into an OutputStream object, encoded in custom format.
!!encodeToWriter() Method
Encodes an XML representation of a message into a Writer object, encoded in custom format.
!!Decoding Process
Internally, the decoding process requires conversion when decoding to a string field, since the input is in bytes as required by the parser. The decoding process uses the {{parsing charset}}, as illustrated in the following figure.
__Figure 1-27 Decoding Process__
[{Image src='Encoder_Coding_unmarshal.gif' width='' height='' align='left|center|right' }]
!!decodeFromString() Method
The {{decodeFromString()}} method requires conversion of the input string, since the parser requires the data in bytes. This method requires a second conversion when decoding to a string field. The {{decodeFromString()}} process uses the {{parsing charset}}, as illustrated in the following figure.
__Figure 1-28 decodeFromString()__
[{Image src='Encoder_Coding_unmarshalFromString.gif' width='' height='' align='left|center|right' }]
!!decodeFromBytes() Method
The {{decodeFromBytes()}} method requires conversion if the input data has a different byte format from that used by the parser. If the same format is desired, then the {{input charset}} is left undefined, the {{parsing charset}} is substituted by default, and the double conversion is bypassed. After parsing, this method requires further conversion if decoding to a string field. The {{decodeFromBytes()}} process uses both the {{input charset}} and the {{parsing charset}}, as illustrated in the following figure.
__Figure 1-29 decodeFromBytes()__
[{Image src='Encoder_Coding_unmarshalFromBytes.gif' width='' height='' align='left|center|right' }]
!!decodeFromStream() Method
Decodes an InputStream object encoded in custom format into an XML-encoded message.
!!decodeFromReader() Method
Decodes a Reader object encoded in custom format into an XML-encoded message.
!!Setting Delimiters
The following figure illustrates how the delimiter gets set and passed into the parser.
__Figure 30 Setting Delimiters__
[{Image src='DelimiterToParser_FlowGFESB.gif' width='' height='' align='left|center|right' }]
As an example, if you select a delimiter in the XSD Editor by hex code (such as __\x7C__), it is passed directly into the parser. If you type the delimiter in as a pipe (__|__), however, then the pipe character is first converted to hex code, using the GUI’s encoding, and then sent to the parser.

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-9) was last changed on 09-Dec-08 18:27 PM, -0800 by NormS