BiDiStringTransformation()

The BiDiStringTransformation() method transforms strings from one bidirectional format to the other.

Syntax

BiDiStringTransformation(String strIn, String formatIn, String formatOut

Parameters

strIn
The string to transform.

formatIn
A string that represents the bidirectional format of the input business object content. See Table 88 for the valid values of this string. If this parameter is null, the method defaults to the standard Windows bidirectional format.

formatOut
A string that represents the bidirectional format of the output business object content. See Table 88 for the valid values of this string. If this parameter is null, the method defaults to the standard Windows bidirectional format

Table 88. Values for format strings

Letter position Purpose Values Description Default
1 Type I Implicit (Logical) I
V Visual
2 Direction L Left to Right L
R Right to Left
3 Symmetric swapping Y Symmetric swapping is on Y
N Symmetric swapping is off
4 Shaping Y Text is shaped N
N Text is not shaped
5 Numeric shaping H Hindi N
C Contextual
N Nominal

Return values

The return value is a transformed string.

Exceptions

None.

Examples

The following example applies the BiDiStringTransformation() methodto the attribute values of a business object.

for (int i = 0; i < bo.getAttrCount();i++) {
 intAttrType = bo.getAttributeType(i);
 Object attrValue = bo.getAttrValue(i);
 String attrName = bo.getAttrName(i);
 
 if (attrValue != null {
    // We handle only String or Long Text Attribute and not
    // the ObjectEventId attribute
    if (((attrType == CxObjectAttrType.STRING)
           || (attrType == CxObjectAttrType.LONGTEXT))
           && (!(attrName.equals(OBJECT_EVENT_ID)))) {
             String strOut = BidiStringTransformation(attrValue.toString(),
             bo.setAttrValue(i, strOut);
    } else if (attrType == CxObjectAttrType.OBJECT) {
        CxObjectAttr attrDesc = bo.getAttrDesc(i);
        if (attrDesc.getCardinality().equals(CxObjectAttr.CARD_Single)) {
           BiDiTransformation((BusinessObject) attrValue, "ILYNN",
                                                          "VLYNN",
                                                          true);
       } else {
           // multiple cardinality
           CxObjectContainer cont = (CxObjectContainer) attrValue;
           int objCount = cont.getObjectCount();
           for (int j = 0; j < objCount; j++) {
               BiDiBOTransformation((BusinessObject) (cont.getObject(j)),
                                         "ILYNN",
                                         "VLYNN",
                                         true);
       }
    }
  }

Copyright IBM Corp. 1997, 2004