public class BetterReflectionClass extends Object
| Constructor and Description |
|---|
BetterReflectionClass(BetterReflectionClass clasz) |
BetterReflectionClass(Class<?> clasz) |
BetterReflectionClass(String className) |
public BetterReflectionClass(String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic BetterReflectionClass(BetterReflectionClass clasz)
clasz - the class to wrappublic BetterReflectionClass(Class<?> clasz)
public static BetterReflectionClass forName(String name)
name - the class' nameBetterReflectionClass(String), but if a
ClassNotFoundException is thrown it will return nullpublic static BetterReflectionClass forNameAsArray(String name)
name - the class' namepublic Class<?> getClasz()
public String getName()
public String getSimpleName()
Simple Name (Class.getSimpleName())public String getCanonicalName()
Canonical Name (Class.getCanonicalName())public String getTypeName()
Type Name (Class.getTypeName())public Field[] getDeclaredFields()
public Field[] getFields()
public Constructor<?> getDeclaredConstructor(Object... parameterTypes)
parameterTypes - this should be populated ONLY by BetterReflectionClass
instances and Classes. Nothing else!public Constructor<?> getDeclaredConstructor(Class<?>... parameterTypes)
public Constructor<?>[] getDeclaredConstructors()
public Constructor<?> getConstructor(Object... parameterTypes)
parameterTypes - this should be populated ONLY by BetterReflectionClass
instances and Classes. Nothing else!public Constructor<?> getConstructor(Class<?>... parameterTypes)
public Constructor<?>[] getConstructors()
public Method getDeclaredMethod(String name, Object... parameterTypes)
name - The method's nameparameterTypes - this should be populated ONLY by BetterReflectionClass
instances and Classes. Nothing else!public Method[] getDeclaredMethods()
public Method getMethod(String name, Object... parameterTypes)
name - The method's nameparameterTypes - this should be populated ONLY by BetterReflectionClass
instances and Classes. Nothing else!public Method[] getMethods()
public ProtectionDomain getProtectionDomain()
public Object newInstance() throws InstantiationException, IllegalAccessException
public void invokeMethods(Map<String,Object[]> methods, Object instance) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
public boolean isInstance(Object object)
public Class<?> getArrayClass()
public BetterReflectionClass getBetterReflectionArrayClass()
public Class<?> getArrayClassIf(boolean condition)
public Object getDeclaredFieldValue(Object instance, String fieldName) throws IllegalAccessException
IllegalAccessExceptionpublic Object invokeMethod(Object instance, String methodName, Object... parameters) throws InvocationTargetException, IllegalAccessException
public Object invokeDeclaredMethod(Object instance, String methodName, Object... parameters) throws InvocationTargetException, IllegalAccessException
public String getPackageName()
public Class<?> getSuperclass()
Super Class (Class.getSuperclass())public BetterReflectionClass getBetterReflectionSuperClass()
getSuperclass() as BetterReflectionClasspublic boolean isRunningFromJar()
public JarFile getJar()
public File getJarFile()
public boolean isAssignableFrom(Class<?> clasz)
public boolean isAssignableFrom(BetterReflectionClass clasz)
public void dumpMethodHeaders()
public void dumpMethodHeaders(boolean includeModifiers)
includeModifiers - whether the method's modifiers should be dumpedpublic void dumpMethodHeaders(boolean includeModifiers,
boolean includeReturnType)
includeModifiers - whether the method's modifiers should be dumpedincludeReturnType - whether the method's return type should be dumpedpublic void dumpMethodHeaders(boolean includeModifiers,
boolean includeReturnType,
boolean includeParameterNames)
includeModifiers - whether the method's modifiers should be dumpedincludeReturnType - whether the method's return type should be dumpedincludeParameterNames - whether the method's parameter names should be dumpedCopyright © 2024. All rights reserved.