WebSphere Enterprise Service Bus for z/OS, Version 6.2.0 Operating Systems: z/OS


Transforming string objects from one bidirectional language format to another

For data coming from an external Enterprise Information System (EIS), you can create APIs that transform string data into the supported bidirectional language format and that transform data sent from WebSphere® ESB to an external EIS into the bidirectional format used by that specific EIS.

Before you begin

For more information about bidirectional language support, see Globalization. Use the table in Globalization to determine the correct value for either the input string or output string to use when transforming string data from one format to another.

To create an API to transform the bidirectional language format of string objects, perform the following steps.

Procedure
  1. Include all bidirectional classes that contain the bidirectional engine implementation. For example:
    import com.ibm.bidiTools.bdlayout.*;
  2. Define the strings to contain the data object to transform, and the input and output format values.

    The input format is the bidirectional format in which the string object is currently stored. The output format is the bidirectional format in which you want to store the string object.

    For example:
    String strIn = new String("Hello world");
    String formatIn = "ILYNN";
    String formatOut = "VLYNN";
  3. Call the BidiStringTransformation function. For example:
    String strOut = BiDiStringTransformation(strIn, formatIn, formatOut);
    String BiDiStringTransformation(String strIn, String formatIn, String formatOut) {
    1. Test if the input string is null. For example:
      		if (strIn == null) return null;
    2. Perform the transformation. For example:
      		BidiFlagSet flagsIn; 
      		BidiFlagSet flagsOut; 
      		formatIn = formatIn.toUpperCase(); 
      		formatOut = formatOut.toUpperCase(); 
      
      		if (formatIn != null) 
          		flagsIn = new BidiFlagSet(formatIn.toCharArray()); 
      		else 
          		flagsIn = new BidiFlagSet(); 
      
      		if (formatOut != null) 
          		flagsOut = new BidiFlagSet(formatOut.toCharArray()); 
      		else 
          		flagsOut = new BidiFlagSet();
      
      		if (flagsIn.equals(flagsOut)) return strIn; 
      		String strOut = BiDiStringTransformation(strIn, flagsIn, flagsOut); 
      		return strOut;
      }

task Task topic

Terms of use | Feedback


Timestamp icon Last updated: 21 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.zseries.doc/doc/tref_example_bidistring.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).