Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.subsystems.qsys.api
Class CCSIDStaticHelpers

java.lang.Object
  extended by com.ibm.etools.iseries.subsystems.qsys.api.CCSIDStaticHelpers

public class CCSIDStaticHelpers
extends Object

This class contains static methods releated to CCSID conversions and lookups. This information is stored in plain text tables in the ccsidtables subdirectory for this plugin. These tables need to be updated for every new OS/400 release. Last update: V5R2


Field Summary
static int CCSID_BIDI
          Constant representing BIDI CCSIDs
static int CCSID_DBCS
          Constant representing DBCS CCSIDs
static int CCSID_MIXED
          Constant representing MIXED CCSIDs
static int CCSID_NOT_SUPPORTED
          Constant representing that the specified CCSID is not supported
static int CCSID_SBCS
          Constant representing SBCS CCSIDs
static int CLVARCHARS_NOT
          Constant for indexing into the CL variant characters array to retrieve the symbol for *NOT.
static int CLVARCHARS_OR
          Constant for indexing into the CL variant characters array to retrieve the symbol for *OR.
static String Copyright
           
static int SPECCHARS_ATSIGN_INDEX
          Constant for indexing into the special characters array to retrieve the @ sign
static int SPECCHARS_DBLQUOTE_INDEX
          Constant for indexing into the special characters array to retrieve the " sign
static int SPECCHARS_DOLLAR_INDEX
          Constant for indexing into the special characters array to retrieve the $ sign
static int SPECCHARS_POUND_INDEX
          Constant for indexing into the special characters array to retrieve the # sign
 
Constructor Summary
CCSIDStaticHelpers()
           
 
Method Summary
static int checkCCSID(int ccsid)
          Checks if the CCSID is DBCS, SBCS, mixed, BIDI or not supported.
static int[] getBidiCCSIDs()
          Return the integer array which contains the list of all supported BIDI CCSIDs.
static char[] getCLVariantChars(int ccsid)
          Retrieve the CL variant chars for *OR and *NOT for the specified CCSID
static int[] getDbcsCCSIDs()
          Return the integer array which contains the list of all supported mixed CCSIDs.
static int[] getMixedCCSIDs()
          Return the integer array which contains the list of all supported mixed CCSIDs.
static char[] getSpecialChars(int ccsid)
          Retrieve the special characters for the CCSID
static int[] getSupportedCCSIDs()
          Return the integer array which contains the list of all supported CCSIDs.
static boolean isCCSIDValid(int ccsid)
          Check if the CCSID is valid.
static List postConversionProcess(List input, int ccsid)
          Postproccess the Strings for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/postconversion/ccsidNumber.tbl table.
static String postConversionProcess(String input, int ccsid)
          Postproccess the String for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/plostconversion/ccsidNumber.tbl table.
static byte[] preConversionProcess(byte[] input, int ccsid)
          Preproccess the byte[] for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/preconversion/ccsidNumber.tbl table.
static List preConversionProcess(List input, int ccsid)
          Preproccess the byte[] for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/preconversion/ccsidNumber.tbl table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

CCSID_NOT_SUPPORTED

public static final int CCSID_NOT_SUPPORTED
Constant representing that the specified CCSID is not supported

See Also:
Constant Field Values

CCSID_SBCS

public static final int CCSID_SBCS
Constant representing SBCS CCSIDs

See Also:
Constant Field Values

CCSID_DBCS

public static final int CCSID_DBCS
Constant representing DBCS CCSIDs

See Also:
Constant Field Values

CCSID_MIXED

public static final int CCSID_MIXED
Constant representing MIXED CCSIDs

See Also:
Constant Field Values

CCSID_BIDI

public static final int CCSID_BIDI
Constant representing BIDI CCSIDs

See Also:
Constant Field Values

SPECCHARS_DOLLAR_INDEX

public static final int SPECCHARS_DOLLAR_INDEX
Constant for indexing into the special characters array to retrieve the $ sign

See Also:
Constant Field Values

SPECCHARS_POUND_INDEX

public static final int SPECCHARS_POUND_INDEX
Constant for indexing into the special characters array to retrieve the # sign

See Also:
Constant Field Values

SPECCHARS_ATSIGN_INDEX

public static final int SPECCHARS_ATSIGN_INDEX
Constant for indexing into the special characters array to retrieve the @ sign

See Also:
Constant Field Values

SPECCHARS_DBLQUOTE_INDEX

public static final int SPECCHARS_DBLQUOTE_INDEX
Constant for indexing into the special characters array to retrieve the " sign

See Also:
Constant Field Values

CLVARCHARS_OR

public static final int CLVARCHARS_OR
Constant for indexing into the CL variant characters array to retrieve the symbol for *OR.

See Also:
#, Constant Field Values

CLVARCHARS_NOT

public static final int CLVARCHARS_NOT
Constant for indexing into the CL variant characters array to retrieve the symbol for *NOT.

See Also:
#, Constant Field Values
Constructor Detail

CCSIDStaticHelpers

public CCSIDStaticHelpers()
Method Detail

getSupportedCCSIDs

public static int[] getSupportedCCSIDs()
Return the integer array which contains the list of all supported CCSIDs.


getBidiCCSIDs

public static int[] getBidiCCSIDs()
Return the integer array which contains the list of all supported BIDI CCSIDs.


getMixedCCSIDs

public static int[] getMixedCCSIDs()
Return the integer array which contains the list of all supported mixed CCSIDs.


getDbcsCCSIDs

public static int[] getDbcsCCSIDs()
Return the integer array which contains the list of all supported mixed CCSIDs.


isCCSIDValid

public static boolean isCCSIDValid(int ccsid)
Check if the CCSID is valid. This is a shortcut to just check if the CCSID is valid, if you need to determine what type of CCSID it is then use checkCCSID.

Parameters:
ccsid - The CCSID to be checked.
Returns:
true if the CCSID is valid, false if it is not.

checkCCSID

public static int checkCCSID(int ccsid)
Checks if the CCSID is DBCS, SBCS, mixed, BIDI or not supported.

Parameters:
ccsid - The ccsid to lookup.

getSpecialChars

public static char[] getSpecialChars(int ccsid)
Retrieve the special characters for the CCSID

Parameters:
ccsid - The CCSID to lookup the special characters for
Returns:
Character array containing the special characters, use the following constants to index into the array to find the required character:
See Also:
SPECCHARS_POUND_INDEX, SPECCHARS_DOLLAR_INDEX, SPECCHARS_ATSIGN_INDEX, SPECCHARS_DBLQUOTE_INDEX

getCLVariantChars

public static char[] getCLVariantChars(int ccsid)
Retrieve the CL variant chars for *OR and *NOT for the specified CCSID

Parameters:
ccsid - The CCSID to lookup the variant characters for
Returns:
Character array containing the representation of the variant characters for the specified CCSID. Use the predefined contants CLVARCHARS_OR and CLVARCHARS_NOT in this class to index into this array.
See Also:
CLVARCHARS_OR, CLVARCHARS_NOT

preConversionProcess

public static List preConversionProcess(List input,
                                        int ccsid)
Preproccess the byte[] for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/preconversion/ccsidNumber.tbl table. This method is used to process an entire file at once before conversion.

Parameters:
input - The input list of source ilnes where each object in the list is an instance of byte[]. Each input should still be in EBCDIC bytes.
Returns:
The processed byte arrays.

preConversionProcess

public static byte[] preConversionProcess(byte[] input,
                                          int ccsid)
Preproccess the byte[] for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/preconversion/ccsidNumber.tbl table. This method is used to process a single line in a file at a time.

Parameters:
input - The input array of bytes for pre-conversion processing. The input array should still be the EBCDIC bytes.
ccsid - The source CCSID of the byte[]
Returns:
The processed byte array.

postConversionProcess

public static List postConversionProcess(List input,
                                         int ccsid)
Postproccess the Strings for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/postconversion/ccsidNumber.tbl table. This method is used to process an entire file at once after conversion.

Parameters:
input - The input list of source ilnes where each object in the list is an instance of String.
ccsid - The source CCSID for the converison table
Returns:
The processed Strings

postConversionProcess

public static String postConversionProcess(String input,
                                           int ccsid)
Postproccess the String for the specified CCSID, mapping source to target characters as specified in the %plugindir%/ccsidtables/plostconversion/ccsidNumber.tbl table. This method is used to process a single line in a file at a time.

Parameters:
input - The input String for post-conversion processing.
ccsid - The source CCSID for the converison table
Returns:
The processed String

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.