org.apache.beehive.controls.runtime.generator.apt
Class ControlClientAnnotationProcessor

Object
  extended by Diagnostics
      extended by TwoPhaseAnnotationProcessor
          extended by ControlClientAnnotationProcessor
All Implemented Interfaces:
AnnotationProcessor

public class ControlClientAnnotationProcessor
extends TwoPhaseAnnotationProcessor


Constructor Summary
ControlClientAnnotationProcessor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env)
           
 
Method Summary
 void check(Declaration d)
          The check method is responsible for all semantic validation of the input Declaration.
 void generate()
          Each control client requires a manifest that documents the controls that it references.
 void generate(Declaration decl)
          The generate method is responsible for the generation of any additional artifacts (source, class, or binary) that are derived from the input Declaration.
protected  CodeGenerator getGenerator()
          Returns the CodeGenerator instance supporting this processor, instantiating a new generator instance if necessary.
 
Methods inherited from class TwoPhaseAnnotationProcessor
check, getResourceString, printError, printWarning, process
 
Methods inherited from class Diagnostics
addError, addError, addError, addErrorArrayArgs, addWarning, addWarning, addWarning, getAnnotationProcessorEnvironment, hasErrors, setHasErrors
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlClientAnnotationProcessor

public ControlClientAnnotationProcessor(Set<AnnotationTypeDeclaration> atds,
                                        AnnotationProcessorEnvironment env)
Method Detail

check

public void check(Declaration d)
Description copied from class: TwoPhaseAnnotationProcessor
The check method is responsible for all semantic validation of the input Declaration.

All semantic errors/warnings associated with the input Declaration should be output during check via the TwoPhaseAnnotationProcessor.printError(com.sun.mirror.declaration.Declaration, java.lang.String, java.lang.Object...) and TwoPhaseAnnotationProcessor.printWarning(com.sun.mirror.declaration.Declaration, java.lang.String, java.lang.Object...) methods. If an implementation bypasses printError, it must override Diagnostics.hasErrors() to ensure correct behaviour.

If the presence of the input Declaration implies the need to add new files, and those files need to be visible during the check phase for other Declarations, then the AnnotationProcessorEnvironment's Filer API should be used to add those files in this phase. The adding of such files at this point should typically not result in their emission to persistent storage (i.e. disk), but rather be kept in memory to be referenced by the check phase of other Declarations.

Specified by:
check in class TwoPhaseAnnotationProcessor

generate

public void generate()
              throws CodeGenerationException
Each control client requires a manifest that documents the controls that it references.

Overrides:
generate in class TwoPhaseAnnotationProcessor
Throws:
CodeGenerationException

generate

public void generate(Declaration decl)
Description copied from class: TwoPhaseAnnotationProcessor
The generate method is responsible for the generation of any additional artifacts (source, class, or binary) that are derived from the input Declaration.

Specified by:
generate in class TwoPhaseAnnotationProcessor

getGenerator

protected CodeGenerator getGenerator()
Returns the CodeGenerator instance supporting this processor, instantiating a new generator instance if necessary.