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:

  1. #preProcess()
  2. foreach element:
    • #processEach()
  3. #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

    Modifier and Type
    Method
    Description
    protected com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName>
     
    final com.google.common.collect.ImmutableSet<String>
     
    protected boolean
    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)
     
    final 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)
     
    final void
    preRoundProcess(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 void
    processEach(com.squareup.javapoet.ClassName annotation, androidx.room.compiler.processing.XElement element)
     
    protected final androidx.room.compiler.processing.XProcessingEnv
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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

      public final com.google.common.collect.ImmutableSet<String> annotations()
      Specified by:
      annotations in interface androidx.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:
      process in interface androidx.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.