Class FieldMetadata
java.lang.Object
cloud.opencode.base.classloader.metadata.FieldMetadata
Field Metadata - Immutable field information
字段元数据 - 不可变的字段信息
Represents field metadata read from class files without loading the class.
表示从类文件读取的字段元数据,无需加载类。
Features | 主要功能:
- Field type and name - 字段类型和名称
- Modifier information - 修饰符信息
- Constant value access - 常量值访问
- Annotation information - 注解信息
Usage Examples | 使用示例:
FieldMetadata field = classMetadata.fields().get(0);
String name = field.fieldName();
String type = field.fieldType();
boolean isStatic = field.isStatic();
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是 (不可变)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-classloader V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFieldMetadata(String fieldName, String fieldType, int modifiers, Object constantValue, List<AnnotationMetadata> annotations) Create field metadata 创建字段元数据 -
Method Summary
Modifier and TypeMethodDescriptionGet annotations 获取注解Get constant value 获取常量值booleanGet field name 获取字段名Get field type 获取字段类型getAnnotation(String annotationClassName) Get specified annotation 获取指定注解Get simple field type name 获取简单字段类型名booleanhasAnnotation(String annotationClassName) Check if has specified annotation 检查是否有指定注解booleanCheck if has constant value 检查是否有常量值inthashCode()booleanisFinal()Check if final 检查是否为 finalbooleanCheck if private 检查是否为 privatebooleanCheck if protected 检查是否为 protectedbooleanisPublic()Check if public 检查是否为 publicbooleanisStatic()Check if static 检查是否为静态booleanCheck if transient 检查是否为 transientbooleanCheck if volatile 检查是否为 volatileintGet modifiers 获取修饰符toString()
-
Constructor Details
-
FieldMetadata
public FieldMetadata(String fieldName, String fieldType, int modifiers, Object constantValue, List<AnnotationMetadata> annotations) Create field metadata 创建字段元数据- Parameters:
fieldName- field name | 字段名fieldType- field type | 字段类型modifiers- modifier flags | 修饰符标志constantValue- constant value | 常量值annotations- field annotations | 字段注解
-
-
Method Details
-
fieldName
-
fieldType
-
modifiers
public int modifiers()Get modifiers 获取修饰符- Returns:
- modifier flags | 修饰符标志
-
constantValue
-
annotations
Get annotations 获取注解- Returns:
- list of annotations | 注解列表
-
isStatic
public boolean isStatic()Check if static 检查是否为静态- Returns:
- true if static | 是静态返回 true
-
isFinal
public boolean isFinal()Check if final 检查是否为 final- Returns:
- true if final | 是 final 返回 true
-
isTransient
public boolean isTransient()Check if transient 检查是否为 transient- Returns:
- true if transient | 是 transient 返回 true
-
isVolatile
public boolean isVolatile()Check if volatile 检查是否为 volatile- Returns:
- true if volatile | 是 volatile 返回 true
-
isPublic
public boolean isPublic()Check if public 检查是否为 public- Returns:
- true if public | 是 public 返回 true
-
isPrivate
public boolean isPrivate()Check if private 检查是否为 private- Returns:
- true if private | 是 private 返回 true
-
isProtected
public boolean isProtected()Check if protected 检查是否为 protected- Returns:
- true if protected | 是 protected 返回 true
-
hasConstantValue
public boolean hasConstantValue()Check if has constant value 检查是否有常量值- Returns:
- true if has constant value | 有常量值返回 true
-
hasAnnotation
Check if has specified annotation 检查是否有指定注解- Parameters:
annotationClassName- annotation class name | 注解类名- Returns:
- true if has annotation | 有注解返回 true
-
getAnnotation
Get specified annotation 获取指定注解- Parameters:
annotationClassName- annotation class name | 注解类名- Returns:
- optional annotation | 可选的注解
-
getSimpleTypeName
Get simple field type name 获取简单字段类型名- Returns:
- simple type name | 简单类型名
-
equals
-
hashCode
-
toString
-