|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.TypeUtil
TYPE Utilities. Provides various static utiltiy methods for manipulating types and their string representations.
Constructor Summary | |
TypeUtil()
|
Method Summary | |
static byte |
convertHexDigit(byte b)
|
static byte[] |
fromHexString(java.lang.String s)
|
static java.lang.Class |
fromName(java.lang.String name)
Class from a canonical name for a type. |
static java.lang.Integer |
newInteger(int i)
Convert int to Integer using cache. |
static byte[] |
parseBytes(java.lang.String s,
int base)
|
static int |
parseInt(java.lang.String s,
int offset,
int length,
int base)
Parse an int from a substring. |
static java.lang.String |
toHexString(byte[] b)
|
static java.lang.String |
toHexString(byte[] b,
int offset,
int length)
|
static java.lang.String |
toName(java.lang.Class type)
Canonical name for a type. |
static java.lang.String |
toString(byte[] bytes,
int base)
|
static java.lang.String |
toString(int i)
Convert int to String using cache. |
static java.lang.Object |
valueOf(java.lang.Class type,
java.lang.String value)
Convert String value to instance. |
static java.lang.Object |
valueOf(java.lang.String type,
java.lang.String value)
Convert String value to instance. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TypeUtil()
Method Detail |
public static java.lang.Class fromName(java.lang.String name)
name
- A class or type name.
public static java.lang.String toName(java.lang.Class type)
type
- A class , which may be a primitive TYPE field.
public static java.lang.Object valueOf(java.lang.Class type, java.lang.String value)
type
- The class of the instance, which may be a primitive TYPE field.value
- The value as a string.
public static java.lang.Object valueOf(java.lang.String type, java.lang.String value)
type
- classname or type (eg int)value
- The value as a string.
public static java.lang.Integer newInteger(int i)
public static java.lang.String toString(int i)
public static int parseInt(java.lang.String s, int offset, int length, int base) throws java.lang.NumberFormatException
s
- Stringoffset
- Offset within stringlength
- Length of integer or -1 for remainder of stringbase
- base of the integer
java.lang.NumberFormatException
public static byte[] parseBytes(java.lang.String s, int base)
public static java.lang.String toString(byte[] bytes, int base)
public static byte convertHexDigit(byte b)
b
- An ASCII encoded character 0-9 a-f A-F
public static java.lang.String toHexString(byte[] b)
public static java.lang.String toHexString(byte[] b, int offset, int length)
public static byte[] fromHexString(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |