public abstract class AndroidEntryPointMetadata
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AndroidEntryPointMetadata.AndroidType
The Android type of the Android Entry Point element.
|
| Constructor and Description |
|---|
AndroidEntryPointMetadata() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowsOptionalInjection()
Returns true if this class allows optional injection.
|
abstract AndroidEntryPointMetadata.AndroidType |
androidType()
Returns the
AndroidEntryPointMetadata.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 @AndroidEntryPoint
|
abstract javax.lang.model.element.TypeElement |
baseElement()
The base class
Element given to @AndroidEntryPoint. |
abstract java.util.Optional<AndroidEntryPointMetadata> |
baseMetadata()
Returns
Optional of AndroidEntryPointMetadata. |
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 javax.lang.model.element.TypeElement |
element()
The class
Element annotated with @AndroidEntryPoint. |
com.squareup.javapoet.ClassName |
elementClassName()
The name of the class annotated with @AndroidEntryPoint
|
javax.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(javax.lang.model.element.Element 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(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 AndroidEntryPointMetadata |
of(javax.annotation.processing.ProcessingEnvironment env,
javax.lang.model.element.Element element)
Returns the
AndroidEntryPointMetadata for a @AndroidEntryPoint annotated element. |
boolean |
overridesAndroidEntryPointClass()
Returns true if any base class (transitively) uses @AndroidEntryPoint.
|
abstract boolean |
requiresBytecodeInjection()
Returns
true if the class requires bytecode injection to replace the base class. |
AndroidEntryPointMetadata |
rootMetadata()
Returns the metadata for the root most class in the hierarchy.
|
public abstract javax.lang.model.element.TypeElement element()
Element annotated with @AndroidEntryPoint.public abstract javax.lang.model.element.TypeElement baseElement()
Element given to @AndroidEntryPoint.public abstract com.squareup.javapoet.ClassName generatedClassName()
public abstract boolean requiresBytecodeInjection()
true if the class requires bytecode injection to replace the base class.public abstract AndroidEntryPointMetadata.AndroidType androidType()
AndroidEntryPointMetadata.AndroidType for the annotated element.public abstract java.util.Optional<AndroidEntryPointMetadata> baseMetadata()
Optional of AndroidEntryPointMetadata.public abstract com.google.common.collect.ImmutableSet<com.squareup.javapoet.ClassName> installInComponents()
public abstract com.squareup.javapoet.TypeName componentManager()
public abstract java.util.Optional<com.squareup.javapoet.CodeBlock> componentManagerInitArgs()
@Memoized public AndroidEntryPointMetadata rootMetadata()
If this is the only metadata in the class hierarchy, it returns this.
public boolean allowsOptionalInjection()
public boolean baseAllowsOptionalInjection()
public boolean overridesAndroidEntryPointClass()
public com.squareup.javapoet.ClassName elementClassName()
public com.squareup.javapoet.TypeName baseClassName()
public com.squareup.javapoet.ClassName injectorClassName()
public java.lang.String injectMethodName()
public final com.squareup.javapoet.AnnotationSpec injectorInstallInAnnotation()
public com.squareup.javapoet.ParameterSpec componentManagerParam()
public javax.lang.model.element.Modifier[] generatedClassModifiers()
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
public static boolean hasAndroidEntryPointMetadata(javax.lang.model.element.Element element)
public static AndroidEntryPointMetadata of(javax.annotation.processing.ProcessingEnvironment env, javax.lang.model.element.Element element)
AndroidEntryPointMetadata for a @AndroidEntryPoint annotated element.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)