com.github.themrmilchmann.kraton.lang.java / JavaTopLevelType

JavaTopLevelType

abstract class JavaTopLevelType<T : JavaTopLevelType<T, S>, S : JavaScope<T, S>> : JavaModifierTarget, JavaBodyMember, IJvmType (source)

A java top-level type.

Constructors

<init>

JavaTopLevelType(className: String, packageName: String, documentation: String?, since: String?, containerType: JavaTopLevelType<*, *>?)

Creates a new java top-level type.

Properties

className

open val className: String

the name of this type

documentation

val documentation: String?

the documentation of this type

enclosingType

open val enclosingType: JavaTopLevelType<*, *>?

The enclosing type of this type, if any.

packageName

open val packageName: String

the name of the package containing this type

since

val since: String?

Inherited Properties

containerName

open val containerName: String

The class name of the outermost enclosing type.

isNullable

open val isNullable: Boolean

Whether or not the referenced type is nullable.

memberName

open val memberName: String

The name of this class dot prefixed with the name of it's enclosing type.

name

abstract val name: String

The name of this java object.

Functions

authors

fun authors(vararg authors: String): Boolean

isImported

fun isImported(type: IJvmType): Boolean

isResolved

fun isResolved(type: IJvmType): Boolean

nullable

open fun nullable(): JvmTypeReference

Returns a nullable version of this IJVMType.

printMember

open fun PrintWriter.printMember(indent: String, containerType: JavaTopLevelType<*, *>): Unit

Prints this java object to the given PrintWriter.

scope

abstract fun scope(members: MutableSet<JavaBodyMember>, init: S.() -> Unit): S

see

fun see(ref: String): Boolean

Inherited Functions

compareTo

open fun compareTo(other: JavaBodyMember): Int

Extension Functions

PARAM

fun IJvmType.PARAM(name: String, documentation: String): JavaParameter

Shortcut to create a new JavaParameter.

array

fun IJvmType.array(dim: Int = 1, nullable: Boolean = isNullable): JvmArrayType

Shortcut to create a new JvmArrayType.

asString

fun IJvmType.asString(from: JavaTopLevelType<*, *>?): String

member

fun IJvmType.member(className: String, vararg typeParameters: IJvmType, nullable: Boolean = false): JvmMemberType

Creates and returns a new IJvmType which holds a reference to a member of the receiver type.

Inheritors

JavaClass

class JavaClass : JavaTopLevelType<JavaClass, JavaClassScope>

An object representing a Java class.

JavaInterface

class JavaInterface : JavaTopLevelType<JavaInterface, JavaInterfaceScope>

An object representing a Java interface.