walkmc.processor.Declarations.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resources-addon Show documentation
Show all versions of resources-addon Show documentation
A resources API/Addon with compatibility with others plugins
The newest version!
package walkmc.processor
import com.google.devtools.ksp.*
import com.google.devtools.ksp.symbol.*
/**
* Gets the return type declaration of this property.
*/
val KSPropertyDeclaration.returnType: KSDeclaration
get() = type.resolve().declaration
/**
* Gets the return type name of this property.
*/
val KSPropertyDeclaration.returnTypeName: KSName?
get() = returnType.qualifiedName
/**
* Returns the first annotation found in this [KSAnnotated], or nulls if no annotation
* of the given type [T] is found.
*/
inline fun KSAnnotated.findAnnotation() =
getAnnotationsByType(T::class).firstOrNull()
/**
* Returns all properties of this class declaration.
*
* This returns inherited and declared properties.
*/
inline val KSClassDeclaration.properties
get() = getAllProperties()
/**
* Returns all declared properties of this class declaration.
*
* This returns only declared properties.
*/
inline val KSClassDeclaration.declaredProperties
get() = getDeclaredProperties()