com.lemonappdev.konsist.core.declaration.KoComplexDeclaration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of konsist Show documentation
Show all versions of konsist Show documentation
A Kotlin architecture test library. Define and guard code base consistency using Kotlin.
package com.lemonappdev.konsist.core.declaration
import com.lemonappdev.konsist.core.const.KoModifier
import com.lemonappdev.konsist.core.declaration.provider.KoClassProvider
import com.lemonappdev.konsist.core.declaration.provider.KoCompanionObjectProvider
import com.lemonappdev.konsist.core.declaration.provider.KoDeclarationProviderUtil
import com.lemonappdev.konsist.core.declaration.provider.KoFunctionProvider
import com.lemonappdev.konsist.core.declaration.provider.KoInterfaceProvider
import com.lemonappdev.konsist.core.declaration.provider.KoObjectProvider
import com.lemonappdev.konsist.core.declaration.provider.KoPropertyProvider
import org.jetbrains.kotlin.psi.KtClassOrObject
abstract class KoComplexDeclaration(
private val ktClassOrObject: KtClassOrObject,
) : KoDeclaration(ktClassOrObject),
KoClassProvider,
KoInterfaceProvider,
KoObjectProvider,
KoCompanionObjectProvider,
KoPropertyProvider,
KoFunctionProvider {
fun representsType(name: String) =
name == fullyQualifiedName.substringAfterLast(".") || name == fullyQualifiedName
inline fun representsType() = T::class.qualifiedName == fullyQualifiedName
override fun declarations(
modifiers: List,
includeNested: Boolean,
includeLocal: Boolean,
): List = KoDeclarationProviderUtil.getKoDeclarations(ktClassOrObject, modifiers, includeNested, includeLocal)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy