Package com.google.auto.value.processor
Class ExtensionContext
java.lang.Object
com.google.auto.value.processor.ExtensionContext
- All Implemented Interfaces:
AutoValueExtension.Context
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.collect.ImmutableSet<ExecutableElement>
private final ProcessingEnvironment
private final com.google.common.collect.ImmutableMap<String,
ExecutableElement> private final TypeElement
-
Constructor Summary
ConstructorsConstructorDescriptionExtensionContext
(ProcessingEnvironment processingEnvironment, TypeElement typeElement, com.google.common.collect.ImmutableMap<String, ExecutableElement> properties, com.google.common.collect.ImmutableSet<ExecutableElement> abstractMethods) -
Method Summary
Modifier and TypeMethodDescriptionReturns the complete set of abstract methods defined in or inherited by the@AutoValue
class.Returns the annotated class that this generation cycle is based on.Returns the package name of the classes to be generated.Returns the processing environment of this generation cycle.Returns the ordered collection of properties to be generated by AutoValue.
-
Field Details
-
processingEnvironment
-
typeElement
-
properties
-
abstractMethods
-
-
Constructor Details
-
ExtensionContext
ExtensionContext(ProcessingEnvironment processingEnvironment, TypeElement typeElement, com.google.common.collect.ImmutableMap<String, ExecutableElement> properties, com.google.common.collect.ImmutableSet<ExecutableElement> abstractMethods)
-
-
Method Details
-
processingEnvironment
Description copied from interface:AutoValueExtension.Context
Returns the processing environment of this generation cycle. This can be used, among other things, to produce compilation warnings or errors, usingProcessingEnvironment.getMessager()
.- Specified by:
processingEnvironment
in interfaceAutoValueExtension.Context
-
packageName
Description copied from interface:AutoValueExtension.Context
Returns the package name of the classes to be generated.- Specified by:
packageName
in interfaceAutoValueExtension.Context
-
autoValueClass
Description copied from interface:AutoValueExtension.Context
Returns the annotated class that this generation cycle is based on.Given
@AutoValue public class Foo {...}
, this will beFoo
.- Specified by:
autoValueClass
in interfaceAutoValueExtension.Context
-
properties
Description copied from interface:AutoValueExtension.Context
Returns 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 propertybar
is defined byabstract String getBar()
then this map will have an entry mapping"bar"
to theExecutableElement
forgetBar()
.- Specified by:
properties
in interfaceAutoValueExtension.Context
-
abstractMethods
Description copied from interface:AutoValueExtension.Context
Returns the complete set of abstract methods defined in or inherited by the@AutoValue
class. 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:
abstractMethods
in interfaceAutoValueExtension.Context
-