Class RootProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- dagger.hilt.processor.internal.BaseProcessor
-
- dagger.hilt.processor.internal.root.RootProcessor
-
- All Implemented Interfaces:
javax.annotation.processing.Processor
@IncrementalAnnotationProcessor(DYNAMIC) @AutoService(javax.annotation.processing.Processor.class) public final class RootProcessor extends BaseProcessor
Processor that outputs dagger components based on transitive build deps.
-
-
Constructor Summary
Constructors Constructor Description RootProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<java.lang.String>additionalProcessingOptions()Returns additional processing options that should only be applied for a single processor.com.google.common.collect.ImmutableSet<java.lang.String>getSupportedAnnotationTypes()voidinit(javax.annotation.processing.ProcessingEnvironment processingEnvironment)voidpostRoundProcess(javax.annotation.processing.RoundEnvironment roundEnv)Used to perform post processing at the end of a round.voidprocessEach(javax.lang.model.element.TypeElement annotation, javax.lang.model.element.Element element)Called for each element in a round that uses a supported annotation.-
Methods inherited from class dagger.hilt.processor.internal.BaseProcessor
claimAnnotations, delayErrors, getElementUtils, getErrorHandler, getMessager, getProcessingEnv, getSupportedOptions, getSupportedSourceVersion, getTypeUtils, preRoundProcess, process
-
-
-
-
Method Detail
-
init
public void init(javax.annotation.processing.ProcessingEnvironment processingEnvironment)
- Specified by:
initin interfacejavax.annotation.processing.Processor- Overrides:
initin classBaseProcessor
-
additionalProcessingOptions
public com.google.common.collect.ImmutableSet<java.lang.String> additionalProcessingOptions()
Description copied from class:BaseProcessorReturns additional processing options that should only be applied for a single processor.- Overrides:
additionalProcessingOptionsin classBaseProcessor
-
getSupportedAnnotationTypes
public com.google.common.collect.ImmutableSet<java.lang.String> getSupportedAnnotationTypes()
- Specified by:
getSupportedAnnotationTypesin interfacejavax.annotation.processing.Processor- Overrides:
getSupportedAnnotationTypesin classjavax.annotation.processing.AbstractProcessor
-
processEach
public void processEach(javax.lang.model.element.TypeElement annotation, javax.lang.model.element.Element element) throws java.lang.ExceptionDescription copied from class:BaseProcessorCalled for each element in a round that uses a supported annotation. Note that an exception can be thrown for each element in the round. This is usually preferred over throwing only the first exception in a round. Only throwing the first exception in the round can lead to flaky errors that are dependent on the non-deterministic ordering that the elements are processed in.- Overrides:
processEachin classBaseProcessor- Throws:
java.lang.Exception
-
postRoundProcess
public void postRoundProcess(javax.annotation.processing.RoundEnvironment roundEnv) throws java.lang.ExceptionDescription copied from class:BaseProcessorUsed to perform post processing at the end of a round. This is especially useful for handling additional processing that depends on aggregate data, that cannot be handled in #processEach().Note: this will not be called if an exception is thrown during #processEach() -- if we have already detected errors on an annotated element, performing post processing on an aggregate will just produce more (perhaps non-deterministic) errors.
- Overrides:
postRoundProcessin classBaseProcessor- Throws:
java.lang.Exception
-
-