Class AndroidEntryPointMetadata


  • public abstract class AndroidEntryPointMetadata
    extends java.lang.Object
    Metadata class for @AndroidEntryPoint annotated classes.
    • Constructor Detail

      • AndroidEntryPointMetadata

        public AndroidEntryPointMetadata()
    • Method Detail

      • element

        public abstract androidx.room.compiler.processing.XTypeElement element()
        The class annotated with @AndroidEntryPoint.
      • baseElement

        public abstract androidx.room.compiler.processing.XTypeElement baseElement()
        The base class given to @AndroidEntryPoint.
      • generatedClassName

        public abstract com.squareup.javapoet.ClassName generatedClassName()
        The name of the generated base class, beginning with 'Hilt_'.
      • requiresBytecodeInjection

        public abstract boolean requiresBytecodeInjection()
        Returns true if the class requires bytecode injection to replace the base class.
      • installInComponents

        public abstract com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName> installInComponents()
        Returns set of scopes that the component interface should be installed in.
      • componentManager

        public abstract com.squareup.javapoet.TypeName componentManager()
        Returns the component manager this generated Hilt class should use.
      • componentManagerInitArgs

        public abstract java.util.Optional<com.squareup.javapoet.CodeBlock> componentManagerInitArgs()
        Returns the initialization arguments for the component manager.
      • rootMetadata

        @Memoized
        public AndroidEntryPointMetadata rootMetadata()
        Returns the metadata for the root most class in the hierarchy.

        If this is the only metadata in the class hierarchy, it returns this.

      • allowsOptionalInjection

        public boolean allowsOptionalInjection()
        Returns true if this class allows optional injection.
      • baseAllowsOptionalInjection

        public boolean baseAllowsOptionalInjection()
        Returns true if any base class (transitively) allows optional injection.
      • overridesAndroidEntryPointClass

        public boolean overridesAndroidEntryPointClass()
        Returns true if any base class (transitively) uses @AndroidEntryPoint.
      • elementClassName

        public com.squareup.javapoet.ClassName elementClassName()
        The name of the class annotated with @AndroidEntryPoint
      • baseClassName

        public com.squareup.javapoet.TypeName baseClassName()
        The name of the base class given to @AndroidEntryPoint
      • injectorClassName

        public com.squareup.javapoet.ClassName injectorClassName()
        The name of the generated injector for the Hilt class.
      • injectMethodName

        public java.lang.String injectMethodName()
        The name of inject method for this class. The format is: inject$CLASS. If the class is nested, will return the full name deliminated with '_'. e.g. Foo.Bar.Baz -> injectFoo_Bar_Baz
      • injectorInstallInAnnotation

        public final com.squareup.javapoet.AnnotationSpec injectorInstallInAnnotation()
        Returns the @InstallIn annotation for the module providing this class.
      • componentManagerParam

        public com.squareup.javapoet.ParameterSpec componentManagerParam()
      • generatedClassModifiers

        public javax.lang.model.element.Modifier[] generatedClassModifiers()
        Modifiers that should be applied to the generated class.

        Note that the generated class must have public visibility if used by a public @AndroidEntryPoint-annotated kotlin class. See: https://discuss.kotlinlang.org/t/why-does-kotlin-prohibit-exposing-restricted-visibility-types/7047

      • hasAndroidEntryPointMetadata

        public static boolean hasAndroidEntryPointMetadata​(androidx.room.compiler.processing.XElement element)
        Returns true if the given element has Android Entry Point metadata.
      • manuallyConstruct

        public static AndroidEntryPointMetadata manuallyConstruct​(androidx.room.compiler.processing.XTypeElement element,
                                                                  androidx.room.compiler.processing.XTypeElement baseElement,
                                                                  com.squareup.javapoet.ClassName generatedClassName,
                                                                  boolean requiresBytecodeInjection,
                                                                  AndroidEntryPointMetadata.AndroidType androidType,
                                                                  java.util.Optional<AndroidEntryPointMetadata> baseMetadata,
                                                                  com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName> installInComponents,
                                                                  com.squareup.javapoet.TypeName componentManager,
                                                                  java.util.Optional<com.squareup.javapoet.CodeBlock> componentManagerInitArgs)