软件包 | 描述 |
---|---|
javax.annotation.processing |
用于声明注释处理器的设施和允许注释处理器与注释处理工具环境进行通信的设施。
|
javax.lang.model.element |
使用java编程语言的模型元素的接口。
|
javax.lang.model.type |
用java编程语言类型的接口模型。
|
javax.lang.model.util |
公用事业在帮助
program elements和
types处理。
|
Modifier and Type | Method and Description |
---|---|
Set<? extends Element> |
RoundEnvironment.getElementsAnnotatedWith(类<? extends Annotation> a)
返回与给定注释类型的注释的元素。
|
Set<? extends Element> |
RoundEnvironment.getElementsAnnotatedWith(TypeElement a)
返回与给定注释类型的注释的元素。
|
Set<? extends Element> |
RoundEnvironment.getRootElements()
返回由前一轮生成的注释处理的根元素。
|
Modifier and Type | Method and Description |
---|---|
JavaFileObject |
Filer.createClassFile(CharSequence name, Element... originatingElements)
创建一个新的类文件,并返回一个对象,让它给它写。
|
FileObject |
Filer.createResource(JavaFileManager.Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements)
创建一个新的辅助资源文件,并为其返回一个文件对象。
|
JavaFileObject |
Filer.createSourceFile(CharSequence name, Element... originatingElements)
创建一个新的源文件,并返回一个对象,让它给它写。
|
Iterable<? extends Completion> |
AbstractProcessor.getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText)
返回一个完成空。
|
Iterable<? extends Completion> |
Processor.getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText)
返回到工具基础设施建议完成注释一个。
|
void |
Messager.printMessage(Diagnostic.Kind kind, CharSequence msg, Element e)
在元素的位置上打印指定类型的消息。
|
void |
Messager.printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a)
在注释元素的注释镜像的位置上打印指定类型的消息。
|
void |
Messager.printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a, AnnotationValue v)
在注释元素的注释镜像中的注释值的位置上打印指定类型的消息。
|
Modifier and Type | Interface and Description |
---|---|
interface |
ExecutableElement
表示的方法,构造函数,初始化(或静态或实例)的类或接口,包括注释类型的元素。
|
interface |
PackageElement
表示一个包程序元素。
|
interface |
Parameterizable
一种元素,类型参数混合接口。
|
interface |
QualifiedNameable
一种元素,有一个合格的名称混合接口。
|
interface |
TypeElement
表示一个类或接口程序元素。
|
interface |
TypeParameterElement
表示泛型类、接口、方法或构造函数元素的形式类型参数。
|
interface |
VariableElement
代表一个领域,
枚举 常数的方法或构造函数的参数,局部变量,资源变量,或异常参数。
|
Modifier and Type | Method and Description |
---|---|
Element |
Element.getEnclosingElement()
返回此元素的内部元素,松散地说,封闭的。
|
Element |
VariableElement.getEnclosingElement()
返回此变量的封闭元素。
|
Element |
TypeParameterElement.getEnclosingElement()
返回此类型参数的
generic element。
|
Element |
PackageElement.getEnclosingElement()
返回
null 自包不是一元封闭。
|
Element |
TypeElement.getEnclosingElement()
返回一个顶级类型的包并返回上一
nested立即封闭式元件。
|
Element |
TypeParameterElement.getGenericElement()
返回由该类型参数参数化参数的泛型类、接口、方法或构造函数。
|
Element |
UnknownElementException.getUnknownElement()
返回未知元素。
|
Modifier and Type | Method and Description |
---|---|
List<? extends Element> |
Element.getEnclosedElements()
返回由该元素直接包含的元素,这个元素是松散的。
|
List<? extends Element> |
PackageElement.getEnclosedElements()
返回
top-level类和接口在这个包。
|
List<? extends Element> |
TypeElement.getEnclosedElements()
返回在这个类或接口中直接声明的字段、方法、构造函数和成员类型。
|
Modifier and Type | Method and Description |
---|---|
R |
ElementVisitor.visit(Element e)
一个方便的方法相当于
v.visit(e, null) 。
|
R |
ElementVisitor.visit(Element e, P p)
访问元素。
|
R |
ElementVisitor.visitUnknown(Element e, P p)
拜访一个未知的元素。
|
Constructor and Description |
---|
UnknownElementException(Element e, Object p)
创建一个新的
UnknownElementException 。
|
Modifier and Type | Method and Description |
---|---|
Element |
TypeVariable.asElement()
返回对应于此类型变量的元素。
|
Element |
DeclaredType.asElement()
返回对应于该类型的元素。
|
Modifier and Type | Method and Description |
---|---|
Element |
Types.asElement(TypeMirror t)
返回对应于类型的元素。
|
Modifier and Type | Method and Description |
---|---|
List<? extends Element> |
Elements.getAllMembers(TypeElement type)
返回一个类型元素的所有成员,无论是否直接继承或声明。
|
Modifier and Type | Method and Description |
---|---|
TypeMirror |
Types.asMemberOf(DeclaredType containing, Element element)
返回一个元素的类型,当该元素被视为一个成员,或其他直接包含的,一个给定的类型。
|
protected R |
SimpleElementVisitor6.defaultAction(Element e, P p)
访问方法的默认操作。
|
List<? extends AnnotationMirror> |
Elements.getAllAnnotationMirrors(Element e)
返回所有注释目前元素上,无论直接或通过继承。
|
String |
Elements.getDocComment(Element e)
返回文档的文本(“文档”)元素的评论。
|
PackageElement |
Elements.getPackageOf(Element type)
返回元素的包。
|
boolean |
Elements.hides(Element hider, Element hidden)
测试一个类型、方法或字段是否隐藏另一个。
|
boolean |
Elements.isDeprecated(Element e)
返回
true 如果元素是过时的,
false 否则。
|
void |
Elements.printElements(Writer w, Element... elements)
将元素的表示形式打印到给定的指定顺序中的元素的表示形式。
|
R |
ElementScanner6.scan(Element e)
方便的方法相当于
v.scan(e, null) 。
|
R |
ElementScanner6.scan(Element e, P p)
通过调用
e.accept(this, p) 元素的过程;这种方法可以被子类重写。
|
R |
AbstractElementVisitor6.visit(Element e)
访问任何程序元素如通过本身的元素的
accept 方法和额外的参数传递
null 。
|
R |
AbstractElementVisitor6.visit(Element e, P p)
访问任何程序元素如通过本身的元素的
accept 方法。
|
R |
AbstractElementVisitor6.visitUnknown(Element e, P p)
拜访一个未知的元素。
|
Modifier and Type | Method and Description |
---|---|
static List<ExecutableElement> |
ElementFilter.constructorsIn(Iterable<? extends Element> elements)
返回一个在
elements 构造函数列表。
|
static Set<ExecutableElement> |
ElementFilter.constructorsIn(Set<? extends Element> elements)
返回
elements 一组构造函数。
|
static List<VariableElement> |
ElementFilter.fieldsIn(Iterable<? extends Element> elements)
返回一个列表中的字段
elements 。
|
static Set<VariableElement> |
ElementFilter.fieldsIn(Set<? extends Element> elements)
返回一组字段
elements 。
|
static List<ExecutableElement> |
ElementFilter.methodsIn(Iterable<? extends Element> elements)
返回一个列表的方法
elements 。
|
static Set<ExecutableElement> |
ElementFilter.methodsIn(Set<? extends Element> elements)
返回一组方法
elements 。
|
static List<PackageElement> |
ElementFilter.packagesIn(Iterable<? extends Element> elements)
返回一个列表,包在
elements 。
|
static Set<PackageElement> |
ElementFilter.packagesIn(Set<? extends Element> elements)
返回一组包在
elements 。
|
R |
ElementScanner6.scan(Iterable<? extends Element> iterable, P p)
遍历给定的元素,每一个电话
scan(Element, P) 。
|
static List<TypeElement> |
ElementFilter.typesIn(Iterable<? extends Element> elements)
返回一个列表的类型
elements 。
|
static Set<TypeElement> |
ElementFilter.typesIn(Set<? extends Element> elements)
返回一组类型
elements 。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.