Package org.eclipse.jetty.util
Class TypeUtil
java.lang.Object
org.eclipse.jetty.util.TypeUtil
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
TYPE Utilities.
Provides various static utility methods for manipulating types and their
string representations.
- Since:
- Jetty 4.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T> asList(T[] a) Deprecated.Array to List.static ObjectDeprecated.static ObjectDeprecated.static ObjectDeprecated.static byteconvertHexDigit(byte c) Deprecated.static intconvertHexDigit(char c) Deprecated.static intconvertHexDigit(int c) Deprecated.static voidDeprecated.static voiddump(ClassLoader cl) Deprecated.static byte[]Deprecated.static Class<?> Deprecated.Class from a canonical name for a type.static URIgetClassLoaderLocation(Class<?> clazz) Deprecated.static URIgetClassLoaderLocation(Class<?> clazz, ClassLoader loader) Deprecated.static URIgetCodeSourceLocation(Class<?> clazz) Deprecated.static URIgetLocationOfClass(Class<?> clazz) Deprecated.Attempt to find the Location of a loaded Class.static URIgetModuleLocation(Class<?> clazz) Deprecated.static URIgetSystemClassLoaderLocation(Class<?> clazz) Deprecated.static booleanDeprecated.static booleanDeprecated.static byte[]parseBytes(String s, int base) Deprecated.static intparseInt(byte[] b, int offset, int length, int base) Deprecated.Parse an int from a byte array of ascii characters.static intDeprecated.Parse an int from a substring.static StringtoClassReference(Class<?> clazz) Deprecated.Return the Classpath / Classloader reference for the provided class file.static StringtoClassReference(String className) Deprecated.Return the Classpath / Classloader reference for the provided class file.static voidtoHex(byte b, Appendable buf) Deprecated.static voidtoHex(int value, Appendable buf) Deprecated.static voidtoHex(long value, Appendable buf) Deprecated.static StringtoHexString(byte b) Deprecated.static StringtoHexString(byte[] b) Deprecated.static StringtoHexString(byte[] b, int offset, int length) Deprecated.static StringDeprecated.Canonical name for a type.static StringtoString(byte[] bytes, int base) Deprecated.static ObjectDeprecated.Convert String value to instance.static ObjectDeprecated.Convert String value to instance.
-
Field Details
-
NO_ARGS
Deprecated. -
CR
public static final int CRDeprecated.- See Also:
-
LF
public static final int LFDeprecated.- See Also:
-
-
Constructor Details
-
TypeUtil
public TypeUtil()Deprecated.
-
-
Method Details
-
asList
Deprecated.Array to List.Works like
Arrays.asList(Object...), but handles null arrays.- Type Parameters:
T- the array and list entry type- Parameters:
a- the array to convert to a list- Returns:
- a list backed by the array.
-
fromName
Deprecated.Class from a canonical name for a type.- Parameters:
name- A class or type name.- Returns:
- A class , which may be a primitive TYPE field..
-
toName
Deprecated.Canonical name for a type.- Parameters:
type- A class , which may be a primitive TYPE field.- Returns:
- Canonical name.
-
toClassReference
Deprecated.Return the Classpath / Classloader reference for the provided class file.Convenience method for the code
String ref = myObject.getClass().getName().replace('.','/') + ".class";- Parameters:
clazz- the class to reference- Returns:
- the classpath reference syntax for the class file
-
toClassReference
Deprecated.Return the Classpath / Classloader reference for the provided class file.Convenience method for the code
String ref = myClassName.replace('.','/') + ".class";- Parameters:
className- the class to reference- Returns:
- the classpath reference syntax for the class file
-
valueOf
Deprecated.Convert String value to instance.- Parameters:
type- The class of the instance, which may be a primitive TYPE field.value- The value as a string.- Returns:
- The value as an Object.
-
valueOf
Deprecated.Convert String value to instance.- Parameters:
type- classname or type (eg int)value- The value as a string.- Returns:
- The value as an Object.
-
parseInt
Deprecated.Parse an int from a substring. Negative numbers are not handled.- Parameters:
s- Stringoffset- Offset within stringlength- Length of integer or -1 for remainder of stringbase- base of the integer- Returns:
- the parsed integer
- Throws:
NumberFormatException- if the string cannot be parsed
-
parseInt
Deprecated.Parse an int from a byte array of ascii characters. Negative numbers are not handled.- Parameters:
b- byte arrayoffset- Offset within stringlength- Length of integer or -1 for remainder of stringbase- base of the integer- Returns:
- the parsed integer
- Throws:
NumberFormatException- if the array cannot be parsed into an integer
-
parseBytes
Deprecated. -
toString
Deprecated. -
convertHexDigit
public static byte convertHexDigit(byte c) Deprecated.- Parameters:
c- An ASCII encoded character 0-9 a-f A-F- Returns:
- The byte value of the character 0-16.
-
convertHexDigit
public static int convertHexDigit(char c) Deprecated.- Parameters:
c- An ASCII encoded character 0-9 a-f A-F- Returns:
- The byte value of the character 0-16.
-
convertHexDigit
public static int convertHexDigit(int c) Deprecated.- Parameters:
c- An ASCII encoded character 0-9 a-f A-F- Returns:
- The byte value of the character 0-16.
-
toHex
Deprecated. -
toHex
Deprecated.- Throws:
IOException
-
toHex
Deprecated.- Throws:
IOException
-
toHexString
Deprecated. -
toHexString
Deprecated. -
toHexString
Deprecated. -
fromHexString
Deprecated. -
dump
Deprecated. -
dump
Deprecated. -
call
@Deprecated public static Object call(Class<?> oClass, String methodName, Object obj, Object[] arg) throws InvocationTargetException, NoSuchMethodException Deprecated. -
construct
@Deprecated public static Object construct(Class<?> klass, Object[] arguments) throws InvocationTargetException, NoSuchMethodException Deprecated. -
construct
@Deprecated public static Object construct(Class<?> klass, Object[] arguments, Map<String, Object> namedArgMap) throws InvocationTargetException, NoSuchMethodExceptionDeprecated. -
isTrue
Deprecated.- Parameters:
o- Object to test for true- Returns:
- True if passed object is not null and is either a Boolean with value true or evaluates to a string that evaluates to true.
-
isFalse
Deprecated.- Parameters:
o- Object to test for false- Returns:
- True if passed object is not null and is either a Boolean with value false or evaluates to a string that evaluates to false.
-
getLocationOfClass
Deprecated.Attempt to find the Location of a loaded Class.This can be null for primitives, void, and in-memory classes.
- Parameters:
clazz- the loaded class to find a location for.- Returns:
- the location as a URI (this is a URI pointing to a holder of the class: a directory,
a jar file, a
jrt://resource, etc), or null of no location available.
-
getClassLoaderLocation
Deprecated. -
getSystemClassLoaderLocation
Deprecated. -
getClassLoaderLocation
Deprecated. -
getCodeSourceLocation
Deprecated. -
getModuleLocation
Deprecated.
-