public class StringUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ASIS
Constant for "concat" methods, leave string in original case
|
static java.lang.String |
COPYRIGHT |
static int |
LOWERCASE
Constant for "concat" methods, convert string to lower case
|
static int |
UPPERCASE
Constant for "concat" methods, convert string to upper case
|
static java.lang.String |
VERSION |
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
center(java.lang.String in,
int length)
center a string in a given length
|
static boolean |
compareStringsHandleNulls(java.lang.String lhs,
java.lang.String rhs) |
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5,
java.lang.Object arg6)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5,
java.lang.Object arg6,
java.lang.Object arg7)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5,
java.lang.Object arg6,
java.lang.Object arg7,
java.lang.Object arg8)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5,
java.lang.Object arg6,
java.lang.Object arg7,
java.lang.Object arg8,
java.lang.Object arg9)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
concat(int aCase,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5,
java.lang.Object arg6,
java.lang.Object arg7,
java.lang.Object arg8,
java.lang.Object arg9,
java.lang.Object arg10)
Concatenates strings (or Object.toString() equivalents) using StringBufferFactory
for intermediate storage.
|
static java.lang.String |
crossScriptingFilter(java.lang.String aBuf)
Converts the special characters into html entities for the given string
|
static java.lang.String |
decodeCrossOSString(java.lang.String s)
Decodes a string into into its original chars based on the encoded,
UTF-8 legal, cross-OS string.
|
static java.lang.String |
decodeURL(java.lang.String s)
Decodes a
application/x-www-form-urlencoded string using the UTF-8
encoding scheme. |
static java.lang.String |
encodeCrossOSString(java.lang.String s)
Encodes a string into a legal cross-OS string.
|
static java.lang.String |
encodeURL(java.lang.String strParameterValue)
Translates a string into
application/x-www-form-urlencoded
format using the UTF-8 encoding scheme. |
static java.lang.String |
escapeCrossScriptingFilter(java.lang.String aBuf)
Converts the special characters into html entities also appends escape character for single quote and
double quote for the given string
|
static java.lang.String |
escapeForExpression(java.lang.String value) |
static java.lang.String |
escapeIntoJavaString(java.lang.String aInput)
Given an input string, convert it into something we could embed in Java
source.
|
static java.lang.String |
escapeIntoJSONString(java.lang.String aInput)
Given an input string, convert it into a valid JSON string.
|
static java.lang.String |
filterRichText(java.lang.String html) |
static java.lang.String |
fitRight(java.lang.String in,
int length)
Fit a string to specified length padding the right or truncating as necessary.
|
static java.lang.String |
fitRight(java.lang.String in,
int length,
char padChar)
Fit a string to specified length padding the right or truncating as necessary.
|
static byte[] |
fromHexString(java.lang.String in)
Convert string of hex to a byte array
|
static java.lang.String |
fromPackedDecimal(byte[] packedDecimal)
Convert a byte array encoded as packed decimal data(COMP-3) to the string equivalent.
|
static java.lang.String |
fromPackedDecimal(byte[] packedDecimal,
int decimals)
Convert a byte array encoded as packed decimal data(COMP-3) to the string equivalent.
|
static java.lang.String |
fromZonedDecimal(byte[] zonedDecimal,
int decimals)
Convert a byte array encoded as zoned decimal data(DISPLAY) to the string equivalent.
|
static java.lang.String |
getPackageQualifier(ClassDefinition aClass) |
static int |
indexOf(char[] aSource,
int aSourceStart,
int aSourceLength,
java.lang.String aToBeFound)
Locate a substring within a character array
|
static int |
indexOf(java.lang.StringBuffer s,
char c,
int p)
String.indexOf - like function that works with StringBuffers and works in jdk 1.3.x
|
static int |
indexOf(java.lang.StringBuilder s,
char c,
int p)
String.indexOf - like function that works with StringBuilder and works in jdk 1.3.x
|
static int |
indexOfEsc(java.lang.StringBuffer s,
char c,
int p)
String.indexOf - like function that respects back-slash escaping of the
searched-for character and works in jdk 1.3.x with StringBuffers
|
static int |
indexOfEsc(java.lang.String s,
char c,
int p)
String.indexOf - like function that respects back-slash escaping of the
searched-for character
|
static void |
insertInteger(java.lang.StringBuffer aTarget,
int aAtPosition,
int aIntValue) |
static void |
insertInteger(java.lang.StringBuilder aTarget,
int aAtPosition,
int aIntValue) |
static boolean |
interpretBoolean(java.lang.String aOpt)
Interprets a String value as a boolean, satisfying javascript and generic conventions.
|
static boolean |
isBlank(java.lang.String aString)
Returns true if the string is null or has a size equal to zero.
|
static java.lang.String |
packString(java.lang.String input)
Convert escape sequences to individual characters.
|
static java.lang.String |
padLeft(java.lang.String in,
int length)
Pad a string on the left with spaces until it has length specified.
|
static java.lang.String |
padLeft(java.lang.String in,
int length,
char padChar)
Pad a string on left with specified pad character so it has specified length.
|
static java.lang.String |
padRight(java.lang.String in,
int length)
Pad a string on the right with spaces until it has length specified.
|
static java.lang.String |
padRight(java.lang.String in,
int length,
char padChar)
Pad a string on right with specified pad character so it has specified length.
|
static char[] |
pageNameClean(char[] in)
Changes invalid pageName characters to the under-bar char.
|
static char[] |
pageNameClean(java.lang.String in) |
static int |
parseInt(int radix,
java.lang.String s,
int start,
int end)
Similar to String.parseInt(String s, int radix) but allows specification of the segment
of the string that should be parsed.
|
static java.util.Map |
parseQueryString(java.lang.String aQS)
Parse a query string, creating a map of name=value pairs
26-Nov-02 olsok -- substituting algorithm from Tomcat 4.0.4 to more correctly deal with %hh escapes and character set encodings. |
static void |
parseURLParameters(java.util.Map map,
byte[] data,
int useLen,
java.lang.String encoding)
26-Nov-02 OLSOK -- adapted parseParameters from Tomcat 4.0.4 and merged
with PegaRULES heuristics (dealing with '&' entities in query strings)
in order to get internationalization logic correct and plausible...
|
static void |
parseURLParameters(java.util.Map map,
byte[] data,
java.lang.String encoding)
parse the full byte array as a URL-encoded string
|
static void |
parseURLParameters(java.util.Map map,
java.lang.String data,
java.lang.String encoding)
Append request parameters from the specified String to the specified
Map.
|
static java.lang.String |
quote(java.lang.String inputStr) |
static java.lang.String |
quoteAndEscape(java.lang.String aOriginalString)
This method will completely quote a string, converting existing double quotes to single quotes if necessary.
|
static java.lang.String |
quoteNullIsEmptyString(java.lang.String aInputStr)
Wrap a string in quotes
|
static java.lang.StringBuffer |
replace(java.lang.StringBuffer buf,
char oldChar,
char newChar)
Similar to String.replace(oldChar, newChar) but operates on StringBuffer
|
static java.lang.StringBuilder |
replace(java.lang.StringBuilder buf,
char oldChar,
char newChar)
Similar to String.replace(oldChar, newChar) but operates on StringBuilder
|
static java.lang.String |
replaceAll(java.lang.String aBaseString,
java.lang.String aOriginalChars,
java.lang.String aNewChars)
Method replaceAll replaces the specified string..
|
static java.lang.String |
replaceAll(java.lang.String aBaseString,
java.lang.String aOriginalChars,
java.lang.String aNewChars,
boolean aReplaceAssign)
Method replaceAll replaces the specified string..
|
static java.lang.String |
restoreFilteredString(java.lang.String aBuf)
restore a cross site scripting filtered string to its original form
|
static java.lang.String |
reversibleCrossScriptingFilter(java.lang.String aBuf)
filter a string for cross site scripting characters
and add a prefix to allow for filtering to be reversed
|
static boolean |
startsWith(java.lang.CharSequence aSequenceToCheck,
java.lang.String aLookingFor) |
static java.lang.String |
stripQuotes(java.lang.String aString)
Strip quotes from the specified string.
|
static java.lang.String |
toHexString(byte[] in)
Convert byte array to a string of hex.
|
static java.lang.String |
toLowerCase(java.util.Locale aLocale,
java.lang.String aBuf)
Lowercase the specified String.
|
static java.lang.String |
toLowerCase(java.util.Locale aLocale,
java.lang.StringBuffer aBuf,
int start,
int limit)
Lowercase the specified segment of the StringBuffer
|
static java.lang.String |
toLowerCase(java.util.Locale aLocale,
java.lang.StringBuilder aBuf,
int start,
int limit)
Lowercase the specified segment of the StringBuilder
|
static java.lang.String |
toLowerCase(java.util.Locale aLocale,
java.lang.String aBuf,
int start,
int limit)
Lowercase the specified segment of the String
|
static byte[] |
toPackedDecimal(java.lang.String aPackedString,
boolean isSigned,
int digits,
int decimals)
Convert a string to byte array encoded as packed decimal data(COMP-3).
|
static java.lang.String |
toProperCase(java.lang.String aString)
Convert the input text to proper case.
|
static java.lang.String |
toUpperCase(java.util.Locale aLocale,
java.lang.String aBuf)
Uppercase the specified String.
|
static java.lang.String |
toUpperCase(java.util.Locale aLocale,
java.lang.StringBuffer aBuf,
int start,
int limit)
Uppercase the specified segment of the StringBuffer
|
static java.lang.String |
toUpperCase(java.util.Locale aLocale,
java.lang.StringBuilder aBuf,
int start,
int limit)
Uppercase the specified segment of the StringBuilder
|
static java.lang.String |
toUpperCase(java.util.Locale aLocale,
java.lang.String aBuf,
int start,
int limit)
Uppercase the specified segment of the String.
|
static byte[] |
toZonedDecimal(java.lang.String aZonedString,
boolean isSigned,
int digits,
int decimals)
Convert a string to byte array encoded as zoned decimal data(DISPLAY).
|
static java.lang.String |
unquote(java.lang.String input) |
static char[] |
urlClean(char[] in)
Changes invalid URL characters to the under-bar char.
|
static char[] |
urlClean(java.lang.String in) |
static char[] |
urlClean(java.lang.StringBuffer in) |
static char[] |
urlClean(java.lang.StringBuilder in) |
static java.lang.String |
urlCrossScriptingFilter(java.lang.String aBuf)
Converts the special characters into url encoded values for the given string
|
static void |
writeEscapedCSVEntry(java.lang.String aString,
java.io.PrintWriter aWriter)
Writes a single field of information about a class to a
comma-separated-value (CSV) file, escaping characters as necessary.
|
static java.lang.String |
xlateBytesToString(byte[] aData,
int useLen,
java.lang.String encoding)
Translate byte array using the specified character encoding
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String VERSION
public static final int ASIS
public static final int UPPERCASE
public static final int LOWERCASE
public static java.lang.String reversibleCrossScriptingFilter(java.lang.String aBuf)
aBuf
- the source stringpublic static final java.lang.String urlCrossScriptingFilter(java.lang.String aBuf)
aBuf
- the source stringpublic static java.lang.String restoreFilteredString(java.lang.String aBuf)
aBuf
- the source stringpublic static java.lang.String packString(java.lang.String input) throws PRException
This is useful for accepting user input of the form "\r\n" and you want to turn it into the character equivalent.
input
- stringPRException
public static byte[] toPackedDecimal(java.lang.String aPackedString, boolean isSigned, int digits, int decimals)
aPackedString
- string containing decimal value.isSigned
- whether produce signed value or notdigits
- number of digits in the whole part of the numberdecimals
- the number of implied decimal places.public static java.lang.String fromZonedDecimal(byte[] zonedDecimal, int decimals)
zonedDecimal
- byte array containing packed decimal value.decimals
- the number of implied decimal places.public static byte[] toZonedDecimal(java.lang.String aZonedString, boolean isSigned, int digits, int decimals)
aZonedString
- string containing decimal value.isSigned
- whether produce signed value or notdigits
- number of digits in the whole part of the numberdecimals
- the number of implied decimal places.public static java.lang.String fromPackedDecimal(byte[] packedDecimal)
packedDecimal
- byte array containing packed decimal value.public static java.lang.String fromPackedDecimal(byte[] packedDecimal, int decimals)
packedDecimal
- byte array containing packed decimal value.decimals
- the number of implied decimal places.public static java.lang.String padLeft(java.lang.String in, int length)
in
- the string to padlength
- length to pad topublic static java.lang.String padLeft(java.lang.String in, int length, char padChar)
String will not be truncated if it is longer than specified length. null string will cause a new string to be allocated and padded to the specified length.
in
- string to padlength
- desired length of stringpadChar
- character to fill lengthpublic static java.lang.String padRight(java.lang.String in, int length)
in
- the string to padlength
- length to pad topublic static java.lang.String padRight(java.lang.String in, int length, char padChar)
String will not be truncated if it is longer than specified length. null string will cause a new string to be allocated and padded to the specified length.
in
- string to padlength
- desired length of stringpadChar
- character to fill lengthpublic static java.lang.String center(java.lang.String in, int length)
in
- length
- public static java.lang.String fitRight(java.lang.String in, int length)
String will be truncated or padded as needed.
in
- string to fitlength
- desired length of stringpublic static java.lang.String fitRight(java.lang.String in, int length, char padChar)
String will be truncated or padded as needed.
in
- string to fitlength
- desired length of stringpadChar
- character used to padpublic static char[] urlClean(java.lang.String in)
in
- StringBuffer to cleanurlClean(char[])
public static char[] urlClean(java.lang.StringBuffer in)
in
- StringBuffer to cleanurlClean(char[])
public static char[] urlClean(java.lang.StringBuilder in)
in
- StringBuilder to cleanurlClean(char[])
public static char[] urlClean(char[] in)
in
- char array to changepublic static char[] pageNameClean(java.lang.String in)
in
- String to cleanpageNameClean(char[])
public static char[] pageNameClean(char[] in)
in
- char array to changepublic static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg2 Objects whose string values should be concatenatedarg2
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg3 Objects whose string values should be concatenatedarg2
- arg3
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg4 Objects whose string values should be concatenatedarg2
- arg3
- arg4
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg5 Objects whose string values should be concatenatedarg2
- arg3
- arg4
- arg5
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg6 Objects whose string values should be concatenatedarg2
- arg3
- arg4
- arg5
- arg6
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg7 Objects whose string values should be concatenatedarg2
- arg3
- arg4
- arg5
- arg6
- arg7
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg8 Objects whose string values should be concatenatedarg2
- arg3
- arg4
- arg5
- arg6
- arg7
- arg8
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg9 Objects whose string values should be concatenatedarg2
- arg3
- arg4
- arg5
- arg6
- arg7
- arg8
- arg9
- public static java.lang.String concat(int aCase, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10)
aCase
- - ASIS, UPPERCASE, LOWERCASEarg1
- .. arg10 Objects whose string values should be concatenatedarg2
- arg3
- arg4
- arg5
- arg6
- arg7
- arg8
- arg9
- arg10
- public static java.lang.String toLowerCase(java.util.Locale aLocale, java.lang.String aBuf)
aLocale
- locale to use or null
for default localeaBuf
- String to lowecasepublic static java.lang.String toLowerCase(java.util.Locale aLocale, java.lang.String aBuf, int start, int limit)
aLocale
- locale to use or null
for default localeaBuf
- String to lowercasestart
- limit
- public static java.lang.String toLowerCase(java.util.Locale aLocale, java.lang.StringBuffer aBuf, int start, int limit)
aLocale
- locale to use or null
for default localeaBuf
- String Buffer to lowercasestart
- limit
- public static java.lang.String toLowerCase(java.util.Locale aLocale, java.lang.StringBuilder aBuf, int start, int limit)
aLocale
- locale to use or null
for default localeaBuf
- StringBuilder to lowercasestart
- limit
- public static java.lang.String toUpperCase(java.util.Locale aLocale, java.lang.String aBuf)
aLocale
- locale to use or null
for default localeaBuf
- public static java.lang.String toUpperCase(java.util.Locale aLocale, java.lang.String aBuf, int start, int limit)
aLocale
- locale to use or null
for default localeaBuf
- start
- limit
- public static java.lang.String toUpperCase(java.util.Locale aLocale, java.lang.StringBuffer aBuf, int start, int limit)
aLocale
- locale to use or null
for default localeaBuf
- start
- limit
- public static java.lang.String toUpperCase(java.util.Locale aLocale, java.lang.StringBuilder aBuf, int start, int limit)
aLocale
- locale to use or null
for default localeaBuf
- start
- limit
- public static java.lang.String toProperCase(java.lang.String aString)
aString
- input textpublic static final boolean interpretBoolean(java.lang.String aOpt)
aOpt
- String to be evaluatedtrue
or false
public static final java.lang.String unquote(java.lang.String input)
public static final java.lang.String replaceAll(java.lang.String aBaseString, java.lang.String aOriginalChars, java.lang.String aNewChars, boolean aReplaceAssign)
aBaseString
- - the base StringaOriginalChars
- - the original charactersaNewChars
- = new charactersaReplaceAssign
- -public static final java.lang.String replaceAll(java.lang.String aBaseString, java.lang.String aOriginalChars, java.lang.String aNewChars)
aBaseString
- - the base StringaOriginalChars
- - the original charactersaNewChars
- = new characterspublic static final java.lang.String quoteAndEscape(java.lang.String aOriginalString)
aOriginalString
- The original stringpublic static final java.lang.String quote(java.lang.String inputStr)
public static final java.lang.String quoteNullIsEmptyString(java.lang.String aInputStr)
aInputStr
- public static int parseInt(int radix, java.lang.String s, int start, int end) throws java.lang.NumberFormatException
radix
- s
- start
- starting offset (e.g. 0)end
- offset (e.g. s.length())java.lang.NumberFormatException
public static java.lang.StringBuffer replace(java.lang.StringBuffer buf, char oldChar, char newChar)
buf
- oldChar
- newChar
- public static java.lang.StringBuilder replace(java.lang.StringBuilder buf, char oldChar, char newChar)
buf
- oldChar
- newChar
- public static java.lang.String escapeIntoJavaString(java.lang.String aInput)
aInput
- the source string to convertpublic static java.lang.String escapeIntoJSONString(java.lang.String aInput)
aInput
- the source string to convertpublic static void writeEscapedCSVEntry(java.lang.String aString, java.io.PrintWriter aWriter)
aString
- the string to writeaWriter
- the writer for the CSV filepublic static java.util.Map parseQueryString(java.lang.String aQS)
aQS
- The query string to parse, assumed to consist of 8-bit characters
in UTF-8 encoding.public static void parseURLParameters(java.util.Map map, java.lang.String data, java.lang.String encoding)
IMPLEMENTATION NOTE: URL decoding is performed individually on the parsed name and value elements, rather than on the entire query string ahead of time, to properly deal with the case where the name or value includes an encoded "=" or "&" character that would otherwise be interpreted as a delimiter. NOTE: The input String is assumed to contain 8-bit data only (such as might be retrieved from a servlet query parameter that was encoded in UTF-8 by the browser and handled as ISO-8859-1 by the servlet -- that is, what one typically sees in Tomcat on W2K).
map
- Map that accumulates the resulting parametersdata
- Input String containing request parametersencoding
- Encoding to use for converting bytes to Stringpublic static void parseURLParameters(java.util.Map map, byte[] data, java.lang.String encoding)
map
- output parameter mapdata
- byte array to parseencoding
- character encodingpublic static void parseURLParameters(java.util.Map map, byte[] data, int useLen, java.lang.String encoding)
IMPLEMENTATION NOTE: URL decoding is performed individually on the parsed name and value elements, rather than on the entire query string ahead of time, to properly deal with the case where the name or value includes an encoded "=" or "&" character that would otherwise be interpreted as a delimiter. NOTE: byte array data is modified by this method. Caller beware.
map
- Map that accumulates the resulting parametersdata
- Input byte array containing request parametersuseLen
- length of "data" byte array to consider during parseencoding
- Encoding to use for converting bytes to Stringpublic static java.lang.String xlateBytesToString(byte[] aData, int useLen, java.lang.String encoding)
aData
- byte array to translateuseLen
- length of aData to translate, use full length if useLen is negativeencoding
- Character encoding to use, defaults to UTF-8null
if aData is null
or if an UnsupportedEncodingException
occurs.public static java.lang.String stripQuotes(java.lang.String aString)
aString
- public static int indexOfEsc(java.lang.String s, char c, int p)
s
- string to search within for cc
- char to search for in s, ignored if escaped by a preceeding backslashp
- position in s to start the searchpublic static int indexOfEsc(java.lang.StringBuffer s, char c, int p)
s
- string to search within for cc
- char to search for in s, ignored if escaped by a preceeding backslashp
- position in s to start the searchpublic static int indexOf(java.lang.StringBuffer s, char c, int p)
s
- string to search for cc
- char to search for in s, ignored if escaped by a preceeding backslashp
- position in s to start the searchpublic static int indexOf(java.lang.StringBuilder s, char c, int p)
s
- string to search for cc
- char to search for in s, ignored if escaped by a preceeding backslashp
- position in s to start the searchpublic static java.lang.String encodeURL(java.lang.String strParameterValue)
application/x-www-form-urlencoded
format using the UTF-8 encoding scheme. This method uses UTF-8
encoding to obtain the bytes for unsafe characters.
Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.
strParameterValue
- String
to be translated.String
.public static java.lang.String decodeURL(java.lang.String s)
application/x-www-form-urlencoded
string using the UTF-8
encoding scheme.
UTF-8 encoding is used to determine
what characters are represented by any consecutive sequences of the
form "%xy
".
Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.
s
- the String
to decodeString
public static java.lang.String encodeCrossOSString(java.lang.String s)
$xy
".
Encodes the following chars:
, [ ] { } ( ) ! ; " ' * ? < > | : / \s
- the string to be encodedString
or s, if s contains a
non-UTF8 compliant byte value (such as $9z)public static java.lang.String decodeCrossOSString(java.lang.String s)
$xy
".s
- the string to be encodedString
or s, if s contains a
non-UTF8 compliant byte value (such as $9z)public static boolean startsWith(java.lang.CharSequence aSequenceToCheck, java.lang.String aLookingFor)
public static void insertInteger(java.lang.StringBuffer aTarget, int aAtPosition, int aIntValue)
public static void insertInteger(java.lang.StringBuilder aTarget, int aAtPosition, int aIntValue)
public static java.lang.String toHexString(byte[] in)
in
- public static byte[] fromHexString(java.lang.String in)
in
- public static java.lang.String crossScriptingFilter(java.lang.String aBuf)
aBuf
- the source stringpublic static java.lang.String escapeCrossScriptingFilter(java.lang.String aBuf)
aBuf
- the source stringpublic static java.lang.String escapeForExpression(java.lang.String value)
public static final java.lang.String filterRichText(java.lang.String html)
public static final int indexOf(char[] aSource, int aSourceStart, int aSourceLength, java.lang.String aToBeFound)
aSource
- The character array to be searchedaSourceStart
- Location in the character array to start searching fromaSourceLength
- The number of characters from aSourceStart to stop searching ataToBeFound
- The string to be located in the arraypublic static final boolean isBlank(java.lang.String aString)
aString
- the stringpublic static final java.lang.String getPackageQualifier(ClassDefinition aClass)
public static final boolean compareStringsHandleNulls(java.lang.String lhs, java.lang.String rhs)
Copyright © 2015 Pegasystems Inc. All Rights Reserved.