public class ClassUtils
extends org.apache.commons.lang3.ClassUtils
ClassUtils
构造器和说明 |
---|
ClassUtils() |
限定符和类型 | 方法和说明 |
---|---|
static Field[] |
getAllFields(Class<?> clazz)
获取类的所有声明的字段,即包括 public、protected、private 和 default,包括父类申明的字段
|
static Field[] |
getFields(Class<?> clazz)
获取类的所有声明的字段,即包括 public、protected、private 和 default,但是不包括父类申明的字段
|
static <T> T |
instantiate(Class<T> clazz,
Object... args) |
static Object |
invoke(Object object,
Method method)
调用类方法
|
static Object |
invoke(Object object,
Method method,
Object... arguments)
调用类方法
|
convertClassesToClassNames, convertClassNamesToClasses, getAbbreviatedName, getAbbreviatedName, getAllInterfaces, getAllSuperclasses, getCanonicalName, getCanonicalName, getCanonicalName, getCanonicalName, getClass, getClass, getClass, getClass, getName, getName, getName, getName, getPackageCanonicalName, getPackageCanonicalName, getPackageCanonicalName, getPackageName, getPackageName, getPackageName, getPublicMethod, getShortCanonicalName, getShortCanonicalName, getShortCanonicalName, getShortClassName, getShortClassName, getShortClassName, getSimpleName, getSimpleName, getSimpleName, getSimpleName, hierarchy, hierarchy, isAssignable, isAssignable, isAssignable, isAssignable, isInnerClass, isPrimitiveOrWrapper, isPrimitiveWrapper, primitivesToWrappers, primitiveToWrapper, toClass, wrappersToPrimitives, wrapperToPrimitive
public static <T> T instantiate(Class<T> clazz, Object... args) throws ClassInstantiationException
public static Field[] getFields(Class<?> clazz)
clazz
- 类public static Field[] getAllFields(Class<?> clazz)
clazz
- 类public static Object invoke(Object object, Method method) throws InvocationTargetException, IllegalAccessException
object
- 类实例method
- 类方法InvocationTargetException
- 反射异常,当被调用的方法的内部抛出了异常而没有被捕获时,将由此异常接收IllegalAccessException
- IllegalAccessException
public static Object invoke(Object object, Method method, Object... arguments) throws InvocationTargetException, IllegalAccessException
object
- 类实例method
- 类方法arguments
- 方法参数InvocationTargetException
- 反射异常,当被调用的方法的内部抛出了异常而没有被捕获时,将由此异常接收IllegalAccessException
- IllegalAccessException
Copyright © 2023 buession.com Inc.. All rights reserved.