public abstract class AbstractProcessor extends Object implements Processor
getter方法可以issue warnings关于使用处理器后可利用的设施值得注意条件已经initialized 。
 只要符合该方法的一般规范Processor ,子类就可以覆盖此类中任何方法的实现和规范。 
| Modifier and Type | Field and Description | 
|---|---|
| protected ProcessingEnvironment | processingEnv
              由工具框架提供的处理环境。 
             | 
| Modifier | Constructor and Description | 
|---|---|
| protected  | AbstractProcessor()
              调用子类的构造方法。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| Iterable<? extends Completion> | getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText)
              返回一个完整的空的可迭代。 
             | 
| Set<String> | getSupportedAnnotationTypes() 
             如果处理器类是带有加注解的 SupportedAnnotationTypes,则返回一个不可修改的组具有相同的一组字符串作为注释的。 | 
| Set<String> | getSupportedOptions() 
             如果处理器类是带有加注解的 SupportedOptions,则返回一个不可修改的组具有相同的一组字符串作为注释的。 | 
| SourceVersion | getSupportedSourceVersion() 
             如果处理器类注释为 SupportedSourceVersion,则返回注释中的源版本。 | 
| void | init(ProcessingEnvironment processingEnv)
              通过将 
              processingEnv字段设置为processingEnv参数的值,通过处理processingEnv。 | 
| protected boolean | isInitialized() | 
| abstract boolean | process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
              对来自前一轮的类型元素处理一组注释类型,并返回此处理器是否声明这些注释类型。 
             | 
protected ProcessingEnvironment processingEnv
public Set<String> getSupportedOptions()
SupportedOptions ,则返回一个不可修改的组具有相同的一组字符串作为注释的。 
           如果类没有这样注释,则返回一个空集合。 
          getSupportedOptions在界面 
            Processor 
           SupportedOptions 
           public Set<String> getSupportedAnnotationTypes()
SupportedAnnotationTypes ,则返回一个不可修改的组具有相同的一组字符串作为注释的。 
           如果类没有这样注释,则返回一个空集合。 
          getSupportedAnnotationTypes在界面 
            Processor 
           SupportedAnnotationTypes 
           public SourceVersion getSupportedSourceVersion()
SupportedSourceVersion ,则返回注释中的源版本。 
           如果类没有这样注释, 那么返回SourceVersion.RELEASE_6 。 
          getSupportedSourceVersion在界面 
            Processor 
           SupportedSourceVersion , ProcessingEnvironment.getSourceVersion() 
           public void init(ProcessingEnvironment processingEnv)
processingEnv字段设置为processingEnv参数的值,通过处理processingEnv 。 
           如果在同一对象上多次调用此方法,则将抛出IllegalStateException 。 
          init在界面 
            Processor 
           processingEnv - 工具框架向处理器提供访问环境的环境 
           IllegalStateException - 如果这个方法被调用不止一次。 
           public abstract boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
true ,则会声明注释类型,不会要求后续处理器进行处理; 
           如果返回false ,则注释类型是无人认领的,并且后处理器可能被要求处理它们。 
           处理器可以总是返回相同的布尔值,或者可以根据所选择的标准来改变结果。 
            如果处理器支持"*"并且根元素没有注释,输入集将为空。 A Processor必须优雅地处理一组空的注释。 
public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText)
getCompletions在界面 
            Processor 
           element - 要注释的元素 
           annotation - (可能是部分的)注释被应用于元素 
           member - 返回可能的完成的注释成员 
           userText - 要完成的源代码文本 
           protected boolean isInitialized()
true如果此对象已初始化, 
            false false。 
            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.