模块 java.compiler

接口 Element

所有父级接口:
AnnotatedConstruct
所有已知的子接口:
ExecutableElement , ModuleElement , PackageElement , Parameterizable , QualifiedNameable , RecordComponentElement , TypeElement , TypeParameterElement , VariableElement

public interface Element extends AnnotatedConstruct
表示程序元素,例如模块、包、类或方法。每个元素代表一个编译时语言级构造(而不是,例如,虚拟机的运行时构造)。

应使用 equals(Object) 方法比较元素。无法保证任何特定元素将始终由同一对象表示。

要基于 Element 对象的类实现操作,请使用 游客 或使用 getKind() 方法的结果。使用 instanceofnot 必然是确定此建模层次结构中对象的有效类的可靠习惯用法,因为实现可以选择让单个对象实现多个 Element 子接口。

自从:
1.6
参见: