/** * Default implementation ensures only one APT round does any work and establishes the context before instantiating the processor. * * @param set The relevant annotation types. * @param env The environment. * @return The processor. */ public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> set, AnnotationProcessorEnvironment env) { if (++round > 1) { //we only process one round... //todo: think of some way to process more than one round? return AnnotationProcessors.NO_OP; } AnnotationProcessorEnvironment ape = decorateEnvironment(env); if (ape.getOptions().containsKey(DECLARATION_DECORATOR_OPTION)) { System.setProperty(DeclarationDecorator.class.getName(), ape.getOptions().get(DECLARATION_DECORATOR_OPTION)); } if (ape.getOptions().containsKey(TYPE_DECORATOR_OPTION)) { System.setProperty(TypeMirrorDecorator.class.getName(), ape.getOptions().get(TYPE_DECORATOR_OPTION)); } Context.setCurrentEnvironment(ape); return getProcessorFor(set); }