Package com.google.auto.value.processor
Class ExtensionContext
- java.lang.Object
-
- com.google.auto.value.processor.ExtensionContext
-
- All Implemented Interfaces:
AutoValueExtension.Context
class ExtensionContext extends java.lang.Object implements AutoValueExtension.Context
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableSet<javax.lang.model.element.ExecutableElement>abstractMethodsprivate javax.annotation.processing.ProcessingEnvironmentprocessingEnvironmentprivate com.google.common.collect.ImmutableMap<java.lang.String,javax.lang.model.element.ExecutableElement>propertiesprivate javax.lang.model.element.TypeElementtypeElement
-
Constructor Summary
Constructors Constructor Description ExtensionContext(javax.annotation.processing.ProcessingEnvironment processingEnvironment, javax.lang.model.element.TypeElement typeElement, com.google.common.collect.ImmutableMap<java.lang.String,javax.lang.model.element.ExecutableElement> properties, com.google.common.collect.ImmutableSet<javax.lang.model.element.ExecutableElement> abstractMethods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<javax.lang.model.element.ExecutableElement>abstractMethods()Returns the complete set of abstract methods defined in or inherited by the@AutoValueclass.javax.lang.model.element.TypeElementautoValueClass()Returns the annotated class that this generation cycle is based on.java.lang.StringpackageName()Returns the package name of the classes to be generated.javax.annotation.processing.ProcessingEnvironmentprocessingEnvironment()Returns the processing environment of this generation cycle.java.util.Map<java.lang.String,javax.lang.model.element.ExecutableElement>properties()Returns the ordered collection of properties to be generated by AutoValue.
-
-
-
Field Detail
-
processingEnvironment
private final javax.annotation.processing.ProcessingEnvironment processingEnvironment
-
typeElement
private final javax.lang.model.element.TypeElement typeElement
-
properties
private final com.google.common.collect.ImmutableMap<java.lang.String,javax.lang.model.element.ExecutableElement> properties
-
abstractMethods
private final com.google.common.collect.ImmutableSet<javax.lang.model.element.ExecutableElement> abstractMethods
-
-
Constructor Detail
-
ExtensionContext
ExtensionContext(javax.annotation.processing.ProcessingEnvironment processingEnvironment, javax.lang.model.element.TypeElement typeElement, com.google.common.collect.ImmutableMap<java.lang.String,javax.lang.model.element.ExecutableElement> properties, com.google.common.collect.ImmutableSet<javax.lang.model.element.ExecutableElement> abstractMethods)
-
-
Method Detail
-
processingEnvironment
public javax.annotation.processing.ProcessingEnvironment processingEnvironment()
Description copied from interface:AutoValueExtension.ContextReturns the processing environment of this generation cycle. This can be used, among other things, to produce compilation warnings or errors, usingProcessingEnvironment.getMessager().- Specified by:
processingEnvironmentin interfaceAutoValueExtension.Context
-
packageName
public java.lang.String packageName()
Description copied from interface:AutoValueExtension.ContextReturns the package name of the classes to be generated.- Specified by:
packageNamein interfaceAutoValueExtension.Context
-
autoValueClass
public javax.lang.model.element.TypeElement autoValueClass()
Description copied from interface:AutoValueExtension.ContextReturns the annotated class that this generation cycle is based on.Given
@AutoValue public class Foo {...}, this will beFoo.- Specified by:
autoValueClassin interfaceAutoValueExtension.Context
-
properties
public java.util.Map<java.lang.String,javax.lang.model.element.ExecutableElement> properties()
Description copied from interface:AutoValueExtension.ContextReturns the ordered collection of properties to be generated by AutoValue. Each key is a property name, and the corresponding value is the getter method for that property. For example, if propertybaris defined byabstract String getBar()then this map will have an entry mapping"bar"to theExecutableElementforgetBar().- Specified by:
propertiesin interfaceAutoValueExtension.Context
-
abstractMethods
public java.util.Set<javax.lang.model.element.ExecutableElement> abstractMethods()
Description copied from interface:AutoValueExtension.ContextReturns the complete set of abstract methods defined in or inherited by the@AutoValueclass. This includes all methods that define properties (likeabstract String getBar()), any abstracttoBuilder()method, and any other abstract method even if it has been consumed by this or another Extension.- Specified by:
abstractMethodsin interfaceAutoValueExtension.Context
-
-