|
Sharkysoft home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--lava.string.StringEncoder
Encodes strings.
Details: StringEncoder contains functions for transforming regular strings into strings that satisfy various encoding rules.
| Constructor Summary | |
StringEncoder()
|
|
| Method Summary | |
static java.lang.String |
bytesToHexString(byte[] bytes)
Converts byte array to hex string. |
static char |
charForDigit(int n)
Converts digit value to character. |
static java.lang.String |
encodeAsciiJavaString(java.lang.String input)
Encodes string into Java string literal. |
static java.lang.String |
encodeHtmlText(java.lang.String encoded)
Encodes HTML text. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public StringEncoder()
| Method Detail |
public static java.lang.String encodeAsciiJavaString(java.lang.String input)
Details: This method transforms a "binary" string into a Java string literal, such as might appear in Java source code, but using only 7-bit ASCII characters. The result is contained in quotes, and all non-printable characters or characters outside the 7-bit ASCII range are encoded using appropriate Java escape sequences. If null is supplied, null is returned.
input - the string to encodepublic static java.lang.String encodeHtmlText(java.lang.String encoded)
Details: encodeHtmlText prepares a string for output into an HTML document by escaping the reserved characters '<', '>', and '&'.
s - the input stringpublic static char charForDigit(int n)
Details: charForDigit converts the given integer (n) into its character equivalent. For 0 <= n <= 9, this is simply the character corresponding to the number. For 10 <= n < 36, this is 'A' + (n - 10). All other values for n are illegal.
n - the integerpublic static java.lang.String bytesToHexString(byte[] bytes)
Details: bytesToHexString converts the given byte array (bytes) into an upper case hexadecimal string.
bytes - the array
|
Sharkysoft home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||