public final class ReflectionUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
includeObject |
Constructor and Description |
---|
ReflectionUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
callingClassAnyOf(java.lang.String[] classNames) |
static boolean |
contains(java.lang.String className,
java.lang.String[] classes) |
static java.lang.String |
extractCallingMethod(java.lang.String[] excludes) |
static java.lang.reflect.Constructor<?> |
findConstructor(java.lang.String className,
java.lang.Class<?>[] expectedParams)
Returns the constructor of the class with the given name and the expected
arguments.
|
static java.util.Set<java.lang.reflect.Method> |
getAllMethods(java.lang.Class<?> type)
Get all methods of given
type , up the super class hierarchy,
optionally filtered by predicates |
static java.util.Set<java.lang.Class<?>> |
getAllSuperTypes(java.lang.Class<?> type)
Get all super types of given
type , including, optionally filtered
by predicates |
public static final boolean includeObject
public static java.lang.reflect.Constructor<?> findConstructor(java.lang.String className, java.lang.Class<?>[] expectedParams) throws java.lang.ClassNotFoundException
className
- the name of the class to find its constructor.expectedParams
- the argument types of the constructor.java.lang.ClassNotFoundException
- if class named className doesn't exist.public static java.util.Set<java.lang.Class<?>> getAllSuperTypes(java.lang.Class<?> type)
type
, including, optionally filtered
by predicates
include Object.class
if includeObject
is true
public static java.util.Set<java.lang.reflect.Method> getAllMethods(java.lang.Class<?> type)
type
, up the super class hierarchy,
optionally filtered by predicates
public static java.lang.String extractCallingMethod(java.lang.String[] excludes)
public static boolean callingClassAnyOf(java.lang.String[] classNames)
public static final boolean contains(java.lang.String className, java.lang.String[] classes)