Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

DSL marker for code generation DSL components.

Link copied to clipboard

Marker annotation for internal API components.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
@DelicateKotlinPoetApi(message = "Mirror APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
fun Annotatable.Builder<*>.addAnnotation(annotation: AnnotationMirror): AnnotationSpec
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
inline fun Annotatable.Builder<*>.addAnnotation(type: Class<out Annotation>, block: AnnotationSpecBuilderScope = {}): AnnotationSpec
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
fun Annotatable.Builder<*>.addAnnotation(annotation: Annotation, includeDefaultValues: Boolean = false): AnnotationSpec
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Adds an enum constant with name to this TypeSpec.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@DelicateKotlinPoetApi(message = "Element APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
fun FunSpec.Builder.addParameter(element: VariableElement): ParameterSpec
inline fun <T> FunSpec.Builder.addParameter(name: String, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun FunSpec.Builder.addParameter(name: String, type: TypeName, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun FunSpec.Builder.addParameter(name: String, type: Type, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun FunSpec.Builder.addParameter(name: String, type: KClass<*>, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
Link copied to clipboard
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
fun MemberSpecHolder.Builder<*>.addProperty(type: Type, modifiers: Iterable<KModifier>, block: PropertySpecBuilderScope = {}): SubSpecDelegateProvider<PropertySpec>
inline fun <T> MemberSpecHolder.Builder<*>.addProperty(name: String, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun MemberSpecHolder.Builder<*>.addProperty(name: String, type: TypeName, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun MemberSpecHolder.Builder<*>.addProperty(name: String, type: Type, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
inline fun MemberSpecHolder.Builder<*>.addProperty(name: String, type: Type, modifiers: Iterable<KModifier>, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun MemberSpecHolder.Builder<*>.addProperty(name: String, type: KClass<*>, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
Link copied to clipboard
inline fun <S> TypeSpec.Builder.addSuperinterface(delegate: CodeBlock = emptyCodeBlock()): TypeSpec.Builder
inline fun <S> TypeSpec.Builder.addSuperinterface(constructorParameter: String): TypeSpec.Builder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@DelicateKotlinPoetApi(message = "Mirror APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
fun AnnotationSpec(annotation: AnnotationMirror): AnnotationSpec
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
inline fun AnnotationSpec(type: Class<out Annotation>, block: AnnotationSpecBuilderScope = {}): AnnotationSpec
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
fun AnnotationSpec(annotation: Annotation, includeDefaultValues: Boolean = false): AnnotationSpec
Link copied to clipboard
Link copied to clipboard

Converts an Enum constant to a MemberName.

@DelicateKotlinPoetApi(message = "This API uses internal Kotlin reflection APIs and might break at any time")
fun KCallable<*>.asMemberName(): MemberName

Converts a reference to a callable (Property or function) to a MemberName.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun CodeBlock(block: CodeBlockBuilderScope = {}): CodeBlock
Link copied to clipboard
Link copied to clipboard
inline fun <O> ClassName.compareTo(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Creates an empty CodeBlock.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <C> FileSpec(block: FileSpecBuilderScope = {}): FileSpec
inline fun FileSpec(className: ClassName, block: FileSpecBuilderScope = {}): FileSpec
inline fun FileSpec(memberName: MemberName, block: FileSpecBuilderScope = {}): FileSpec
fun FileSpec(packageName: String, typeSpec: TypeSpec): FileSpec
inline fun FileSpec(packageName: String, fileName: String, block: FileSpecBuilderScope = {}): FileSpec
Link copied to clipboard
Link copied to clipboard
inline fun FunSpec(memberName: MemberName, block: FunSpecBuilderScope = {}): FunSpec
inline fun FunSpec(name: String, block: FunSpecBuilderScope = {}): FunSpec
Link copied to clipboard
inline fun <R, R_> LambdaTypeName.Companion.get(vararg parameters: ParameterSpec = emptyArray()): LambdaTypeName
inline fun <R, R_> LambdaTypeName.Companion.get(vararg parameters: TypeName = emptyArray()): LambdaTypeName
inline fun <R, R_> LambdaTypeName.Companion.get(parameters: List<ParameterSpec> = emptyList()): LambdaTypeName
inline fun <R, R_> LambdaTypeName.Companion.get(parameters: List<ParameterSpec> = emptyList(), contextReceivers: List<TypeName> = emptyList()): LambdaTypeName
Link copied to clipboard
Link copied to clipboard

Indents this file with width spaces.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <R, R_> LambdaTypeName(vararg parameters: ParameterSpec = emptyArray()): LambdaTypeName
inline fun <R, R_> LambdaTypeName(vararg parameters: TypeName = emptyArray()): LambdaTypeName
inline fun <R, R_> LambdaTypeName(parameters: List<ParameterSpec> = emptyList()): LambdaTypeName
inline fun <R, R_> LambdaTypeName(parameters: List<ParameterSpec> = emptyList(), contextReceivers: List<TypeName> = emptyList()): LambdaTypeName
fun LambdaTypeName(receiver: TypeName? = null, vararg parameters: ParameterSpec = emptyArray(), returnType: TypeName): LambdaTypeName
fun LambdaTypeName(receiver: TypeName? = null, vararg parameters: TypeName = emptyArray(), returnType: TypeName): LambdaTypeName
fun LambdaTypeName(receiver: TypeName? = null, parameters: List<ParameterSpec> = emptyList(), returnType: TypeName): LambdaTypeName
fun LambdaTypeName(receiver: TypeName? = null, parameters: List<ParameterSpec> = emptyList(), returnType: TypeName, contextReceivers: List<TypeName> = emptyList()): LambdaTypeName
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Parameterizes this ClassName by T.

Link copied to clipboard
@DelicateKotlinPoetApi(message = "Element APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
fun ParameterSpec(element: VariableElement): ParameterSpec
inline fun <T> ParameterSpec(name: String, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun <T> ParameterSpec(name: String, modifiers: Iterable<KModifier>, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun ParameterSpec(name: String, type: TypeName, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun ParameterSpec(name: String, type: TypeName, modifiers: Iterable<KModifier>, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun ParameterSpec(name: String, type: Type, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun ParameterSpec(name: String, type: Type, modifiers: Iterable<KModifier>, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun ParameterSpec(name: String, type: KClass<*>, vararg modifiers: KModifier, block: ParameterSpecBuilderScope = {}): ParameterSpec
inline fun ParameterSpec(name: String, type: KClass<*>, modifiers: Iterable<KModifier>, block: ParameterSpecBuilderScope = {}): ParameterSpec
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T> PropertySpec(name: String, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun <T> PropertySpec(name: String, modifiers: Iterable<KModifier>, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun PropertySpec(name: String, type: TypeName, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun PropertySpec(name: String, type: TypeName, modifiers: Iterable<KModifier>, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun PropertySpec(name: String, type: Type, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
inline fun PropertySpec(name: String, type: Type, modifiers: Iterable<KModifier>, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun PropertySpec(name: String, type: KClass<*>, vararg modifiers: KModifier, block: PropertySpecBuilderScope = {}): PropertySpec
inline fun PropertySpec(name: String, type: KClass<*>, modifiers: Iterable<KModifier>, block: PropertySpecBuilderScope = {}): PropertySpec
Link copied to clipboard
Link copied to clipboard
inline fun <R> FunSpec.Builder.returns(kdoc: CodeBlock = emptyCodeBlock()): FunSpec.Builder
Link copied to clipboard
inline fun FileSpec.Companion.script(fileName: String, packageName: String = "", block: FileSpecBuilderScope = {}): FileSpec
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T> ParameterSpec.toBuilder(name: String = this.name): ParameterSpec.Builder
inline fun <T> PropertySpec.toBuilder(name: String = this.name): PropertySpec.Builder
inline fun <T> TypeAliasSpec.toBuilder(name: String = this.name): TypeAliasSpec.Builder
Link copied to clipboard
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
inline fun TypeAliasSpec(name: String, type: Type, block: TypeAliasSpecBuilderScope = {}): TypeAliasSpec
inline fun TypeAliasSpec(name: String, type: KClass<*>, block: TypeAliasSpecBuilderScope = {}): TypeAliasSpec
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Convenience function to avoid name clashes.