|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.myfaces.commons.util.ClassUtils
public final class ClassUtils
Field Summary | |
---|---|
static java.lang.Class |
BOOLEAN_ARRAY_CLASS
|
static java.lang.Class |
BOOLEAN_OBJECT_ARRAY_CLASS
|
static java.lang.Class |
BYTE_ARRAY_CLASS
|
static java.lang.Class |
BYTE_OBJECT_ARRAY_CLASS
|
static java.lang.Class |
CHAR_ARRAY_CLASS
|
static java.lang.Class |
CHARACTER_OBJECT_ARRAY_CLASS
|
static java.util.Map |
COMMON_TYPES
|
static java.lang.Class |
DOUBLE_ARRAY_CLASS
|
static java.lang.Class |
DOUBLE_OBJECT_ARRAY_CLASS
|
static java.lang.Class |
FLOAT_ARRAY_CLASS
|
static java.lang.Class |
FLOAT_OBJECT_ARRAY_CLASS
|
static java.lang.Class |
INT_ARRAY_CLASS
|
static java.lang.Class |
INTEGER_OBJECT_ARRAY_CLASS
|
static java.lang.Class |
LONG_ARRAY_CLASS
|
static java.lang.Class |
LONG_OBJECT_ARRAY_CLASS
|
static java.lang.Class |
OBJECT_ARRAY_CLASS
|
static java.lang.Class |
SHORT_ARRAY_CLASS
|
static java.lang.Class |
SHORT_OBJECT_ARRAY_CLASS
|
static java.lang.Class |
STRING_OBJECT_ARRAY_CLASS
|
Method Summary | |
---|---|
static java.lang.Class |
classForName(java.lang.String type)
Tries a Class.loadClass with the context class loader of the current thread first and automatically falls back to the ClassUtils class loader (i.e. |
static java.lang.Object |
convertToType(java.lang.Object value,
java.lang.Class desiredClass)
|
protected static java.lang.ClassLoader |
getCurrentLoader(java.lang.Object defaultObject)
Gets the ClassLoader associated with the current thread. |
static java.io.InputStream |
getResourceAsStream(java.lang.String resource)
|
static java.util.Iterator |
getResources(java.lang.String resource,
java.lang.Object defaultObject)
|
static java.lang.Class |
javaTypeToClass(java.lang.String type)
Similar as classForName(String) , but also supports primitive types
and arrays as specified for the JavaType element in the JavaServer Faces Config DTD. |
static java.lang.Object |
newInstance(java.lang.Class clazz)
|
static java.lang.Object |
newInstance(java.lang.String type)
|
static java.lang.Object |
newInstance(java.lang.String type,
java.lang.Class expectedType)
|
static java.lang.Object |
newInstance(java.lang.String type,
java.lang.Class[] expectedTypes)
|
static java.lang.Class |
simpleClassForName(java.lang.String type)
Same as classForName(String) , but throws a RuntimeException
(FacesException) instead of a ClassNotFoundException. |
static java.lang.Class |
simpleJavaTypeToClass(java.lang.String type)
Same as javaTypeToClass(String) , but throws a RuntimeException
(FacesException) instead of a ClassNotFoundException. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class BOOLEAN_ARRAY_CLASS
public static final java.lang.Class BYTE_ARRAY_CLASS
public static final java.lang.Class CHAR_ARRAY_CLASS
public static final java.lang.Class SHORT_ARRAY_CLASS
public static final java.lang.Class INT_ARRAY_CLASS
public static final java.lang.Class LONG_ARRAY_CLASS
public static final java.lang.Class FLOAT_ARRAY_CLASS
public static final java.lang.Class DOUBLE_ARRAY_CLASS
public static final java.lang.Class OBJECT_ARRAY_CLASS
public static final java.lang.Class BOOLEAN_OBJECT_ARRAY_CLASS
public static final java.lang.Class BYTE_OBJECT_ARRAY_CLASS
public static final java.lang.Class CHARACTER_OBJECT_ARRAY_CLASS
public static final java.lang.Class SHORT_OBJECT_ARRAY_CLASS
public static final java.lang.Class INTEGER_OBJECT_ARRAY_CLASS
public static final java.lang.Class LONG_OBJECT_ARRAY_CLASS
public static final java.lang.Class FLOAT_OBJECT_ARRAY_CLASS
public static final java.lang.Class DOUBLE_OBJECT_ARRAY_CLASS
public static final java.lang.Class STRING_OBJECT_ARRAY_CLASS
public static final java.util.Map COMMON_TYPES
Method Detail |
---|
public static java.lang.Class classForName(java.lang.String type) throws java.lang.ClassNotFoundException
type
- fully qualified name of a non-primitive non-array class
java.lang.NullPointerException
- if type is null
java.lang.ClassNotFoundException
public static java.lang.Class simpleClassForName(java.lang.String type)
classForName(String)
, but throws a RuntimeException
(FacesException) instead of a ClassNotFoundException.
java.lang.NullPointerException
- if type is null
javax.faces.FacesException
- if class not foundpublic static java.lang.Class javaTypeToClass(java.lang.String type) throws java.lang.ClassNotFoundException
classForName(String)
, but also supports primitive types
and arrays as specified for the JavaType element in the JavaServer Faces Config DTD.
type
- fully qualified class name or name of a primitive type, both optionally
followed by "[]" to indicate an array type
java.lang.NullPointerException
- if type is null
java.lang.ClassNotFoundException
public static java.lang.Class simpleJavaTypeToClass(java.lang.String type)
javaTypeToClass(String)
, but throws a RuntimeException
(FacesException) instead of a ClassNotFoundException.
java.lang.NullPointerException
- if type is null
javax.faces.FacesException
- if class not foundpublic static java.io.InputStream getResourceAsStream(java.lang.String resource)
public static java.util.Iterator getResources(java.lang.String resource, java.lang.Object defaultObject)
resource
- Name of resource(s) to find in classpathdefaultObject
- The default object to use to determine the class loader (if none associated with current thread.)
public static java.lang.Object newInstance(java.lang.String type) throws javax.faces.FacesException
javax.faces.FacesException
public static java.lang.Object newInstance(java.lang.String type, java.lang.Class expectedType) throws javax.faces.FacesException
javax.faces.FacesException
public static java.lang.Object newInstance(java.lang.String type, java.lang.Class[] expectedTypes)
public static java.lang.Object newInstance(java.lang.Class clazz) throws javax.faces.FacesException
javax.faces.FacesException
public static java.lang.Object convertToType(java.lang.Object value, java.lang.Class desiredClass)
protected static java.lang.ClassLoader getCurrentLoader(java.lang.Object defaultObject)
defaultObject
- The default object to use to determine the class loader (if none associated with current thread.)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |