Search in sources :

Example 1 with ElementDecoration

use of com.webcohesion.enunciate.javac.decorations.ElementDecoration in project enunciate by stoicflame.

the class EnunciateAnnotationProcessor method init.

@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());
        }
    }
}
Also used : EnunciateModule(com.webcohesion.enunciate.module.EnunciateModule) ContextModifyingModule(com.webcohesion.enunciate.module.ContextModifyingModule) ElementDecoration(com.webcohesion.enunciate.javac.decorations.ElementDecoration) AnnotationMirrorDecoration(com.webcohesion.enunciate.javac.decorations.AnnotationMirrorDecoration) TypeMirrorDecoration(com.webcohesion.enunciate.javac.decorations.TypeMirrorDecoration) DecoratedProcessingEnvironment(com.webcohesion.enunciate.javac.decorations.DecoratedProcessingEnvironment)

Aggregations

AnnotationMirrorDecoration (com.webcohesion.enunciate.javac.decorations.AnnotationMirrorDecoration)1 DecoratedProcessingEnvironment (com.webcohesion.enunciate.javac.decorations.DecoratedProcessingEnvironment)1 ElementDecoration (com.webcohesion.enunciate.javac.decorations.ElementDecoration)1 TypeMirrorDecoration (com.webcohesion.enunciate.javac.decorations.TypeMirrorDecoration)1 ContextModifyingModule (com.webcohesion.enunciate.module.ContextModifyingModule)1 EnunciateModule (com.webcohesion.enunciate.module.EnunciateModule)1