Class AndroidEntryPointMetadata
- java.lang.Object
-
- dagger.hilt.android.processor.internal.androidentrypoint.AndroidEntryPointMetadata
-
public abstract class AndroidEntryPointMetadata extends java.lang.Object
Metadata class for @AndroidEntryPoint annotated classes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AndroidEntryPointMetadata.AndroidType
The Android type of the Android Entry Point element.
-
Constructor Summary
Constructors Constructor Description AndroidEntryPointMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
allowsOptionalInjection()
Returns true if this class allows optional injection.abstract AndroidEntryPointMetadata.AndroidType
androidType()
Returns theAndroidEntryPointMetadata.AndroidType
for the annotated element.boolean
baseAllowsOptionalInjection()
Returns true if any base class (transitively) allows optional injection.com.squareup.javapoet.TypeName
baseClassName()
The name of the base class given to @AndroidEntryPointabstract androidx.room.compiler.processing.XTypeElement
baseElement()
The base class given to @AndroidEntryPoint.abstract java.util.Optional<AndroidEntryPointMetadata>
baseMetadata()
ReturnsOptional
ofAndroidEntryPointMetadata
.abstract com.squareup.javapoet.TypeName
componentManager()
Returns the component manager this generated Hilt class should use.abstract java.util.Optional<com.squareup.javapoet.CodeBlock>
componentManagerInitArgs()
Returns the initialization arguments for the component manager.com.squareup.javapoet.ParameterSpec
componentManagerParam()
abstract androidx.room.compiler.processing.XTypeElement
element()
The class annotated with @AndroidEntryPoint.com.squareup.javapoet.ClassName
elementClassName()
The name of the class annotated with @AndroidEntryPointjavax.lang.model.element.Modifier[]
generatedClassModifiers()
Modifiers that should be applied to the generated class.abstract com.squareup.javapoet.ClassName
generatedClassName()
The name of the generated base class, beginning with 'Hilt_'.static boolean
hasAndroidEntryPointMetadata(androidx.room.compiler.processing.XElement element)
Returns true if the given element has Android Entry Point metadata.java.lang.String
injectMethodName()
The name of inject method for this class.com.squareup.javapoet.ClassName
injectorClassName()
The name of the generated injector for the Hilt class.com.squareup.javapoet.AnnotationSpec
injectorInstallInAnnotation()
Returns the @InstallIn annotation for the module providing this class.abstract com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName>
installInComponents()
Returns set of scopes that the component interface should be installed in.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)
static AndroidEntryPointMetadata
of(androidx.room.compiler.processing.XElement element)
Returns theAndroidEntryPointMetadata
for a @AndroidEntryPoint annotated element.boolean
overridesAndroidEntryPointClass()
Returns true if any base class (transitively) uses @AndroidEntryPoint.abstract boolean
requiresBytecodeInjection()
Returnstrue
if the class requires bytecode injection to replace the base class.AndroidEntryPointMetadata
rootMetadata()
Returns the metadata for the root most class in the hierarchy.
-
-
-
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()
Returnstrue
if the class requires bytecode injection to replace the base class.
-
androidType
public abstract AndroidEntryPointMetadata.AndroidType androidType()
Returns theAndroidEntryPointMetadata.AndroidType
for the annotated element.
-
baseMetadata
public abstract java.util.Optional<AndroidEntryPointMetadata> baseMetadata()
ReturnsOptional
ofAndroidEntryPointMetadata
.
-
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.
-
of
public static AndroidEntryPointMetadata of(androidx.room.compiler.processing.XElement element)
Returns theAndroidEntryPointMetadata
for a @AndroidEntryPoint annotated element.
-
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)
-
-