Example usage for javax.annotation.processing ProcessingEnvironment getFiler

List of usage examples for javax.annotation.processing ProcessingEnvironment getFiler

Introduction

In this page you can find the example usage for javax.annotation.processing ProcessingEnvironment getFiler.

Prototype

Filer getFiler();

Source Link

Document

Returns the filer used to create new source, class, or auxiliary files.

Usage

From source file:org.jannocessor.processor.JannocessorProcessorBase.java

@Override
public synchronized void init(ProcessingEnvironment env) {
    // overwrite the class loader set by the Maven plugin
    Thread.currentThread().setContextClassLoader(JannocessorEngine.class.getClassLoader());

    super.init(env);

    try {/*from w  w w.jav a  2 s.  c om*/
        messager = env.getMessager();
        JannocessorLogger.messager = messager;

        elementUtils = env.getElementUtils();
        typeUtils = env.getTypeUtils();
        filer = env.getFiler();
        options = new Config(env.getOptions());
        injector = createInjector();

        processOptions();

        logger.info("Initializing services...");

        engine = injector.getInstance(JannocessorEngine.class);
        engine.configure(engine.getTemplatesPath(), true);

        // recompileProcessors();

        Class<?> hotConfig = Jannocessor.reloadClass("org.jannocessor.config.Processors",
                Power.emptyList(String.class));
        processorsConfig = new ProcessorsConfiguration(hotConfig);

        showConfiguration();

        logger.info("Initialization finished.");
    } catch (Exception e) {
        logger.error("Initialization failed!");
        valid = false;
        throw new RuntimeException(e);
    }
}

From source file:co.touchlab.squeaky.processor.AnnotationProcessor.java

@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    typeUtils = processingEnv.getTypeUtils();
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
}