Java Code Examples for javax.annotation.processing.ProcessingEnvironment#getFiler()

The following examples show how to use javax.annotation.processing.ProcessingEnvironment#getFiler() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CombinedStateAutoValueExtension.java    From reductor with Apache License 2.0 6 votes vote down vote up
@Override
public boolean applicable(Context context) {
    TypeElement typeElement = context.autoValueClass();
    boolean isApplicable = typeElement.getAnnotation(CombinedState.class) != null;
    if (isApplicable) {
        ProcessingEnvironment processingEnvironment = context.processingEnvironment();
        Env env = new Env(processingEnvironment.getTypeUtils(), processingEnvironment.getElementUtils(), processingEnvironment.getMessager(), processingEnvironment.getFiler());
        try {
            CombinedStateElement combinedStateElement = CombinedStateElement.parseAutoValueCombinedElement(typeElement, context.properties());
            CombinedStateProcessingStep.emmitCombinedReducer(env, combinedStateElement, ClassName.get(context.packageName(), "AutoValue_" + context.autoValueClass().getSimpleName()));
        } catch (ValidationException ve) {
            env.printError(ve.getElement(), ve.getMessage());
        } catch (Exception e) {
            env.printError(typeElement, "Internal processor error:\n" + e.getMessage());
            e.printStackTrace();
        }
    }

    return false;
}
 
Example 2
Source File: AutoMatterProcessor.java    From auto-matter with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(final ProcessingEnvironment processingEnv) {
  super.init(processingEnv);
  filer = processingEnv.getFiler();
  elements = processingEnv.getElementUtils();
  types = processingEnv.getTypeUtils();
  this.messager = processingEnv.getMessager();
}
 
Example 3
Source File: HighLiteProcessor.java    From HighLite with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(final ProcessingEnvironment processingEnv) {
    mElementUtils = processingEnv.getElementUtils();
    mTypeUtils = processingEnv.getTypeUtils();
    mFiler = processingEnv.getFiler();
    mMessager = processingEnv.getMessager();
}
 
Example 4
Source File: BaseProcess.java    From EasyRouter with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    typeUtils = processingEnv.getTypeUtils();
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
}
 
Example 5
Source File: BuilderProcessor.java    From customview-samples with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    messager = processingEnv.getMessager();
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
}
 
Example 6
Source File: FlapProcessor.java    From Flap with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(final ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    filer = processingEnv.getFiler();               // Generate class.
    types = processingEnv.getTypeUtils();            // Get type utils.
    elements = processingEnv.getElementUtils();      // Get class meta.
    messager = processingEnv.getMessager();
    messager.printMessage(Diagnostic.Kind.NOTE, "FlapProcessor init");

    Map<String, String> options = processingEnv.getOptions();
    if (options.containsKey(KEY_OPTION_AUTO_REGISTER)) {
        autoRegisterFactories = Boolean.parseBoolean(options.get(KEY_OPTION_AUTO_REGISTER));
    }
}
 
Example 7
Source File: InjectPreferenceProcessor.java    From saber with Apache License 2.0 5 votes vote down vote up
@Override public synchronized void init(ProcessingEnvironment env) {
  super.init(env);

  elementUtils = env.getElementUtils();
  typeUtils = env.getTypeUtils();
  filer = env.getFiler();
}
 
Example 8
Source File: ToothpickProcessor.java    From toothpick with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
  super.init(processingEnv);

  elementUtils = processingEnv.getElementUtils();
  typeUtils = processingEnv.getTypeUtils();
  filer = processingEnv.getFiler();
}
 
Example 9
Source File: DataLoaderProcessor.java    From DataLoader with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
    super.init(processingEnvironment);
    filer = processingEnvironment.getFiler();
    types = processingEnvironment.getTypeUtils();
    elements = processingEnvironment.getElementUtils();
}
 
Example 10
Source File: BaseProcessor.java    From sqlitemagic with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment env) {
  super.init(env);
  environment = new Environment(
      env.getMessager(),
      env.getElementUtils(),
      env.getTypeUtils(),
      env.getFiler()
  );
  objectGraph = createObjectGraph(env);
  parseCompilerArguments(environment, env.getOptions());
  processingSteps = ImmutableSet.<ProcessingStep>builder()
      .addAll(Arrays.asList(
          new DatabaseConfigurationCollectionStep(),
          new TransformerCollectionStep(),
          new TransformerCodeGenerationStep(),
          new ModelCollectionStep(),
          new ModelCodeGenerationStep(),
          new ViewCollectionStep(),
          new ViewCodeGenerationStep(),
          new IndexCollectionStep(),
          new GenClassesManagerStep()
      ))
      .addAll(processingSteps())
      .build();
  Const.init(environment);
}
 
Example 11
Source File: PrettyBundleProcessor.java    From PrettyBundle with Apache License 2.0 5 votes vote down vote up
@Override public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    typeUtils = processingEnv.getTypeUtils();
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
}
 
Example 12
Source File: Processor.java    From GoldenGate with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    instance = this;
    typeUtils = processingEnv.getTypeUtils();
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
}
 
Example 13
Source File: DeepLinkInjectProcessor.java    From OkDeepLink with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    logger = new Logger(processingEnv.getMessager());
    filer = processingEnv.getFiler();
    elements = processingEnv.getElementUtils();
    types = processingEnv.getTypeUtils();
}
 
Example 14
Source File: AutoBundleProcessor.java    From AutoBundle with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
    elementUtils = processingEnv.getElementUtils();
    typeUtils = processingEnv.getTypeUtils();
}
 
Example 15
Source File: ParcelerModule.java    From parceler with Apache License 2.0 4 votes vote down vote up
@Provides
@Singleton
public Filer getFiler(ProcessingEnvironment processingEnvironment){
    return processingEnvironment.getFiler();
}
 
Example 16
Source File: FileUtil.java    From dart with Apache License 2.0 4 votes vote down vote up
public FileUtil(ProcessingEnvironment processingEnv) {
  filer = processingEnv.getFiler();
}
 
Example 17
Source File: DeepLinkInterceptorProcessor.java    From OkDeepLink with Apache License 2.0 4 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    logger = new Logger(processingEnv.getMessager());
    filer = processingEnv.getFiler();
}
 
Example 18
Source File: HTRouterDispatchProcess.java    From ht-universalrouter-android with MIT License 4 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    messager = processingEnv.getMessager();
    filer = processingEnv.getFiler();
}
 
Example 19
Source File: PGProcessor.java    From ParcelableGenerator with MIT License 4 votes vote down vote up
@Override
public synchronized void init(ProcessingEnvironment env) {
    super.init(env);

    filer = env.getFiler();
}
 
Example 20
Source File: PreferenceBinderProcessor.java    From preferencebinder with Apache License 2.0 4 votes vote down vote up
@Override public synchronized void init(ProcessingEnvironment env) {
    super.init(env);
    elementUtils = env.getElementUtils();
    filer = env.getFiler();
}