ariba.util.core
Class MaxEncodedString

java.lang.Object
  extended by ariba.util.core.MaxEncodedString

public final class MaxEncodedString
extends java.lang.Object


Field Summary
static int MaxByteLength
          If the first character in the value string is a space, SQLBuffer will add an additional space in front of the string.
static int MaxVC2Length
          This is the maximum length in bytes for a VARCHAR2 column that can be created on Oracle.
 
Constructor Summary
MaxEncodedString()
           
 
Method Summary
static java.nio.charset.CharsetEncoder getEncoder(java.lang.String charsetName)
           
static int getMaxLength(java.lang.String src, int srcBegin, int maxByteLength)
           
static int getMaxLength(java.lang.String src, int srcBegin, int maxByteLength, java.lang.String charsetName, java.nio.ByteBuffer byteBuff)
           
static java.lang.String getMaxLengthString(java.lang.String src, int srcBegin, int maxByteLength)
           
static java.lang.String getMaxLengthString(java.lang.String src, int srcBegin, int maxByteLength, java.lang.String charsetName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MaxVC2Length

public static final int MaxVC2Length
This is the maximum length in bytes for a VARCHAR2 column that can be created on Oracle.

See Also:
Constant Field Values

MaxByteLength

public static final int MaxByteLength
If the first character in the value string is a space, SQLBuffer will add an additional space in front of the string. We need to leave room of one byte to accommodate the additional space

See Also:
Constant Field Values
Constructor Detail

MaxEncodedString

public MaxEncodedString()
Method Detail

getMaxLength

public static int getMaxLength(java.lang.String src,
                               int srcBegin,
                               int maxByteLength,
                               java.lang.String charsetName,
                               java.nio.ByteBuffer byteBuff)
Parameters:
src -
srcBegin -
maxByteLength -
charsetName -
byteBuff - - out parameter that would hold the encoded bytes
Returns:
max length of the string that can fit in the given database limit

getMaxLength

public static int getMaxLength(java.lang.String src,
                               int srcBegin,
                               int maxByteLength)

getEncoder

public static final java.nio.charset.CharsetEncoder getEncoder(java.lang.String charsetName)

getMaxLengthString

public static java.lang.String getMaxLengthString(java.lang.String src,
                                                  int srcBegin,
                                                  int maxByteLength,
                                                  java.lang.String charsetName)
Parameters:
src -
srcBegin -
maxByteLength -
charsetName -
Returns:
the maximum string that can fit in the given database limit

getMaxLengthString

public static java.lang.String getMaxLengthString(java.lang.String src,
                                                  int srcBegin,
                                                  int maxByteLength)


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.