Package dagger.hilt.processor.internal
Class BaseProcessingStep
java.lang.Object
dagger.hilt.processor.internal.BaseProcessingStep
- All Implemented Interfaces:
androidx.room.compiler.processing.XProcessingStep
- Direct Known Subclasses:
AggregatedDepsProcessingStep,AliasOfProcessingStep,AndroidEntryPointProcessingStep,BindValueProcessingStep,ComponentTreeDepsProcessingStep,CustomTestApplicationProcessingStep,DefineComponentProcessingStep,DisableInstallInCheckProcessingStep,GeneratesRootInputProcessingStep,OriginatingElementProcessingStep,RootProcessingStep,UninstallModulesProcessingStep
public abstract class BaseProcessingStep
extends Object
implements androidx.room.compiler.processing.XProcessingStep
Implements default configurations for ProcessingSteps, and provides structure for exception
handling.
In each round it will do the following:
- #preProcess()
- foreach element:
- #processEach()
- #postProcess()
#processEach() allows each element to be processed, even if exceptions are thrown. Due to the non-deterministic ordering of the processed elements, this is needed to ensure a consistent set of exceptions are thrown with each build.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName>final com.google.common.collect.ImmutableSet<String>protected booleanReturns true if you want to delay errors to the last round.protected voidpostProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) final voidpostRoundProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) protected voidpreProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) final voidpreRoundProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) final com.google.common.collect.ImmutableSet<androidx.room.compiler.processing.XElement>process(androidx.room.compiler.processing.XProcessingEnv env, Map<String, ? extends Set<? extends androidx.room.compiler.processing.XElement>> elementsByAnnotation, boolean isLastRound) protected voidprocessEach(com.squareup.javapoet.ClassName annotation, androidx.room.compiler.processing.XElement element) protected final androidx.room.compiler.processing.XProcessingEnvMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface androidx.room.compiler.processing.XProcessingStep
process, processOver
-
Constructor Details
-
BaseProcessingStep
public BaseProcessingStep(androidx.room.compiler.processing.XProcessingEnv env)
-
-
Method Details
-
processingEnv
protected final androidx.room.compiler.processing.XProcessingEnv processingEnv() -
annotations
- Specified by:
annotationsin interfaceandroidx.room.compiler.processing.XProcessingStep
-
annotationClassNames
protected com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName> annotationClassNames() -
processEach
protected void processEach(com.squareup.javapoet.ClassName annotation, androidx.room.compiler.processing.XElement element) throws Exception - Throws:
Exception
-
preProcess
protected void preProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) -
postProcess
protected void postProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) throws Exception - Throws:
Exception
-
preRoundProcess
public final void preRoundProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) -
postRoundProcess
public final void postRoundProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round) -
process
public final com.google.common.collect.ImmutableSet<androidx.room.compiler.processing.XElement> process(androidx.room.compiler.processing.XProcessingEnv env, Map<String, ? extends Set<? extends androidx.room.compiler.processing.XElement>> elementsByAnnotation, boolean isLastRound) - Specified by:
processin interfaceandroidx.room.compiler.processing.XProcessingStep
-
delayErrors
protected boolean delayErrors()Returns true if you want to delay errors to the last round. Useful if the processor generates code for symbols used a lot in the user code. Delaying allows as much code to compile as possible for correctly configured types and reduces error spam.
-