godot.entrygenerator.model.Clazz.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of godot-entry-generator Show documentation
Show all versions of godot-entry-generator Show documentation
Godot Kotlin entry code generator.
package godot.entrygenerator.model
import godot.entrygenerator.ext.hasAnnotation
import godot.tools.common.constants.GodotKotlinJvmTypes
import godot.tools.common.constants.godotApiPackage
open class Clazz(
open val fqName: String,
open val relativeSourcePath: String,
open val supertypes: List = emptyList(),
open val annotations: List = emptyList(),
open val isAbstract: Boolean = false,
override val symbolProcessorSource: Any
) : GodotJvmSourceElement {
val name: String
get() = fqName.substringAfterLast(".")
val containingPackage: String
get() = if (fqName.contains(".")) {
fqName.substringBeforeLast(".")
} else ""
internal val directlyInheritsGodotBaseClass: Boolean
get() = supertypes
.firstOrNull()
?.annotations
?.hasAnnotation() == true
internal val inheritsRefCounted: Boolean
get() = supertypes.any { it.fqName == "$godotApiPackage.${GodotKotlinJvmTypes.refCounted}" }
}