Class AndroidEntryPointMetadata
- java.lang.Object
-
- dagger.hilt.android.processor.internal.androidentrypoint.AndroidEntryPointMetadata
-
public abstract class AndroidEntryPointMetadata extends java.lang.ObjectMetadata class for @AndroidEntryPoint annotated classes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAndroidEntryPointMetadata.AndroidTypeThe 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 booleanallowsOptionalInjection()Returns true if this class allows optional injection.abstract AndroidEntryPointMetadata.AndroidTypeandroidType()Returns theAndroidEntryPointMetadata.AndroidTypefor the annotated element.booleanbaseAllowsOptionalInjection()Returns true if any base class (transitively) allows optional injection.com.squareup.javapoet.TypeNamebaseClassName()The name of the base class given to @AndroidEntryPointabstract javax.lang.model.element.TypeElementbaseElement()The base classElementgiven to @AndroidEntryPoint.abstract java.util.Optional<AndroidEntryPointMetadata>baseMetadata()ReturnsOptionalofAndroidEntryPointMetadata.abstract com.squareup.javapoet.TypeNamecomponentManager()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.ParameterSpeccomponentManagerParam()abstract javax.lang.model.element.TypeElementelement()The classElementannotated with @AndroidEntryPoint.com.squareup.javapoet.ClassNameelementClassName()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.ClassNamegeneratedClassName()The name of the generated base class, beginning with 'Hilt_'.static booleanhasAndroidEntryPointMetadata(javax.lang.model.element.Element element)Returns true if the given element has Android Entry Point metadata.java.lang.StringinjectMethodName()The name of inject method for this class.com.squareup.javapoet.ClassNameinjectorClassName()The name of the generated injector for the Hilt class.com.squareup.javapoet.AnnotationSpecinjectorInstallInAnnotation()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 AndroidEntryPointMetadatamanuallyConstruct(javax.lang.model.element.TypeElement element, javax.lang.model.element.TypeElement 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 AndroidEntryPointMetadataof(javax.annotation.processing.ProcessingEnvironment env, javax.lang.model.element.Element element)Returns theAndroidEntryPointMetadatafor a @AndroidEntryPoint annotated element.booleanoverridesAndroidEntryPointClass()Returns true if any base class (transitively) uses @AndroidEntryPoint.abstract booleanrequiresBytecodeInjection()Returnstrueif the class requires bytecode injection to replace the base class.AndroidEntryPointMetadatarootMetadata()Returns the metadata for the root most class in the hierarchy.
-
-
-
Method Detail
-
element
public abstract javax.lang.model.element.TypeElement element()
The classElementannotated with @AndroidEntryPoint.
-
baseElement
public abstract javax.lang.model.element.TypeElement baseElement()
The base classElementgiven 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
public abstract AndroidEntryPointMetadata.AndroidType androidType()
Returns theAndroidEntryPointMetadata.AndroidTypefor the annotated element.
-
baseMetadata
public abstract java.util.Optional<AndroidEntryPointMetadata> 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
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(javax.lang.model.element.Element element)
Returns true if the given element has Android Entry Point metadata.
-
of
public static AndroidEntryPointMetadata of(javax.annotation.processing.ProcessingEnvironment env, javax.lang.model.element.Element element)
Returns theAndroidEntryPointMetadatafor a @AndroidEntryPoint annotated element.
-
manuallyConstruct
public static AndroidEntryPointMetadata manuallyConstruct(javax.lang.model.element.TypeElement element, javax.lang.model.element.TypeElement 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)
-
-