| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
entityClass
所在实体类类型
|
protected Field |
field
对应实体类中的 Java 字段(可以自己扩展方法注解)
|
| Constructor and Description |
|---|
EntityField() |
EntityField(Class<?> entityClass,
Field field) |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(Object obj)
反射获取字段值
|
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
获取字段上的指定注解信息
|
Annotation[] |
getAnnotations()
获取字段上的全部注解信息
|
Class<?> |
getDeclaringClass() |
String |
getName() |
Class<?> |
getType() |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
字段上是否配置了指定的注解
|
void |
set(Object obj,
Object value)
反射设置字段值
|
protected Class<?> entityClass
protected Field field
public Class<?> getDeclaringClass()
public String getName()
public Class<?> getType()
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
T - annotationClass - 注解类型public Annotation[] getAnnotations()
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
annotationClass - 注解类型Copyright © 2022. All rights reserved.