Package-level declarations

Types

Link copied to clipboard
data class ClassData(val declarationContainer: KmClass, val className: ClassName, val annotations: Collection<AnnotationSpec>, val properties: Map<KmProperty, PropertyData>, val constructors: Map<KmConstructor, ConstructorData>, val methods: Map<KmFunction, MethodData>) : ContainerData

Represents relevant information on a Kotlin class used for ClassInspector. Can only ever be applied on a class and not file facades.

Link copied to clipboard
interface ClassInspector

A basic interface for looking up JVM information about a given Class.

Link copied to clipboard
data class ConstructorData(annotations: List<AnnotationSpec>, val parameterAnnotations: Map<Int, Collection<AnnotationSpec>>, val isSynthetic: Boolean, val jvmModifiers: Set<JvmMethodModifier>, val exceptions: List<TypeName>)

Represents relevant information on a constructor used for ClassInspector. Should only be associated with constructors of a ClassData.

Link copied to clipboard
interface ContainerData

Represents relevant information on a declaration container used for ClassInspector. Can only ever be applied on a Kotlin type (i.e. is annotated with Metadata).

Link copied to clipboard
data class EnumEntryData(val declarationContainer: KmClass?, val annotations: Collection<AnnotationSpec>)

Represents relevant information on a Kotlin enum entry.

Link copied to clipboard
data class FieldData(annotations: List<AnnotationSpec>, val isSynthetic: Boolean, val jvmModifiers: Set<JvmFieldModifier>, val constant: CodeBlock?)

Represents relevant information on a field used for ClassInspector. Should only be associated with a PropertyData.

Link copied to clipboard
data class FileData(val declarationContainer: KmPackage, val annotations: Collection<AnnotationSpec>, val properties: Map<KmProperty, PropertyData>, val methods: Map<KmFunction, MethodData>, val className: ClassName, val jvmName: String? = if (!className.simpleName.endsWith("Kt")) className.simpleName else null) : ContainerData

Represents relevant information on a file facade used for ClassInspector.

Link copied to clipboard

Modifiers that are annotations in Kotlin but modifier keywords in bytecode.

Link copied to clipboard

Modifiers that are annotations or implicit in Kotlin but modifier keywords in bytecode.

Link copied to clipboard
interface JvmModifier

Represents a JVM modifier that is represented as an annotation in Kotlin but as a modifier in bytecode. Examples include annotations such as @JvmStatic or @JvmSynthetic.

Link copied to clipboard
data class MethodData(annotations: List<AnnotationSpec>, val parameterAnnotations: Map<Int, Collection<AnnotationSpec>>, val isSynthetic: Boolean, val jvmModifiers: Set<JvmMethodModifier>, val isOverride: Boolean, val exceptions: List<TypeName>)

Represents relevant information on a method used for ClassInspector. Should only be associated with methods of a ClassData or PropertyData.

Link copied to clipboard
data class PropertyData(annotations: List<AnnotationSpec>, val fieldData: FieldData?, val getterData: MethodData?, val setterData: MethodData?, val isJvmField: Boolean)

Represents relevant information on a property used for ClassInspector. Should only be associated with properties of a ClassData.

Properties

Link copied to clipboard

true if this is an extension type (i.e. String.() -> Unit vs (String) -> Unit).

Functions

Link copied to clipboard
fun ClassInspector.classFor(className: ClassName): KmClass

Looks up other classes, such as for nested members. Note that this class would always be Kotlin, so Metadata can be relied on for this.

Link copied to clipboard
fun ClassInspector.containerData(className: ClassName, parentClassName: ClassName?): ContainerData

Creates a new ContainerData instance for a given className.

Link copied to clipboard
fun Class<*>.toFileSpec(classInspector: ClassInspector? = null): FileSpec
fun TypeElement.toFileSpec(classInspector: ClassInspector? = null): FileSpec
fun KClass<*>.toFileSpec(classInspector: ClassInspector? = null): FileSpec
fun KmClass.toFileSpec(classInspector: ClassInspector?, className: ClassName = createClassName(name)): FileSpec
fun KmPackage.toFileSpec(classInspector: ClassInspector?, className: ClassName): FileSpec
Link copied to clipboard
fun Class<*>.toTypeSpec(classInspector: ClassInspector? = null): TypeSpec
fun TypeElement.toTypeSpec(classInspector: ClassInspector? = null): TypeSpec
fun KClass<*>.toTypeSpec(classInspector: ClassInspector? = null): TypeSpec
fun KmClass.toTypeSpec(classInspector: ClassInspector?, className: ClassName = createClassName(name)): TypeSpec