public class ClassUtils
extends java.lang.Object
| Constructor and Description |
|---|
ClassUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends java.lang.annotation.Annotation> |
collectNestedAnnotation(java.lang.Class<?> objectClass,
java.lang.Class<T> annotationClass) |
static <T extends java.lang.annotation.Annotation> |
collectNestedAnnotation(java.lang.reflect.Method method,
java.lang.Class<T> annotationClass) |
static <T> T |
executeDeclaredMethod(java.lang.Object o,
java.lang.String methodName,
java.lang.Object... args) |
static java.util.Collection<java.lang.Class<?>> |
getAnnotatedClasses(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
java.lang.String... packageNames) |
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<?> objectClass,
java.lang.Class<T> annotationClass) |
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.reflect.Method method,
java.lang.Class<T> annotationClass)
Extract the annotation from the controllerMethod or the declaring class.
|
static <T> java.lang.Class<T> |
getClass(java.lang.String className) |
static java.util.Collection<java.lang.Class<?>> |
getClasses(java.lang.String... packageNames)
Returns the list of all classes within a package.
|
static java.util.List<java.lang.reflect.Method> |
getDeclaredMethods(java.lang.Class<?> clazz)
Returns an array containing
Method objects reflecting all the
declared methods of the class or interface represented by this Class object, including public, protected, default (package)
access, and private methods, but excluding inherited methods. |
static java.util.List<java.net.URL> |
getResources(java.lang.String name) |
static <T> java.util.Collection<java.lang.Class<? extends T>> |
getSubTypesOf(java.lang.Class<T> type,
java.lang.String... packageNames)
Gets all sub types in hierarchy of a given type.
|
static boolean |
isAssignable(java.lang.Object value,
java.lang.Class<?> type) |
public static <T> java.lang.Class<T> getClass(java.lang.String className)
public static java.util.Collection<java.lang.Class<?>> getClasses(java.lang.String... packageNames)
packageNames - public static <T> java.util.Collection<java.lang.Class<? extends T>> getSubTypesOf(java.lang.Class<T> type,
java.lang.String... packageNames)
public static java.util.Collection<java.lang.Class<?>> getAnnotatedClasses(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
java.lang.String... packageNames)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.reflect.Method method,
java.lang.Class<T> annotationClass)
T - method - annotationClass - public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> objectClass,
java.lang.Class<T> annotationClass)
public static java.util.List<java.lang.reflect.Method> getDeclaredMethods(java.lang.Class<?> clazz)
Method objects reflecting all the
declared methods of the class or interface represented by this Class object, including public, protected, default (package)
access, and private methods, but excluding inherited methods.
This method differs from Class.getDeclaredMethods() since it
does not return bridge methods, in other words, only the methods of
the class are returned. If you just want the methods declared in
clazz use this method!
clazz - ClassMethod objects representing all the
declared methods of this classClass.getDeclaredMethods()public static <T extends java.lang.annotation.Annotation> java.util.List<T> collectNestedAnnotation(java.lang.reflect.Method method,
java.lang.Class<T> annotationClass)
public static <T extends java.lang.annotation.Annotation> java.util.List<T> collectNestedAnnotation(java.lang.Class<?> objectClass,
java.lang.Class<T> annotationClass)
public static <T> T executeDeclaredMethod(java.lang.Object o,
java.lang.String methodName,
java.lang.Object... args)
public static java.util.List<java.net.URL> getResources(java.lang.String name)
public static boolean isAssignable(java.lang.Object value,
java.lang.Class<?> type)
Copyright © 2023. All rights reserved.