|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.AS400BidiTransform
The AS400BidiTransform class provides layout transformations that allow the conversion of Bidi text in AS/400 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 AS/400 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:
// Java data to AS/400 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 AS/400 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 AS/400 Bidi text conforms to a given CCSID. |
Method Summary | |
int |
getAS400Ccsid()
Returns the current CCSID of AS/400 data. |
int |
getAS400StringType()
Returns the current string type of AS/400 data. |
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. |
void |
setAS400Ccsid(int as400Ccsid)
Sets the CCSID. |
void |
setAS400StringType(int as400Type)
Set the explicit string type for AS/400 data. |
void |
setJavaStringType(int javaType)
Set the explicit string type for Java data. |
java.lang.String |
toAS400Layout(java.lang.String javaText)
Convert data from the Java layout to the AS/400 layout. |
java.lang.String |
toJavaLayout(java.lang.String as400Text)
Convert data from the AS/400 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 AS/400 data layout and the Java data layout.
as400Ccsid
- The CCSID of the AS/400 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 AS/400 data to Java data and vice-versa.
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 AS/400 data layout and the Java data layout.
as400Ccsid
- The CCSID of the AS/400 data.public int getAS400Ccsid()
public void setAS400StringType(int as400Type)
The orientation implied by the new given string type is applied to both the AS/400 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 AS/400 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 java.lang.String toJavaLayout(java.lang.String as400Text)
as400Text
- The AS/400 string to convert.public java.lang.String toAS400Layout(java.lang.String javaText)
javaText
- The Java string to convert.public static int getStringType(int ccsid)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |