-
- All Implemented Interfaces:
-
com.google.devtools.ksp.symbol.KSAnnotated,com.google.devtools.ksp.symbol.KSDeclaration,com.google.devtools.ksp.symbol.KSDeclarationContainer,com.google.devtools.ksp.symbol.KSExpectActual,com.google.devtools.ksp.symbol.KSModifierListOwner,com.google.devtools.ksp.symbol.KSNode
public interface KSClassDeclaration implements KSDeclaration, KSDeclarationContainer
Models class-like declarations, including class, interface and object.
-
-
Method Summary
Modifier and Type Method Description abstract Sequence<KSClassDeclaration>getSealedSubclasses()abstract Sequence<KSFunctionDeclaration>getAllFunctions()Get all member functions of a class declaration, including declared and inherited. abstract Sequence<KSPropertyDeclaration>getAllProperties()Get all member properties of a class declaration, including declared and inherited. abstract KSTypeasType(List<KSTypeArgument> typeArguments)Create a type by applying a list of type arguments to this class' type parameters. abstract KSTypeasStarProjectedType()If this is a generic class, return the type where the type argument is applied with star projection at use-site. abstract ClassKindgetClassKind()The Kind of the class declaration. abstract KSFunctionDeclarationgetPrimaryConstructor()Primary constructor of a class, secondary constructors can be obtained by filtering declarations. abstract Sequence<KSTypeReference>getSuperTypes()Sequence of supertypes of this class, containing both super class and implemented interfaces. abstract BooleangetIsCompanionObject()Determine whether this class declaration is a companion object. abstract KSNamegetSimpleName()Simple name of this declaration, usually the name identifier at the declaration site. abstract KSNamegetQualifiedName()Fully qualified name of this declaration, might not exist for some declarations like local declarations. abstract List<KSTypeParameter>getTypeParameters()List of type parameters of the declaration. abstract KSNamegetPackageName()The name of the package at which this declaration is declared. abstract KSDeclarationgetParentDeclaration()Parent declaration of this declaration, i.e. abstract KSFilegetContainingFile()The containing source file of this declaration, can be null if symbol does not come from a source file, i.e. abstract StringgetDocString()The doc string enclosed by \/\*\* and \*\/ abstract Set<Modifier>getModifiers()The set of modifiers on this element. abstract OrigingetOrigin()abstract LocationgetLocation()abstract KSNodegetParent()abstract Sequence<KSAnnotation>getAnnotations()All annotations on this symbol. abstract BooleangetIsActual()True if this is an actualimplementation.abstract BooleangetIsExpect()True if this is an expectdeclaration.abstract Sequence<KSDeclaration>getDeclarations()Declarations that are lexically declared inside the current container. -
Methods inherited from class com.google.devtools.ksp.symbol.KSModifierListOwner
accept -
Methods inherited from class com.google.devtools.ksp.symbol.KSDeclaration
findActuals, findExpects -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSealedSubclasses
abstract Sequence<KSClassDeclaration> getSealedSubclasses()
-
getAllFunctions
abstract Sequence<KSFunctionDeclaration> getAllFunctions()
Get all member functions of a class declaration, including declared and inherited.
-
getAllProperties
abstract Sequence<KSPropertyDeclaration> getAllProperties()
Get all member properties of a class declaration, including declared and inherited.
-
asType
abstract KSType asType(List<KSTypeArgument> typeArguments)
Create a type by applying a list of type arguments to this class' type parameters.
- Parameters:
typeArguments- List of Type arguments to be applied.
-
asStarProjectedType
abstract KSType asStarProjectedType()
If this is a generic class, return the type where the type argument is applied with star projection at use-site.
-
getClassKind
abstract ClassKind getClassKind()
The Kind of the class declaration.
-
getPrimaryConstructor
abstract KSFunctionDeclaration getPrimaryConstructor()
Primary constructor of a class, secondary constructors can be obtained by filtering declarations.
-
getSuperTypes
abstract Sequence<KSTypeReference> getSuperTypes()
Sequence of supertypes of this class, containing both super class and implemented interfaces.
-
getIsCompanionObject
abstract Boolean getIsCompanionObject()
Determine whether this class declaration is a companion object.
-
getSimpleName
abstract KSName getSimpleName()
Simple name of this declaration, usually the name identifier at the declaration site.
-
getQualifiedName
abstract KSName getQualifiedName()
Fully qualified name of this declaration, might not exist for some declarations like local declarations.
-
getTypeParameters
abstract List<KSTypeParameter> getTypeParameters()
List of type parameters of the declaration.
-
getPackageName
abstract KSName getPackageName()
The name of the package at which this declaration is declared.
-
getParentDeclaration
abstract KSDeclaration getParentDeclaration()
Parent declaration of this declaration, i.e. the declaration that directly contains this declaration. File is not a declaration, so this property will be null for top level declarations.
-
getContainingFile
abstract KSFile getContainingFile()
The containing source file of this declaration, can be null if symbol does not come from a source file, i.e. from a class file.
-
getDocString
abstract String getDocString()
The doc string enclosed by \/\*\* and \*\/
-
getModifiers
abstract Set<Modifier> getModifiers()
The set of modifiers on this element.
-
getLocation
abstract Location getLocation()
-
getAnnotations
abstract Sequence<KSAnnotation> getAnnotations()
All annotations on this symbol.
-
getIsActual
abstract Boolean getIsActual()
True if this is an
actualimplementation.
-
getIsExpect
abstract Boolean getIsExpect()
True if this is an
expectdeclaration.
-
getDeclarations
abstract Sequence<KSDeclaration> getDeclarations()
Declarations that are lexically declared inside the current container.
-
-
-
-