Class ReflectionUtils
- java.lang.Object
-
- org.antublue.test.engine.internal.test.util.ReflectionUtils
-
public final class ReflectionUtils extends Object
Class to implement ReflectionUtils
-
-
Field Summary
Fields Modifier and Type Field Description static Class<?>[]NO_CLASS_ARGSstatic Object[]NO_OBJECT_ARGS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanacceptsArguments(Method method, Class<?>... parameterTypes)Method to determine if a Method accepts a specified set of parametersstatic booleanhasParameterCount(Method method, int parameterCount)Method to determine if a Method has a specified parameter countstatic booleanhasReturnType(Method method, Class<?> clazz)Method to determine if a Method returns a specific typestatic booleanisAbstract(Class<?> clazz)Method to determine if a Class is abstractstatic booleanisAbstract(Method method)Method to determine if a Method is abstractstatic booleanisProtected(Method method)Method to determine if a Method is protectedstatic booleanisPublic(Method method)Method to determine if a Method is publicstatic booleanisStatic(Method method)Method to determine if a Method is staticstatic ObjectnewInstance(Class<?> clazz)Method to create a new instance of a Class
-
-
-
Method Detail
-
newInstance
public static Object newInstance(Class<?> clazz) throws Throwable
Method to create a new instance of a Class- Parameters:
clazz- clazz- Returns:
- object object
- Throws:
Throwable- Throwable
-
isAbstract
public static boolean isAbstract(Class<?> clazz)
Method to determine if a Class is abstract- Parameters:
clazz- clazz- Returns:
- true if the Class is abstract, otherwise false
-
isAbstract
public static boolean isAbstract(Method method)
Method to determine if a Method is abstract- Parameters:
method- method- Returns:
- true if the Method is abstract, otherwise false
-
isStatic
public static boolean isStatic(Method method)
Method to determine if a Method is static- Parameters:
method- method- Returns:
- true if the Method is static, otherwise false
-
isPublic
public static boolean isPublic(Method method)
Method to determine if a Method is public- Parameters:
method- method- Returns:
- true if the Method is public, otherwise false
-
isProtected
public static boolean isProtected(Method method)
Method to determine if a Method is protected- Parameters:
method- method- Returns:
- true if the Method is protected, otherwise false
-
hasParameterCount
public static boolean hasParameterCount(Method method, int parameterCount)
Method to determine if a Method has a specified parameter count- Parameters:
method- methodparameterCount- parameterCount- Returns:
- true if the Method has the specified parameter count, otherwise false
-
acceptsArguments
public static boolean acceptsArguments(Method method, Class<?>... parameterTypes)
Method to determine if a Method accepts a specified set of parameters- Parameters:
method- methodparameterTypes- parameterTypes- Returns:
- true if the Method accepts the specified parameters, otherwise false
-
-