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 java.lang.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 Constructor Description BaseProcessingStep(androidx.room.compiler.processing.XProcessingEnv env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName>
annotationClassNames()
com.google.common.collect.ImmutableSet<java.lang.String>
annotations()
protected boolean
delayErrors()
Returns true if you want to delay errors to the last round.protected void
postProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round)
void
postRoundProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round)
protected void
preProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round)
void
preRoundProcess(androidx.room.compiler.processing.XProcessingEnv env, androidx.room.compiler.processing.XRoundEnv round)
com.google.common.collect.ImmutableSet<androidx.room.compiler.processing.XElement>
process(androidx.room.compiler.processing.XProcessingEnv env, java.util.Map<java.lang.String,? extends java.util.Set<? extends androidx.room.compiler.processing.XElement>> elementsByAnnotation, boolean isLastRound)
protected void
processEach(com.squareup.javapoet.ClassName annotation, androidx.room.compiler.processing.XElement element)
protected androidx.room.compiler.processing.XProcessingEnv
processingEnv()
-
-
-
Method Detail
-
processingEnv
protected final androidx.room.compiler.processing.XProcessingEnv processingEnv()
-
annotations
public final com.google.common.collect.ImmutableSet<java.lang.String> annotations()
- Specified by:
annotations
in 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 java.lang.Exception
- Throws:
java.lang.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 java.lang.Exception
- Throws:
java.lang.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, java.util.Map<java.lang.String,? extends java.util.Set<? extends androidx.room.compiler.processing.XElement>> elementsByAnnotation, boolean isLastRound)
- Specified by:
process
in 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.
-
-