Example usage for javax.annotation.processing ProcessingEnvironment getOptions

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

Introduction

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

Prototype

Map<String, String> getOptions();

Source Link

Document

Returns the processor-specific options passed to the annotation processing tool.

Usage

From source file:com.webguys.djinn.marid.util.BuiltinAnnotationProcessor.java

@Override
public void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    this.db = new File(processingEnv.getOptions().get("baseDirectory"), DB_PATHNAME);
}

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 ww  w. j  av a 2  s  . c o m
        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);
    }
}