@Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); //set up the processing environment. ArrayList<ElementDecoration> elementDecorations = new ArrayList<ElementDecoration>(); ArrayList<TypeMirrorDecoration> typeMirrorDecorations = new ArrayList<TypeMirrorDecoration>(); ArrayList<AnnotationMirrorDecoration> annotationMirrorDecorations = new ArrayList<AnnotationMirrorDecoration>(); DecoratedProcessingEnvironment processingEnvironment = new DecoratedProcessingEnvironment(processingEnv, elementDecorations, typeMirrorDecorations, annotationMirrorDecorations); //construct a context. this.context = new EnunciateContext(processingEnvironment, this.enunciate.getLogger(), this.enunciate.getApiRegistry(), this.enunciate.getConfiguration(), this.enunciate.getIncludePatterns(), this.enunciate.getExcludePatterns(), this.enunciate.getClasspath()); //initialize the modules. for (EnunciateModule module : this.enunciate.getModules()) { module.init(this.context); if (module instanceof ContextModifyingModule) { ContextModifyingModule contextModifier = (ContextModifyingModule) module; elementDecorations.addAll(contextModifier.getElementDecorations()); typeMirrorDecorations.addAll(contextModifier.getTypeMirrorDecorations()); annotationMirrorDecorations.addAll(contextModifier.getAnnotationMirrorDecorations()); } } }
@Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); //set up the processing environment. ArrayList<ElementDecoration> elementDecorations = new ArrayList<ElementDecoration>(); ArrayList<TypeMirrorDecoration> typeMirrorDecorations = new ArrayList<TypeMirrorDecoration>(); ArrayList<AnnotationMirrorDecoration> annotationMirrorDecorations = new ArrayList<AnnotationMirrorDecoration>(); DecoratedProcessingEnvironment processingEnvironment = new DecoratedProcessingEnvironment(processingEnv, elementDecorations, typeMirrorDecorations, annotationMirrorDecorations); //construct a context. this.context = new EnunciateContext(processingEnvironment, this.enunciate.getLogger(), this.enunciate.getApiRegistry(), this.enunciate.getConfiguration(), this.enunciate.getIncludePatterns(), this.enunciate.getExcludePatterns(), this.enunciate.getClasspath()); //initialize the modules. for (EnunciateModule module : this.enunciate.getModules()) { module.init(this.context); if (module instanceof ContextModifyingModule) { ContextModifyingModule contextModifier = (ContextModifyingModule) module; elementDecorations.addAll(contextModifier.getElementDecorations()); typeMirrorDecorations.addAll(contextModifier.getTypeMirrorDecorations()); annotationMirrorDecorations.addAll(contextModifier.getAnnotationMirrorDecorations()); } } }