All Downloads are FREE. Search and download functionalities are using the official Maven repository.

walkmc.processor.Declarations.kt Maven / Gradle / Ivy

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()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy