Interface KSDeclaration

  • All Implemented Interfaces:
    com.google.devtools.ksp.symbol.KSAnnotated , com.google.devtools.ksp.symbol.KSExpectActual , com.google.devtools.ksp.symbol.KSModifierListOwner , com.google.devtools.ksp.symbol.KSNode

    
    public interface KSDeclaration
     implements KSModifierListOwner, KSAnnotated, KSExpectActual
                        

    A declaration, can be function declaration, class declaration and property declaration, or a type alias.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract KSName getSimpleName() Simple name of this declaration, usually the name identifier at the declaration site.
      abstract KSName getQualifiedName() 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 KSName getPackageName() The name of the package at which this declaration is declared.
      abstract KSDeclaration getParentDeclaration() Parent declaration of this declaration, i.e.
      abstract KSFile getContainingFile() The containing source file of this declaration, can be null if symbol does not come from a source file, i.e.
      abstract String getDocString() The doc string enclosed by \/\*\* and \*\/
      • Methods inherited from class com.google.devtools.ksp.symbol.KSNode

        accept, getLocation, getOrigin, getParent
      • Methods inherited from class com.google.devtools.ksp.symbol.KSExpectActual

        findActuals, findExpects, isActual, isExpect
      • Methods inherited from class com.google.devtools.ksp.symbol.KSModifierListOwner

        getModifiers
      • Methods inherited from class com.google.devtools.ksp.symbol.KSAnnotated

        getAnnotations
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • 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.

      • 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.