All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.auto.value.processor.ExtensionContext Maven / Gradle / Ivy

There is a newer version: 1.11.0
Show newest version
package com.google.auto.value.processor;

import com.google.auto.value.extension.AutoValueExtension;
import com.google.common.collect.ImmutableMap;

import java.util.Map;

import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;

class ExtensionContext implements AutoValueExtension.Context {

  private final ProcessingEnvironment processingEnvironment;
  private final TypeElement typeElement;
  private ImmutableMap properties;

  ExtensionContext(
      ProcessingEnvironment processingEnvironment,
      TypeElement typeElement,
      ImmutableMap properties) {
    this.processingEnvironment = processingEnvironment;
    this.typeElement = typeElement;
    this.properties = properties;
  }

  @Override
  public ProcessingEnvironment processingEnvironment() {
    return processingEnvironment;
  }

  @Override
  public String packageName() {
    return TypeSimplifier.packageNameOf(typeElement);
  }

  @Override
  public TypeElement autoValueClass() {
    return typeElement;
  }

  @Override
  public Map properties() {
    return properties;
  }

  public void setProperties(Map properties) {
    this.properties = ImmutableMap.copyOf(properties);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy