|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.access.AS400BidiTransform
The AS400BidiTransform class provides layout transformations that allow the conversion of Bidi text in i5/OS format (after its conversion to Unicode) to Bidi text in Java format, or vice-versa.
Bidi text is a combination of a sequence of characters and a set of Bidi flags. That text (Arabic or Hebrew) has characters which are read from right to left. That text might also be mixed with numbers which are read from left to right, and possibly also mixed with Latin characters. Conversion support is needed to display text properly with the correct order and shape.
Bidi text from an i5/OS system may be represented by a combination of a String (the characters) and a CCSID (which implies a set of Bidi flags specific to that CCSID).
Multi-threading considerations: different threads may use the same AS400BidiTransform object if they have the same transformation needs, as follows:
Otherwise, each thread must use its own instances of this class.
The following example illustrate how to transform bidi text:
// Java data to i5/OS layout: AS400BidiTransform abt; abt = new AS400BidiTransform(424); String dst = abt.toAS400Layout("some bidi string"); // Specifying a new CCSID for an existing AS400BidiTransform object: abt.setAS400Ccsid(62234); // 420 RTL // String dst = abt.toAS400Layout("some bidi string"); // Specifying a non-default string type for a given CCSID: abt.setAS400StringType(BidiStringType.ST4); // Vis LTR // String dst = abt.toAS400Layout("some bidi string"); // Specifying a non-default string type for Java data: abt.setJavaStringType(BidiStringType.ST11); // Imp Context LTR // String dst = abt.toAS400Layout("some bidi string"); // How to transform i5/OS data to Java layout: abt.setJavaStringType(BidiStringType.ST6); // Imp RTL // String dst = abt.toJavaLayout("some bidi string");
Constructor Summary | |
---|---|
AS400BidiTransform(int as400Ccsid)
Constructs an AS400BidiTransform object assuming that the i5/OS Bidi text conforms to a given CCSID. |
Method Summary | |
---|---|
int |
getAS400Ccsid()
Returns the current CCSID of i5/OS data. |
int |
getAS400StringType()
Returns the current string type of the i5/OS data. |
BidiConversionProperties |
getBidiConversionProperties()
Returns the bidi converion properties. |
int |
getJavaStringType()
Returns the current string type of Java data. |
static int |
getStringType(int ccsid)
|
static boolean |
isBidiCcsid(int ccsid)
Indicates if a given CCSID may apply to Bidi data. |
static boolean |
isVisual(int ccsid)
Indicates if a given CCSID has a visual string type. |
void |
setAS400Ccsid(int as400Ccsid)
Sets the CCSID. |
void |
setAS400StringType(int as400Type)
Set the explicit string type for the i5/OS data. |
void |
setBidiConversionProperties(BidiConversionProperties properties)
Sets the bidi converion properties. |
void |
setJavaStringType(int javaType)
Set the explicit string type for Java data. |
String |
toAS400Layout(String javaText)
Convert data from the Java layout to the i5/OS layout. |
String |
toJavaLayout(String as400Text)
Convert data from the i5/OS layout to the Java layout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AS400BidiTransform(int as400Ccsid)
The given CCSID has a default string type which defines a set of Bidi flags. The orientation implied by this string type is applied to both the i5/OS data layout and the Java data layout.
as400Ccsid
- The CCSID of the i5/OS data.Method Detail |
public static boolean isBidiCcsid(int ccsid)
If a CCSID is not Bidi, there is no need to perform layout transformations when converting i5/OS data to Java data and vice-versa.
ccsid
- The CCSID to check.
public static boolean isVisual(int ccsid)
ccsid
- The CCSID to check.
public void setAS400Ccsid(int as400Ccsid)
The given CCSID has a default string type which defines a set of Bidi flags. The orientation implied by this string type is applied to both the i5/OS data layout and the Java data layout.
as400Ccsid
- The CCSID of the i5/OS data.public int getAS400Ccsid()
public void setAS400StringType(int as400Type)
The orientation implied by the new given string type is applied to both the i5/OS data layout and the Java data layout. The new string type is applied to the Java data layout by calling setJavaStringType(as400Type).
as400Type
- The string type to apply to the i5/OS data. The parameter string type should always be one of the constants defined in BidiStringType.BidiStringType
public int getAS400StringType()
public void setJavaStringType(int javaType)
javaType
- The string type to apply to Java data.BidiStringType
public int getJavaStringType()
public void setBidiConversionProperties(BidiConversionProperties properties)
properties
- The bidi conversion properties.public BidiConversionProperties getBidiConversionProperties()
public String toJavaLayout(String as400Text)
as400Text
- The i5/OS string to convert.
public String toAS400Layout(String javaText)
javaText
- The Java string to convert.
public static int getStringType(int ccsid)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |