类 EntityField
- java.lang.Object
-
- tk.mybatis.mapper.entity.EntityField
-
public class EntityField extends Object
封装字段和方法,统一调用某些方法- 作者:
- liuzh
-
-
构造器概要
构造器 构造器 说明 EntityField(Field field, PropertyDescriptor propertyDescriptor)构造方法
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcopyFromPropertyDescriptor(EntityField other)先创建field,然后可以通过该方法获取property等属性booleanequals(Object o)<T extends Annotation>
TgetAnnotation(Class<T> annotationClass)获取指定的注解Class<?>getJavaType()获取javaTypeStringgetName()字段属性名ObjectgetValue(Object object)反射获取值inthashCode()booleanisAnnotationPresent(Class<? extends Annotation> annotationClass)是否有该注解voidsetJavaType(Class<?> javaType)设置javaType
-
-
-
构造器详细资料
-
EntityField
public EntityField(Field field, PropertyDescriptor propertyDescriptor)
构造方法- 参数:
field- 字段propertyDescriptor- 字段name对应的property
-
-
方法详细资料
-
copyFromPropertyDescriptor
public void copyFromPropertyDescriptor(EntityField other)
先创建field,然后可以通过该方法获取property等属性- 参数:
other-
-
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
是否有该注解- 参数:
annotationClass-- 返回:
-
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
获取指定的注解- 类型参数:
T-- 参数:
annotationClass-- 返回:
-
getValue
public Object getValue(Object object) throws IllegalAccessException, InvocationTargetException
反射获取值- 参数:
object-- 返回:
- 抛出:
IllegalAccessExceptionInvocationTargetException
-
getJavaType
public Class<?> getJavaType()
获取javaType- 返回:
-
setJavaType
public void setJavaType(Class<?> javaType)
设置javaType- 参数:
javaType-
-
getName
public String getName()
字段属性名- 返回:
-
-