Class AndroidEntryPointMetadata
java.lang.Object
dagger.hilt.android.processor.internal.androidentrypoint.AndroidEntryPointMetadata
Metadata class for @AndroidEntryPoint annotated classes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe Android type of the Android Entry Point element. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this class allows optional injection.Returns theAndroidEntryPointMetadata.AndroidTypefor the annotated element.booleanReturns true if any base class (transitively) allows optional injection.com.squareup.javapoet.TypeNameThe name of the base class given to @AndroidEntryPointabstract androidx.room.compiler.processing.XTypeElementThe base class given to @AndroidEntryPoint.abstract Optional<AndroidEntryPointMetadata>ReturnsOptionalofAndroidEntryPointMetadata.abstract com.squareup.javapoet.TypeNameReturns the component manager this generated Hilt class should use.abstract Optional<com.squareup.javapoet.CodeBlock>Returns the initialization arguments for the component manager.com.squareup.javapoet.ParameterSpecabstract androidx.room.compiler.processing.XTypeElementelement()The class annotated with @AndroidEntryPoint.com.squareup.javapoet.ClassNameThe name of the class annotated with @AndroidEntryPointModifier[]Modifiers that should be applied to the generated class.abstract com.squareup.javapoet.ClassNameThe name of the generated base class, beginning with 'Hilt_'.static booleanhasAndroidEntryPointMetadata(androidx.room.compiler.processing.XElement element) Returns true if the given element has Android Entry Point metadata.The name of inject method for this class.com.squareup.javapoet.ClassNameThe name of the generated injector for the Hilt class.final com.squareup.javapoet.AnnotationSpecReturns the @InstallIn annotation for the module providing this class.abstract com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName>Returns set of scopes that the component interface should be installed in.static AndroidEntryPointMetadatamanuallyConstruct(androidx.room.compiler.processing.XTypeElement element, androidx.room.compiler.processing.XTypeElement baseElement, com.squareup.javapoet.ClassName generatedClassName, boolean requiresBytecodeInjection, AndroidEntryPointMetadata.AndroidType androidType, Optional<AndroidEntryPointMetadata> baseMetadata, com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName> installInComponents, com.squareup.javapoet.TypeName componentManager, Optional<com.squareup.javapoet.CodeBlock> componentManagerInitArgs) static AndroidEntryPointMetadataof(androidx.room.compiler.processing.XElement element) Returns theAndroidEntryPointMetadatafor a @AndroidEntryPoint annotated element.booleanReturns true if any base class (transitively) uses @AndroidEntryPoint.abstract booleanReturnstrueif the class requires bytecode injection to replace the base class.Returns the metadata for the root most class in the hierarchy.
-
Constructor Details
-
AndroidEntryPointMetadata
public AndroidEntryPointMetadata()
-
-
Method Details
-
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()Returnstrueif the class requires bytecode injection to replace the base class. -
androidType
Returns theAndroidEntryPointMetadata.AndroidTypefor the annotated element. -
baseMetadata
ReturnsOptionalofAndroidEntryPointMetadata. -
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
Returns the initialization arguments for the component manager. -
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
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
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
Returns theAndroidEntryPointMetadatafor 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, Optional<AndroidEntryPointMetadata> baseMetadata, com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName> installInComponents, com.squareup.javapoet.TypeName componentManager, Optional<com.squareup.javapoet.CodeBlock> componentManagerInitArgs)
-