com.google.auto.value.processor.ExtensionContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of auto-value Show documentation
Show all versions of auto-value Show documentation
Immutable value-type code generation for Java 1.6+.
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