public abstract class ClassUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ClassUtil.DeclaredAnnotation<T extends Annotation> |
| Constructor and Description |
|---|
ClassUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
classOfType(Type type) |
static String |
decapitalize(String name) |
static <T> List<T> |
emptyList(Class<T> type) |
static <T,U> Map<T,U> |
emptyMap(Class<T> keyType,
Class<U> valueType) |
static <T> Set<T> |
emptySet(Class<T> type) |
static URL |
findResource(Class<?> clazz) |
static Class<?> |
forName(String type) |
static <T> Class<T> |
forName(String type,
Class<T> cast) |
static <T extends Annotation> |
getAnnotation(AnnotatedElement elmt,
Class<T> annotationClass) |
static Type |
getBoundType(TypeVariable<?> typeVariable) |
static <T extends Annotation> |
getClassAnnotation(Class<?> clazz,
Class<T> annotationClass) |
static ClassLoader |
getClassLoader(Class<?> clazz) |
static <T> Constructor<T> |
getConstructor(Class<T> type,
Class<?>[] paramTypes) |
static Constructor<?> |
getConstructor(String type,
Class<?>[] paramTypes) |
static <T extends Annotation> |
getConstructorAnnotation(Class<?> clazz,
Class<T> annotationClass) |
static Method |
getMethod(Class<?> clazz,
String signature) |
static <T extends Annotation> |
getMethodAnnotation(Class<?> clazz,
String name,
Class<?>[] parameterTypes,
Class<T> annotationClass) |
static String |
getMethodSignature(Method method) |
static String |
getPackageName(Class<?> clazz) |
static PropertyDescriptor[] |
getProperties(Class<?> clazz) |
static String |
getTypeSignature(Class<?> type) |
static boolean |
isAnnotationPresent(AnnotatedElement elmt,
Class<? extends Annotation> annotationClass) |
static boolean |
isPrimitive(Type type) |
static <T> T |
newInstance(Class<?> type,
Class<T> cast) |
static <T> T |
newInstance(Class<T> type,
Class<?>[] argsClass,
Object[] argsValues) |
static Object |
newInstance(String type) |
static Object |
newInstance(String type,
Class<?>[] argsClass,
Object[] argsValues) |
static <T> T |
newInstance(String type,
Class<T> cast) |
static String |
removeSpaces(String s) |
static String |
toResourceName(Class<?> clazz) |
public static Object newInstance(String type) throws ClassNotFoundException, InstantiationException, IllegalAccessException
public static <T> T newInstance(String type, Class<T> cast) throws ClassNotFoundException, InstantiationException, IllegalAccessException
public static Object newInstance(String type, Class<?>[] argsClass, Object[] argsValues) throws ClassNotFoundException, InstantiationException, IllegalAccessException
public static <T> T newInstance(Class<?> type, Class<T> cast) throws InstantiationException, IllegalAccessException
public static <T> T newInstance(Class<T> type, Class<?>[] argsClass, Object[] argsValues) throws InstantiationException, IllegalAccessException
public static Class<?> forName(String type) throws ClassNotFoundException
ClassNotFoundExceptionpublic static <T> Class<T> forName(String type, Class<T> cast) throws ClassNotFoundException
ClassNotFoundExceptionpublic static Constructor<?> getConstructor(String type, Class<?>[] paramTypes) throws ClassNotFoundException, NoSuchMethodException
public static <T> Constructor<T> getConstructor(Class<T> type, Class<?>[] paramTypes) throws NoSuchMethodException
NoSuchMethodExceptionpublic static boolean isPrimitive(Type type)
public static Type getBoundType(TypeVariable<?> typeVariable)
public static PropertyDescriptor[] getProperties(Class<?> clazz)
public static ClassLoader getClassLoader(Class<?> clazz)
public static Method getMethod(Class<?> clazz, String signature) throws NoSuchMethodException
NoSuchMethodExceptionpublic static boolean isAnnotationPresent(AnnotatedElement elmt, Class<? extends Annotation> annotationClass)
public static <T extends Annotation> ClassUtil.DeclaredAnnotation<T> getAnnotation(AnnotatedElement elmt, Class<T> annotationClass)
public static <T extends Annotation> ClassUtil.DeclaredAnnotation<T> getMethodAnnotation(Class<?> clazz, String name, Class<?>[] parameterTypes, Class<T> annotationClass)
public static <T extends Annotation> ClassUtil.DeclaredAnnotation<T> getConstructorAnnotation(Class<?> clazz, Class<T> annotationClass)
public static <T extends Annotation> ClassUtil.DeclaredAnnotation<T> getClassAnnotation(Class<?> clazz, Class<T> annotationClass)