public interface ProcessingEnvironment {
Map<String, String> getOptions();
Messager getMessager();
Filer getFiler(); //获取Filer
Elements getElementUtils(); //Elements
Types getTypeUtils(); //获取Types
SourceVersion getSourceVersion();
Locale getLocale();
}
public interface Elements {
PackageElement getPackageElement(CharSequence var1); //获取指定Element的PackageElement
TypeElement getTypeElement(CharSequence var1);//获取TypeElement
}
package com.example; // PackageElement
public class Foo { // TypeElement
private int a; // VariableElement
private Foo other; // VariableElement
public Foo () {} // ExecuteableElement
public void setA ( // ExecuteableElement
int newA // VariableElement
) {}
}
public interface Element extends AnnotatedConstruct {
TypeMirror asType();//获取TypeMirror
ElementKind getKind(); //获取ElementKind
Set<Modifier> getModifiers();
Name getSimpleName();
Element getEnclosingElement();
List<? extends Element> getEnclosedElements();
boolean equals(Object var1);
int hashCode();
List<? extends AnnotationMirror> getAnnotationMirrors();
<A extends Annotation> A getAnnotation(Class<A> var1);
<R, P> R accept(ElementVisitor<R, P> var1, P var2);
}