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

JavaScope

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

Constructors

<init>

JavaScope(scopeRoot: T, members: MutableSet<JavaBodyMember>)

Properties

members

val members: MutableSet<JavaBodyMember>

scopeRoot

val scopeRoot: T

Functions

authors

fun authors(vararg authors: String): Boolean

group

fun group(name: String = "", sortingStrategy: Comparator<JavaBodyMember>? = null, headerPrinter: PrintWriter.(indent: String, group: JavaBodyMemberGroup<*, *>) -> Unit = null, init: S.() -> Unit): JavaBodyMemberGroup<T, S>

Creates and registers a new group. For Java code a group is a solely theoretical construct that may be used to group elements logically.

import

fun import(type: String, isStatic: Boolean = false, isImplicit: Boolean = false): Unit

Imports all types that are directly underneath the given type using a wildcard import.

fun import(type: IJvmType, forceMode: JavaImportForceMode? = null, isImplicit: Boolean = false): Unit?

Imports the given type.

fun import(type: IJvmType, member: String, forceMode: JavaImportForceMode? = null, isImplicit: Boolean = false): Unit?

Statically imports the given member type.

javaClass

fun javaClass(className: String, documentation: String? = null, since: String? = null, superClass: IJvmType? = null, interfaces: Array<out IJvmType>? = null, init: JavaClassScope.() -> Unit): JavaClass

Creates, registers and returns an object representing a Java class.

javaInterface

fun javaInterface(className: String, documentation: String? = null, since: String? = null, superInterfaces: Array<out IJvmType>? = null, init: JavaInterfaceScope.() -> Unit): JavaInterface

Creates, registers and returns an object representing a Java interface.

see

fun see(ref: String): Boolean

Inheritors

JavaClassScope

class JavaClassScope : JavaScope<JavaClass, JavaClassScope>

JavaInterfaceScope

class JavaInterfaceScope : JavaScope<JavaInterface, JavaInterfaceScope>