IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.cs.invoker.base
Class BeanInvokerFormatter

java.lang.Object
  extended bycom.ibm.btt.cs.invoker.base.BeanInvokerFormatter

public class BeanInvokerFormatter
extends java.lang.Object

Provides all Format/unFormat and Decoration APIs for C/S Connectivity usage


Field Summary
static int DEFAULT_BUFFER_SIZE
           
 
Constructor Summary
BeanInvokerFormatter()
           
 
Method Summary
 java.lang.String addCodeSetTranslator(java.lang.String requestData, java.lang.String toCodeSet)
          Modifies the strings using the specified code page.
 java.lang.String addCompressor(java.lang.String requestData)
          Compresses and decompresses the data field contents by using the Deflater and Inflater classes in the java.util.zip package.
 java.lang.String addDelimiter(java.lang.String requestData, java.lang.String delimChar)
          Appends a delimiter character after a formatted string.
 java.lang.String addFixDataLength(java.lang.String requestData, int length, java.lang.String justify, char padCharacter, boolean noEmpty)
          Adjusts a formatted string to a fixed length by either truncating it or by padding and justifying it.
 java.lang.String addIdentifier(java.lang.String requestData, char idChar)
          Prefixes or appends one character to the formatted string.
 java.lang.String addMaximumLength(java.lang.String requestData, int maxLength)
          Truncates the string if it is over the specified length.
 java.lang.Object addNullChecker(java.lang.Object requestData)
          Handles conversions between strings and data Object when either the string is an empty string or the data has a null value.
 java.lang.String formatDate(java.util.Date requestData)
          formatDate with default value
 java.lang.String formatDate(java.util.Date requestData, boolean useSeparator, java.lang.String ordering, boolean isFourDigYear, java.lang.String separator)
          Formats a Date object.
 java.lang.String formatFloat(java.lang.Object requestData)
          formatFloat with default value
 java.lang.String formatFloat(java.lang.Object requestData, int size, java.lang.String byteOrdering)
          Formats a floating point number.
 java.lang.String formatInteger(java.lang.Object requestData)
          formatInteger with default value
 java.lang.String formatInteger(java.lang.Object requestData, int size, java.lang.String byteOrdering)
          Formats an integer from one to eight bytes in size.
 java.lang.String formatNumericString(java.lang.String requestData)
          formatNumericString with default value
 java.lang.String formatNumericString(java.lang.String requestData, int decPlaces, char decimalsSepChar, char thousandsSepChar, boolean isShowDecimalsSep, boolean isShowThousandsSep, java.lang.String signRule, java.lang.String usePositiveSign)
          Formats a string of number characters.
 java.lang.String formatString(java.lang.String requestData)
          formatString with default value
 java.lang.String formatString(java.lang.String requestData, java.lang.String formatAs)
          Format the String value.
 java.lang.String formatTime(java.util.Date requestData)
          formatTime with default value
 java.lang.String formatTime(java.util.Date requestData, boolean useSeparator, java.lang.String hours, boolean isShowSeconds, java.lang.String separator, java.lang.String amString, java.lang.String pmString)
          Formats a time in the Date object.
 TypedDataConverter getTypedDataConverter()
           
 java.lang.String removeCodeSetTranslator(java.lang.String requestData, java.lang.String toCodeSet)
          Remove code set
 java.lang.String removeCompressor(java.lang.String requestData)
          Remove Compressor
 java.lang.String removeCompressor(java.lang.String requestData, int intArray)
          Returns the uncompressed String resulting from aString.
 java.lang.String removeDelimiter(java.lang.String requestData, java.lang.String delimiter)
          Remove a delimiter at the end
 java.lang.String removeFixDataLength(java.lang.String requestData, int length, java.lang.String justify, char padCharacter, boolean noEmpty)
          Remoe fix data length
 java.lang.String removeIdentifier(java.lang.String requestData, char idChar)
          Remove a Identifier
 java.util.Date unformatDate(java.lang.String requestData)
          unformatDate with default value
 java.util.Date unformatDate(java.lang.String requestData, boolean useSeparator, java.lang.String ordering, boolean isFourDigYear, java.lang.String separator)
          unFormats a Date object.
 java.lang.Object unformatFloat(java.lang.String requestData)
          unformatFloat with default value
 java.lang.Object unformatFloat(java.lang.String requestData, int size, java.lang.String byteOrdering)
          unFormats a floating point number.
 java.lang.Object unformatInteger(java.lang.String requestData)
          unformatInteger with default value
 java.lang.Object unformatInteger(java.lang.String requestData, int size, java.lang.String byteOrdering, boolean signRule)
          unformats an integer from one to eight bytes in size
 java.lang.Number unformatNumericString(java.lang.String requestData)
          unformatNumericString with default value
 java.lang.Number unformatNumericString(java.lang.String requestData, int decPlaces, char decimalsSepChar, char thousandsSepChar, boolean isShowDecimalsSep)
          unFormats a string of number characters.
 java.lang.String unformatString(java.lang.String requestData)
          unformatString with default value
 java.lang.String unformatString(java.lang.String requestData, java.lang.String unformatAs)
          unFormat the String value.
 java.util.Date unformatTime(java.lang.String requestData)
          unformatTime with default value
 java.util.Date unformatTime(java.lang.String requestData, boolean useSeparator, java.lang.String hours, boolean isShowSeconds, java.lang.String separator, java.lang.String amString, java.lang.String pmString)
          unFormats a time in the Date object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

BeanInvokerFormatter

public BeanInvokerFormatter()
Method Detail

formatString

public java.lang.String formatString(java.lang.String requestData,
                                     java.lang.String formatAs)
                              throws DSEInvalidArgumentException
Format the String value. You can set attributes so that the formatter returns the string with all upper case letters, all lower case letters, or unchanged.
For example, a StringFormat has the following attributes set: formatAs="uppercase" / "lowercase"

Parameters:
requestData - Data needs to be format
formatAs - "uppercase" or "lowercase" or "null(default)"
Returns:
String formatted data
Throws:
DSEInvalidArgumentException

formatString

public java.lang.String formatString(java.lang.String requestData)
                              throws DSEInvalidArgumentException
formatString with default value

Parameters:
requestData - formatted request data
Returns:
String
Throws:
DSEInvalidArgumentException

unformatString

public java.lang.String unformatString(java.lang.String requestData,
                                       java.lang.String unformatAs)
                                throws DSEInvalidArgumentException
unFormat the String value. You can set attributes so that the formatter returns the string with all upper case letters, all lower case letters, or unchanged.
For example, a StringFormat has the following attributes set: formatAs="uppercase" / "lowercase"

Parameters:
requestData - Data needs to be format
unformatAs - "uppercase" or "lowercase" or "null(default)"
Returns:
String unformatted data
Throws:
DSEInvalidArgumentException

unformatString

public java.lang.String unformatString(java.lang.String requestData)
                                throws DSEInvalidArgumentException
unformatString with default value

Parameters:
requestData - formatted request data
Returns:
String
Throws:
DSEInvalidArgumentException

formatInteger

public java.lang.String formatInteger(java.lang.Object requestData,
                                      int size,
                                      java.lang.String byteOrdering)
                               throws DSEInvalidArgumentException
Formats an integer from one to eight bytes in size. The format method format the value with a:
  • 1: Byte object if the number is one byte in size.
  • 2: Short object if the number is two bytes in size.
  • 3: Integer object if the number is three or four bytes in size.
  • 4: Long object if the number is five to eight bytes insize.

  • You can set attributes so that the formatter returns the data field with or without sign and in big-endian (host) or little-endian (PC) byte ordering.
    For example, a IntegerFormat has the following attributes set:
  • size="4"
  • signRule="yes"
  • byteOrdering="pc"
  • an integer value of: -1024 The format method returns the following string: "00 FC FF FF" (hexadecimal values)

    Parameters:
    requestData - Data needs to be format
    size - The size of the float. The size of the integer. The valid values are:
  • char (1 byte)
  • short (2 bytes)
  • 3 (3 bytes)
  • int (4 bytes) (default)
  • 5 (5 bytes)
  • 6 (6 bytes)
  • 7 (7 bytes)
  • long (8 bytes) The valid values are float (for 4 bytes) and double (for 8 bytes). The default value is double.
  • byteOrdering - The byte ordering of the float. The valid values are pc (for little-endian) and host (for big-endian). The default value is pc.
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    formatInteger

    public java.lang.String formatInteger(java.lang.Object requestData)
                                   throws DSEInvalidArgumentException
    formatInteger with default value

    Throws:
    DSEInvalidArgumentException

    unformatInteger

    public java.lang.Object unformatInteger(java.lang.String requestData,
                                            int size,
                                            java.lang.String byteOrdering,
                                            boolean signRule)
                                     throws DSEInvalidArgumentException
    unformats an integer from one to eight bytes in size

    Parameters:
    requestData - Data needs to be format
    size - The size of the float. The size of the integer. The valid values are:
  • char (1 byte)
  • short (2 bytes)
  • 3 (3 bytes)
  • int (4 bytes) (default)
  • 5 (5 bytes)
  • 6 (6 bytes)
  • 7 (7 bytes)
  • long (8 bytes) The valid values are float (for 4 bytes) and double (for 8 bytes). The default value is double.
  • byteOrdering - The byte ordering of the float. The valid values are pc (for little-endian) and host (for big-endian). The default value is pc.
    signRule - A boolean that indicates whether the integer uses a sign. The default value is no.
    Returns:
    Object unformatted data
    Throws:
    DSEInvalidArgumentException

    unformatInteger

    public java.lang.Object unformatInteger(java.lang.String requestData)
                                     throws DSEInvalidArgumentException
    unformatInteger with default value

    Throws:
    DSEInvalidArgumentException

    formatNumericString

    public java.lang.String formatNumericString(java.lang.String requestData,
                                                int decPlaces,
                                                char decimalsSepChar,
                                                char thousandsSepChar,
                                                boolean isShowDecimalsSep,
                                                boolean isShowThousandsSep,
                                                java.lang.String signRule,
                                                java.lang.String usePositiveSign)
                                         throws DSEInvalidArgumentException
    Formats a string of number characters.
    You can set attributes so that the formatter returns the value with or without decimals, with or without a thousands separator, and with or without sign representation. You can also specify the number of decimal places and the characters to use for decimal separation, the thousands separator, and the sign representation.
    For example, a NumericStringFormat has the following attributes set:
  • decPlaces="2"
  • decimalSepChar="."
  • thousandsSepChar=","
  • signRule="prefix"

  • A requestData with a string value of: "12345678.9" The format method returns the following string: "1,234,568.90"

    Parameters:
    requestData - Data needs to be format
    decPlaces - The number of positions to the right of decimal. The default value is 0.
    decimalsSepChar - The character used as the decimal separator. The default is provided by the java.text.DecimalFormat class.
    thousandsSepChar - The character used as the thousands separator. The default is provided by the java.text.DecimalFormat class.
    isShowDecimalsSep - A boolean that indicates whether the string uses the decimal separator. The default value is yes.
    isShowThousandsSep - A boolean that indicates whether the string uses the thousands separator. The default value is yes.
    signRule - The rule used to display the sign. The valid values are:
  • prefix (default)
  • suffix
  • parenthesis
  • usePositiveSign - The representation of the positive sign. The valid values are:
  • no (for nothing) (default)
  • yes (+)
  • blank
  • Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    formatNumericString

    public java.lang.String formatNumericString(java.lang.String requestData)
                                         throws DSEInvalidArgumentException
    formatNumericString with default value

    Throws:
    DSEInvalidArgumentException

    unformatNumericString

    public java.lang.Number unformatNumericString(java.lang.String requestData,
                                                  int decPlaces,
                                                  char decimalsSepChar,
                                                  char thousandsSepChar,
                                                  boolean isShowDecimalsSep)
                                           throws DSEInvalidArgumentException
    unFormats a string of number characters.

    Parameters:
    requestData - String needs to be unformat
    decPlaces - The number of positions to the right of decimal. The default value is 0.
    decimalsSepChar - The character used as the decimal separator. The default is provided by the java.text.DecimalFormat class.
    thousandsSepChar - The character used as the thousands separator. The default is provided by the java.text.DecimalFormat class.
    isShowDecimalsSep - A boolean that indicates whether the string uses the decimal separator. The default value is yes.
    Returns:
    Number unformatted data
    Throws:
    DSEInvalidArgumentException

    unformatNumericString

    public java.lang.Number unformatNumericString(java.lang.String requestData)
                                           throws DSEInvalidArgumentException
    unformatNumericString with default value

    Throws:
    DSEInvalidArgumentException

    formatFloat

    public java.lang.String formatFloat(java.lang.Object requestData,
                                        int size,
                                        java.lang.String byteOrdering)
                                 throws DSEInvalidArgumentException
    Formats a floating point number. The size of its representation is float (4 bytes) or double precision (8 bytes). You can set attributes so that the formatter returns the value with big-endian (host) or little-endian (PC) byte ordering.
    For example, a formatFloat has the following attributes set:
  • size="double"
  • byteOrdering="pc"
  • a float value of: -1024.5 The format method returns the following string: "00 00 00 00 00 02 90 C0" (hexadecimal values)

    Parameters:
    requestData - Data needs to be format
    size - The size of the float. The size of the integer. The valid values are:
  • char (1 byte)
  • short (2 bytes)
  • 3 (3 bytes)
  • int (4 bytes) (default)
  • 5 (5 bytes)
  • 6 (6 bytes)
  • 7 (7 bytes)
  • long (8 bytes) The valid values are float (for 4 bytes) and double (for 8 bytes). The default value is double.
  • byteOrdering - The byte ordering of the float. The valid values are pc (for little-endian) and host (for big-endian). The default value is pc.
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    formatFloat

    public java.lang.String formatFloat(java.lang.Object requestData)
                                 throws DSEInvalidArgumentException
    formatFloat with default value

    Throws:
    DSEInvalidArgumentException

    unformatFloat

    public java.lang.Object unformatFloat(java.lang.String requestData,
                                          int size,
                                          java.lang.String byteOrdering)
                                   throws DSEInvalidArgumentException
    unFormats a floating point number.

    Parameters:
    requestData - Data needs to be format
    size - The size of the float. The size of the integer. The valid values are:
  • char (1 byte)
  • short (2 bytes)
  • 3 (3 bytes)
  • int (4 bytes) (default)
  • 5 (5 bytes)
  • 6 (6 bytes)
  • 7 (7 bytes)
  • long (8 bytes) The valid values are float (for 4 bytes) and double (for 8 bytes). The default value is double.
  • Returns:
    Object unformatted data (Float or Double)
    Throws:
    DSEInvalidArgumentException

    unformatFloat

    public java.lang.Object unformatFloat(java.lang.String requestData)
                                   throws DSEInvalidArgumentException
    unformatFloat with default value

    Throws:
    DSEInvalidArgumentException

    formatDate

    public java.lang.String formatDate(java.util.Date requestData,
                                       boolean useSeparator,
                                       java.lang.String ordering,
                                       boolean isFourDigYear,
                                       java.lang.String separator)
                                throws DSEInvalidArgumentException
    Formats a Date object. You can set attributes so that the formatter returns the value with or without a separator, the year with either two or four digits, and a specific day-month-year ordering. You can also specify the separator character.
    For example, a formatDate has the following attributes set:
  • fourDigYear="yes"
  • ordering="mdy"
  • sep="/"

  • A value with a Date object value of: Fri Apr 24 10:00:00 GMT+03:00 1998
    The format method returns the following string: "04/24/1998"
    Note that the string representation of the Date object retains the time information even though the string returned by format does not.

    Parameters:
    requestData - Data needs to be format
    useSeparator - A boolean that indicates whether the date uses the separator character. The default value is yes.
    ordering - The order in which the elements of a date appear. The valid values are:
  • dmy (default)
  • mdy
  • ymd
  • isFourDigYear - A boolean that indicates whether the formatter uses four digits to represent the year. The default value is no.
    separator - The character used to separate day, month, and year characters. The default value is the forward slash (/).
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    formatDate

    public java.lang.String formatDate(java.util.Date requestData)
                                throws DSEInvalidArgumentException
    formatDate with default value

    Throws:
    DSEInvalidArgumentException

    unformatDate

    public java.util.Date unformatDate(java.lang.String requestData,
                                       boolean useSeparator,
                                       java.lang.String ordering,
                                       boolean isFourDigYear,
                                       java.lang.String separator)
                                throws DSEInvalidArgumentException
    unFormats a Date object.

    Parameters:
    requestData - Data needs to be format
    useSeparator - A boolean that indicates whether the date uses the separator character. The default value is yes.
    ordering - The order in which the elements of a date appear. The valid values are:
  • dmy (default)
  • mdy
  • ymd
  • isFourDigYear - A boolean that indicates whether the formatter uses four digits to represent the year. The default value is no.
    separator - The character used to separate day, month, and year characters. The default value is the forward slash (/).
    Returns:
    Date unformatted data
    Throws:
    DSEInvalidArgumentException

    unformatDate

    public java.util.Date unformatDate(java.lang.String requestData)
                                throws DSEInvalidArgumentException
    unformatDate with default value

    Throws:
    DSEInvalidArgumentException

    formatTime

    public java.lang.String formatTime(java.util.Date requestData,
                                       boolean useSeparator,
                                       java.lang.String hours,
                                       boolean isShowSeconds,
                                       java.lang.String separator,
                                       java.lang.String amString,
                                       java.lang.String pmString)
                                throws DSEInvalidArgumentException
    Formats a time in the Date object. You can set attributes so the formatter returns the value with or without a separator, return the time in 12 or 24 hour format, and return the time with or without seconds. You can also specify the separator character and the strings to represent AM and PM.
    For example, a formatTime has the following attributes set:
  • hrs="12"
  • amString="a.m."
  • pmString="p.m."
  • useSep="yes"
  • sep=":"

  • A Date object value of: Fri Apr 24 10:00:00 GMT+03:00 1998 The format method returns the following string: "06:05:00 p.m."
    Note that the string representation of the Date object retains the date information even though the string returned by format does not.

    Parameters:
    requestData - Data needs to be format
    useSeparator - A boolean that indicates whether the time uses the separator character. The default value is yes.
    hours - The type of clock. The valid values are: 12 (12 hours) 24 (24 hours) (default)
    isShowSeconds - A boolean that indicates whether the time shows seconds. The default value is yes.
    separator - The character used to separate day, month, and year characters. The default value is the forward slash (/).
    amString - The String used to indicate morning. The default value is am.
    pmString - The String used to indicate afternoon. The default value is pm.
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    formatTime

    public java.lang.String formatTime(java.util.Date requestData)
                                throws DSEInvalidArgumentException
    formatTime with default value

    Throws:
    DSEInvalidArgumentException

    unformatTime

    public java.util.Date unformatTime(java.lang.String requestData,
                                       boolean useSeparator,
                                       java.lang.String hours,
                                       boolean isShowSeconds,
                                       java.lang.String separator,
                                       java.lang.String amString,
                                       java.lang.String pmString)
                                throws DSEInvalidArgumentException
    unFormats a time in the Date object.

    Parameters:
    requestData - Data needs to be format
    useSeparator - A boolean that indicates whether the time uses the separator character. The default value is yes.
    hours - The type of clock. The valid values are:
  • 12 (12 hours)
  • 24 (24 hours) (default)
  • isShowSeconds - A boolean that indicates whether the time shows seconds. The default value is yes.
    separator - The character used to separate day, month, and year characters. The default value is the forward slash (/).
    amString - The String used to indicate morning. The default value is am.
    pmString - The String used to indicate afternoon. The default value is pm.
    Returns:
    Date unformatted data
    Throws:
    DSEInvalidArgumentException

    unformatTime

    public java.util.Date unformatTime(java.lang.String requestData)
                                throws DSEInvalidArgumentException
    unformatTime with default value

    Throws:
    DSEInvalidArgumentException

    addDelimiter

    public java.lang.String addDelimiter(java.lang.String requestData,
                                         java.lang.String delimChar)
                                  throws DSEInvalidArgumentException
    Appends a delimiter character after a formatted string.
    For example, a Delimiter decorator has the following attributes set:
  • delimChar="@"
  • a string value of: "this is a string"
    The decorated string is: "this is a string@"
    The undecorated string is "this is a string"

    Parameters:
    requestData - Data needs to be format
    delimChar - The character to use as the delimiter. The default value is "+".
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    removeDelimiter

    public java.lang.String removeDelimiter(java.lang.String requestData,
                                            java.lang.String delimiter)
    Remove a delimiter at the end

    Parameters:
    requestData - Data needs to be format
    delimiter - The character to use as the delimiter. The default value is "+".
    Returns:
    String unformatted data

    addIdentifier

    public java.lang.String addIdentifier(java.lang.String requestData,
                                          char idChar)
                                   throws DSEInvalidArgumentException
    Prefixes or appends one character to the formatted string.
    For example, an Identifier decorator has the following attributes set:
  • idChar="#"
  • a string value of: "this is a string"
    The decorated string is: "#this is a string"
    The undecorated string is "this is a string"

    Parameters:
    requestData - Data needs to be format
    idChar - The identifier for the element.
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    removeIdentifier

    public java.lang.String removeIdentifier(java.lang.String requestData,
                                             char idChar)
                                      throws DSEInvalidArgumentException
    Remove a Identifier

    Parameters:
    requestData -
    idChar -
    Returns:
    removeIdentifier
    Throws:
    DSEInvalidArgumentException

    addCompressor

    public java.lang.String addCompressor(java.lang.String requestData)
                                   throws DSEInvalidArgumentException
    Compresses and decompresses the data field contents by using the Deflater and Inflater classes in the java.util.zip package.

    Parameters:
    requestData - Data needs to be format
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    removeCompressor

    public java.lang.String removeCompressor(java.lang.String requestData)
                                      throws DSEInvalidArgumentException
    Remove Compressor

    Parameters:
    requestData -
    Returns:
    String
    Throws:
    DSEInvalidArgumentException

    removeCompressor

    public java.lang.String removeCompressor(java.lang.String requestData,
                                             int intArray)
                                      throws DSEInvalidArgumentException
    Returns the uncompressed String resulting from aString.

    Parameters:
    requestData -
    intArray -
    Returns:
    java.lang.String
    Throws:
    DSEInvalidArgumentException - - The exception description

    addFixDataLength

    public java.lang.String addFixDataLength(java.lang.String requestData,
                                             int length,
                                             java.lang.String justify,
                                             char padCharacter,
                                             boolean noEmpty)
                                      throws DSEInvalidArgumentException
    Adjusts a formatted string to a fixed length by either truncating it or by padding and justifying it. If the String is too long, this method truncates it. If the String is too short, this method justifies the String according to the justify attribute and then pads it using the character specified by the padCharacter attribute.
    For example, a FixedLength decorator has the following attributes set:
  • length="20"
  • justify="left"
  • padChar="#"

  • a string value of: "this is a string"
    The decorated string is: "this is a string####"
    The undecorated string is "this is a string"

    Parameters:
    requestData - Data needs to be format
    length - The length of the string after the decoration is applied.
    justify - The justification to be applied to the string:
  • right
  • left (default)
  • center
  • padCharacter - The character to use to pad the string so that it has the specified length.
    noEmpty - A boolean that indicates whether to return the pad character when the resulting string is empty after applying the decorator. The default value is no.
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    removeFixDataLength

    public java.lang.String removeFixDataLength(java.lang.String requestData,
                                                int length,
                                                java.lang.String justify,
                                                char padCharacter,
                                                boolean noEmpty)
                                         throws DSEInvalidArgumentException
    Remoe fix data length

    Parameters:
    requestData -
    length -
    justify -
    padCharacter -
    noEmpty -
    Returns:
    String
    Throws:
    DSEInvalidArgumentException

    addMaximumLength

    public java.lang.String addMaximumLength(java.lang.String requestData,
                                             int maxLength)
                                      throws DSEInvalidArgumentException
    Truncates the string if it is over the specified length. If the string is under the specified length, the decorator does not modify it.
    For example, a MaximumLength decorator has the following attributes set:
  • length="12"

  • a string value of: "this is a string"
    The decorated string is: "this is a st"
    The undecorated string is "this is a st"

    Parameters:
    requestData - Data needs to be format
    maxLength - The length of the string after the decoration is applied.
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    addCodeSetTranslator

    public java.lang.String addCodeSetTranslator(java.lang.String requestData,
                                                 java.lang.String toCodeSet)
                                          throws DSEInvalidArgumentException
    Modifies the strings using the specified code page.
    For example, a CodeSetTranslater decorator has the following attributes set:
  • to="Cp037"

  • a string value of: "12345"
    The decorated string is: "F1 F2 F3 F4 F5"
    The undecorated string is "12345"

    Parameters:
    requestData - Data needs to be format
    toCodeSet - The value of the code page. The default value is "Cp037".
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    removeCodeSetTranslator

    public java.lang.String removeCodeSetTranslator(java.lang.String requestData,
                                                    java.lang.String toCodeSet)
                                             throws DSEInvalidArgumentException
    Remove code set

    Parameters:
    requestData -
    toCodeSet -
    Returns:
    String
    Throws:
    DSEInvalidArgumentException

    addNullChecker

    public java.lang.Object addNullChecker(java.lang.Object requestData)
                                    throws DSEInvalidArgumentException
    Handles conversions between strings and data Object when either the string is an empty string or the data has a null value. Because it does not throw an exception, apply this formatter on data and strings when you do not know whether they will be empty or not.
    For example, when the NullChecker unformats an empty string, the value, it returns is null. When the NullChecker formats a data with a null value, the NullChecker returns an empty string. If the string is a non-empty string or the data has a value, the NullChecker does nothing.
    Typically, another formatter or decorator in the conversion process performs the conversion of non-empty strings and data that have a value. If this decorator is being applied in conjunction with other formatters, this decorator must be the first formatter applied.

    Parameters:
    requestData - Data needs to be format
    Returns:
    String formatted data
    Throws:
    DSEInvalidArgumentException

    getTypedDataConverter

    public TypedDataConverter getTypedDataConverter()

    IBM Branch Transformation Toolkit Javadoc

    (c) Copyright IBM Corporation 1998, 2005