ClassDeclaration

data class ClassDeclaration(val name: String, val fqName: String, val packageName: String, val isInterface: Boolean, val isAbstract: Boolean, val annotations: List<AnnotationDeclaration>, val imports: List<String>, val referencedTypes: Set<String>, val filePath: String, val visibility: Visibility = Visibility.PUBLIC, val modifiers: Set<Modifier> = emptySet(), val supertypes: List<String> = emptyList(), val primaryConstructor: ConstructorDeclaration? = null, val secondaryConstructors: List<ConstructorDeclaration> = emptyList(), val functions: List<FunctionDeclaration> = emptyList(), val properties: List<PropertyDeclaration> = emptyList(), val companionObject: ClassDeclaration? = null, val kdocText: String? = null, val importAliases: Map<String, String> = emptyMap(), val isEnum: Boolean = false)

Represents a parsed Kotlin class, interface, or object declaration.

Constructors

Link copied to clipboard
constructor(name: String, fqName: String, packageName: String, isInterface: Boolean, isAbstract: Boolean, annotations: List<AnnotationDeclaration>, imports: List<String>, referencedTypes: Set<String>, filePath: String, visibility: Visibility = Visibility.PUBLIC, modifiers: Set<Modifier> = emptySet(), supertypes: List<String> = emptyList(), primaryConstructor: ConstructorDeclaration? = null, secondaryConstructors: List<ConstructorDeclaration> = emptyList(), functions: List<FunctionDeclaration> = emptyList(), properties: List<PropertyDeclaration> = emptyList(), companionObject: ClassDeclaration? = null, kdocText: String? = null, importAliases: Map<String, String> = emptyMap(), isEnum: Boolean = false)

Properties

Link copied to clipboard

List of annotations declared on this class.

Link copied to clipboard
Link copied to clipboard

The absolute path of the file containing this class.

Link copied to clipboard

The fully qualified name of the class (e.g., com.acme.domain.GetUserUseCase).

Link copied to clipboard
Link copied to clipboard

Map of local aliases to their fully-qualified names.

Link copied to clipboard

List of exact import directives in the file containing this class.

Link copied to clipboard

True if this declaration is marked with the abstract modifier.

Link copied to clipboard
val isEnum: Boolean = false

True if this declaration represents an enum class.

Link copied to clipboard

True if this declaration represents an interface.

Link copied to clipboard
val kdocText: String? = null
Link copied to clipboard
Link copied to clipboard

The simple name of the class (e.g., GetUserUseCase).

Link copied to clipboard

The package name of the class (e.g., com.acme.domain).

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

Set of simple types referenced/accessed in this class body (used for dependency inference).

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Helper extension to check if a class is annotated with all of the specified annotations.

Link copied to clipboard

Helper extension to check if a class is annotated with the given annotation.

Link copied to clipboard

Helper extension to check if a class is annotated with any of the specified annotations.