Package tangle.inject.compiler

Types

Link copied to clipboard
object ClassNames
Link copied to clipboard
data class ConstructorInjectParameter(name: String, typeName: TypeName, providerTypeName: ParameterizedTypeName, lazyTypeName: ParameterizedTypeName, isWrappedInProvider: Boolean, isWrappedInLazy: Boolean, tangleParamName: String?, qualifiers: List<AnnotationSpec>, isDaggerAssisted: Boolean) : Parameter
Link copied to clipboard
fun interface FileGenerator<T>
Link copied to clipboard
object FqNames
Link copied to clipboard
data class MemberInjectParameter(name: String, typeName: TypeName, providerTypeName: ParameterizedTypeName, lazyTypeName: ParameterizedTypeName, isWrappedInProvider: Boolean, isWrappedInLazy: Boolean, tangleParamName: String?, qualifiers: List<AnnotationSpec>, memberInjectorClass: ClassName) : Parameter
Link copied to clipboard
object MemberNames
Link copied to clipboard
sealed class Parameter
Link copied to clipboard
abstract class TangleCodeGenerator : CodeGenerator

Wraps all code generation in delegateToAnvilUnsafe, which catches Anvil exceptions and rethrows them as TangleCompilationException.

Link copied to clipboard
class TangleCompilationException(message: String, cause: Throwable?, element: PsiElement?) : CompilationException

Functions

Link copied to clipboard
fun TypeSpec.Builder.addContributesTo(scopeClassName: ClassName): TypeSpec.Builder
Link copied to clipboard
fun TypeSpec.Builder.addFunction(name: String, block: FunSpec.Builder.() -> Unit): TypeSpec.Builder
Link copied to clipboard
fun AnnotationSpec(name: ClassName, block: AnnotationSpec.Builder.() -> Unit): AnnotationSpec
fun AnnotationSpec(annotationClass: KClass<out Annotation>, block: AnnotationSpec.Builder.() -> Unit): AnnotationSpec
Link copied to clipboard
inline fun <T : Any, E> T.applyEach(elements: Iterable<E>, block: T.(E) -> Unit): T
Link copied to clipboard
inline fun <T> T.applyIf(predicate: Boolean, body: T.() -> T): T
Link copied to clipboard
fun List<Parameter>.asArgumentList(asProvider: Boolean, includeModule: Boolean): String

Converts the parameter list to comma separated argument list that can be used to call other functions, e.g.

Link copied to clipboard
fun ClassReference.assistedInjectConstructor(): FunctionReference?
Link copied to clipboard
fun TypeParameterDescriptor.boundClassName(): ClassName
Link copied to clipboard
fun FileSpec.Companion.buildFile(packageName: String, fileName: String, block: FileSpec.Builder.() -> Unit): String
Link copied to clipboard
fun <T : AnnotationReference> Iterable<T>.find(fqName: FqName): T?
Link copied to clipboard
fun KotlinType.fqNameOrNull(): FqName?
Link copied to clipboard
fun ClassReference.fragmentInjectConstructor(): FunctionReference?
Link copied to clipboard
fun FunSpec(name: String, block: FunSpec.Builder.() -> Unit): FunSpec
Link copied to clipboard
fun ClassName.generateSimpleNameString(separator: String = "_"): String
Link copied to clipboard
fun FunctionReference.hasAnnotation(fqName: FqName): Boolean
fun CallableMemberDescriptor.hasAnnotation(annotationFqName: FqName): Boolean
fun PropertyDescriptor.hasAnnotation(annotationFqName: FqName): Boolean
Link copied to clipboard
fun ClassReference.injectConstructor(): FunctionReference?
Link copied to clipboard
fun ClassReference.isFragment(): Boolean
Link copied to clipboard
fun PropertyDescriptor.isNullable(): Boolean
fun KotlinType.isNullable(): Boolean
Link copied to clipboard
fun ClassReference.isViewModel(): Boolean
Link copied to clipboard
fun List<ParameterReference>.mapToParameters(module: ModuleDescriptor): List<ConstructorInjectParameter>
Link copied to clipboard
fun ClassReference.memberInjectedParameters(): List<MemberInjectParameter>

Returns all member-injected parameters for the receiver class and any superclasses.

Link copied to clipboard
fun MemberScope.memberInjectedProperties(): List<PropertyDescriptor>
Link copied to clipboard
fun List<AnnotationReference>.qualifierAnnotationSpecs(module: ModuleDescriptor): List<AnnotationSpec>
fun List<AnnotationDescriptor>.qualifierAnnotationSpecs(module: ModuleDescriptor): List<AnnotationSpec>
Link copied to clipboard
inline fun require(value: Boolean, classReference: ClassReference, cause: Throwable? = null, lazyMessage: () -> String)
@JvmName(name = "requirePsi")
inline fun require(value: Boolean, psi: () -> PsiElement, cause: Throwable? = null, lazyMessage: () -> String)
inline fun require(value: Boolean, declarationDescriptor: () -> DeclarationDescriptor, cause: Throwable? = null, lazyMessage: () -> String)
inline fun require(value: Boolean, element: PsiElement? = null, cause: Throwable? = null, lazyMessage: () -> String)
inline fun require(value: Boolean, declarationDescriptor: DeclarationDescriptor, cause: Throwable? = null, lazyMessage: () -> String)
inline fun require(value: Boolean, annotationDescriptor: AnnotationDescriptor, cause: Throwable? = null, lazyMessage: () -> String)
Link copied to clipboard
fun DeclarationDescriptor.requireContainingPackage(): FqName
Link copied to clipboard
fun ParameterReference.requireTangleParamName(): String
fun CallableMemberDescriptor.requireTangleParamName(): String
Link copied to clipboard
fun ParameterReference.tangleParamNameOrNull(): String?
fun PropertyReference.tangleParamNameOrNull(): String?
fun CallableMemberDescriptor.tangleParamNameOrNull(): String?
Link copied to clipboard
fun PropertyReference.toMemberInjectParameter(uniqueName: String): MemberInjectParameter
Link copied to clipboard
@JvmName(name = "uniqueNameStrings")
fun List<String>.uniqueName(base: String, attempt: Int = 0): String
fun List<ConstructorInjectParameter>.uniqueName(base: String, attempt: Int = 0): String
Link copied to clipboard
fun ClassReference.vmInjectConstructor(): FunctionReference?
Link copied to clipboard
fun TypeName.wrapInLazy(): ParameterizedTypeName
Link copied to clipboard
fun TypeName.wrapInProvider(): ParameterizedTypeName

Properties

Link copied to clipboard
val ClassDescriptor.identifier: PsiElement?
Link copied to clipboard
val AnnotationDescriptor.identifier: PsiElement?