# Package-level declarations

## Types

ClassLoaderProvider
Link copied to clipboard
object ClassLoaderProvider

Provide a ClassLoader for reflection operations.

JBoolean
Link copied to clipboard
typealias JBoolean = Boolean

Reference to Java wrapper class java.lang.Boolean.

JByte
Link copied to clipboard
typealias JByte = Byte

Reference to Java wrapper class java.lang.Byte.

JCharacter
Link copied to clipboard
typealias JCharacter = Character

Reference to Java wrapper class java.lang.Character.

JDouble
Link copied to clipboard
typealias JDouble = Double

Reference to Java wrapper class java.lang.Double.

JFloat
Link copied to clipboard
typealias JFloat = Float

Reference to Java wrapper class java.lang.Float.

JInteger
Link copied to clipboard
typealias JInteger = Integer

Reference to Java wrapper class java.lang.Integer.

JLong
Link copied to clipboard
typealias JLong = Long

Reference to Java wrapper class java.lang.Long.

JShort
Link copied to clipboard
typealias JShort = Short

Reference to Java wrapper class java.lang.Short.

JVoid
Link copied to clipboard
typealias JVoid = Void

Reference to Java wrapper class java.lang.Void.

LazyClass
Link copied to clipboard
abstract class LazyClass < T : Any >

Lazy loading Class instance.

TypeRef
Link copied to clipboard
abstract class TypeRef < T : Any >

Type reference class for getting generic parameter T type.

VariousClass
Link copied to clipboard
class VariousClass (names: String )

A class that can load various classes by their names.

## Properties

hasInterfaces
Link copied to clipboard
val < T : Any > Class < T >. hasInterfaces : Boolean

Whether the current Class has implemented interfaces.

val < T : Any > KClass < T >. hasInterfaces : Boolean

Whether the current KClass.java has implemented interfaces.

hasSuperclass
Link copied to clipboard
val < T : Any > Class < T >. hasSuperclass : Boolean

Whether the current Class has inheritance relationship, and the superclass is Any will be considered to have no inheritance relationship.

val < T : Any > KClass < T >. hasSuperclass : Boolean

Whether the current KClass.java has inheritance relationship, and the superclass is Any will be considered to have no inheritance relationship.

isAbstract
Link copied to clipboard
val < T : Any > Class < T >. isAbstract : Boolean

Check if the Class is abstract.

val Member . isAbstract : Boolean

Check if the Member is abstract.

isFinal
Link copied to clipboard
val < T : Any > Class < T >. isFinal : Boolean

Check if the Class is final.

val Member . isFinal : Boolean

Check if the Member is final.

isInterface
Link copied to clipboard
val Member . isInterface : Boolean

Check if the Member is an interface.

isNative
Link copied to clipboard
val < T : Any > Class < T >. isNative : Boolean

Check if the Class is native.

val Member . isNative : Boolean

Check if the Member is native.

isPrivate
Link copied to clipboard
val < T : Any > Class < T >. isPrivate : Boolean

Check if the Class is private.

val Member . isPrivate : Boolean

Check if the Member is private.

isProtected
Link copied to clipboard
val < T : Any > Class < T >. isProtected : Boolean

Check if the Class is protected.

val Member . isProtected : Boolean

Check if the Member is protected.

isPublic
Link copied to clipboard
val < T : Any > Class < T >. isPublic : Boolean

Check if the Class is public.

val Member . isPublic : Boolean

Check if the Member is public.

isStatic
Link copied to clipboard
val < T : Any > Class < T >. isStatic : Boolean

Check if the Class is static.

val Member . isStatic : Boolean

Check if the Member is static.

isStrict
Link copied to clipboard
val < T : Any > Class < T >. isStrict : Boolean

Check if the Class is strict.

val Member . isStrict : Boolean

Check if the Member is strict.

isSynchronized
Link copied to clipboard
val < T : Any > Class < T >. isSynchronized : Boolean

Check if the Class is synchronized.

val Member . isSynchronized : Boolean

Check if the Member is synchronized.

isTransient
Link copied to clipboard
val < T : Any > Class < T >. isTransient : Boolean

Check if the Class is transient.

val Member . isTransient : Boolean

Check if the Member is transient.

isVolatile
Link copied to clipboard
val < T : Any > Class < T >. isVolatile : Boolean

Check if the Class is volatile.

val Member . isVolatile : Boolean

Check if the Member is volatile.

## Functions

ArrayClass
Link copied to clipboard
@ JvmName (name = "createArrayClass")
fun ArrayClass (type: Class <*>): Class < Array >
@ JvmOverloads
@ JvmName (name = "createArrayClass")
fun ArrayClass (type: String , loader: ClassLoader ? = null): Class < Array >

Create a Class for an array of the specified type.

fun ArrayClass (type: KClass <*>): Class < Array >

Create a KClass.java for an array of the specified type.

asParameterizedType
Link copied to clipboard
inline fun < T : Type > T . asParameterizedType (): ParameterizedType

Convert Type to ParameterizedType.

asParameterizedTypeOrNull
Link copied to clipboard
inline fun < T : Type > T . asParameterizedTypeOrNull (): ParameterizedType ?

Safely convert Type to ParameterizedType or return null if it fails.

classOf
Link copied to clipboard
inline fun < T : Any > classOf (primitiveType: Boolean = true): Class < T >

Typecast T to Class.

createInstance
Link copied to clipboard
@ JvmOverloads
fun < T : Any > Class < T >. createInstance (vararg args: Any ?, isPublic: Boolean = true): T

Create an instance of Class with the given arguments.

fun < T : Any > KClass < T >. createInstance (vararg args: Any ?, isPublic: Boolean = true): T

Create an instance of KClass.java with the given arguments.

createInstanceAsType
Link copied to clipboard
inline fun < T : Any > Class <*>. createInstanceAsType (vararg args: Any ?, isPublic: Boolean = true): T

Create an instance of Class with the given arguments and cast it to the specified type T.

inline fun < T : Any > KClass <*>. createInstanceAsType (vararg args: Any ?, isPublic: Boolean = true): T

Create an instance of KClass.java with the given arguments and cast it to the specified type T.

createInstanceAsTypeOrNull
Link copied to clipboard
inline fun < T : Any > Class <*>. createInstanceAsTypeOrNull (vararg args: Any ?, isPublic: Boolean = true): T ?

Create an instance of Class with the given arguments and cast it to the specified type T or return null if not found.

inline fun < T : Any > KClass <*>. createInstanceAsTypeOrNull (vararg args: Any ?, isPublic: Boolean = true): T ?

Create an instance of KClass.java with the given arguments and cast it to the specified type T or return null if not found.

createInstanceOrNull
Link copied to clipboard
@ JvmOverloads
fun < T : Any > Class < T >. createInstanceOrNull (vararg args: Any ?, isPublic: Boolean = true): T ?

Create an instance of Class with the given arguments or return null if not found.

fun < T : Any > KClass < T >. createInstanceOrNull (vararg args: Any ?, isPublic: Boolean = true): T ?

Create an instance of KClass.java with the given arguments or return null if not found.

genericSuperclassTypeArguments
Link copied to clipboard
fun < T : Any > Class < T >. genericSuperclassTypeArguments (): Array < Type >

Get the type arguments of the superclass of this Class or return an empty array if it fails.

fun < T : Any > KClass < T >. genericSuperclassTypeArguments (): Array < Type >

Get the type arguments of the superclass of this KClass.java or return an empty array if it fails.

hasClass
Link copied to clipboard
fun ClassLoader . hasClass (name: String ): Boolean

Check if the ClassLoader can load the class with the given name.

isNotSubclassOf
Link copied to clipboard
infix fun < T : Any > Class < T >. isNotSubclassOf (superclass: Class <*>): Boolean

Use Class.isAssignableFrom to check if Class is not a subclass of superclass.

infix fun < T : Any > Class < T >. isNotSubclassOf (superclass: KClass <*>): Boolean

Use Class.isAssignableFrom to check if Class is not a subclass of superclass (KClass.java).

infix fun < T : Any > KClass < T >. isNotSubclassOf (superclass: Class <*>): Boolean

Use Class.isAssignableFrom to check if KClass.java is not a subclass of superclass.

infix fun < T : Any > KClass < T >. isNotSubclassOf (superclass: KClass <*>): Boolean

Use Class.isAssignableFrom to check if KClass.java is not a subclass of superclass (KClass.java).

isSubclassOf
Link copied to clipboard
infix fun < T : Any > Class < T >. isSubclassOf (superclass: Class <*>): Boolean

Use Class.isAssignableFrom to check if Class is a subclass of superclass.

infix fun < T : Any > Class < T >. isSubclassOf (superclass: KClass <*>): Boolean

Use Class.isAssignableFrom to check if Class is a subclass of superclass (KClass.java).

infix fun < T : Any > KClass < T >. isSubclassOf (superclass: Class <*>): Boolean

Use Class.isAssignableFrom to check if KClass.java is a subclass of superclass.

infix fun < T : Any > KClass < T >. isSubclassOf (superclass: KClass <*>): Boolean

Use Class.isAssignableFrom to check if KClass.java is a subclass of superclass (KClass.java).

lazyClass
Link copied to clipboard
fun lazyClass (variousClass: VariousClass , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.NonNull < Any >
@ JvmName (name = "lazyClassTyped")
fun < T : Any > lazyClass (variousClass: VariousClass , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.NonNull < T >

Create a non-null instance of VariousClass.

fun lazyClass (name: String , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.NonNull < Any >
@ JvmName (name = "lazyClassTyped")
fun < T : Any > lazyClass (name: String , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.NonNull < T >

Create a non-null instance of Class.

lazyClassOrNull
Link copied to clipboard
fun lazyClassOrNull (variousClass: VariousClass , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.Nullable < Any >
@ JvmName (name = "lazyClassOrNullTyped")
fun < T : Any > lazyClassOrNull (variousClass: VariousClass , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.Nullable < T >

Create a nullable instance of VariousClass.

fun lazyClassOrNull (name: String , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.Nullable < Any >
@ JvmName (name = "lazyClassOrNullTyped")
fun < T : Any > lazyClassOrNull (name: String , initialize: Boolean = false, loader: ClassLoaderInitializer? = null): LazyClass.Nullable < T >

Create a nullable instance of Class.

loadClassOrNull
Link copied to clipboard
fun ClassLoader . loadClassOrNull (name: String ): Class < Any >?

Load the class with the given name using ClassLoader or return null if not found.

makeAccessible
Link copied to clipboard
inline fun < T : Member > T . makeAccessible ()

Make AccessibleObject implements Member accessible.

toClass
Link copied to clipboard
@ JvmName (name = "toClassTyped")
fun < T : Any > Type . toClass (): Class < T >
fun Type . toClass (): Class < Any >

Convert Type to Class.

@ JvmOverloads
@ JvmName (name = "create")
fun String . toClass (loader: ClassLoader ? = null, initialize: Boolean = false): Class < Any >
@ JvmOverloads
@ JvmName (name = "createTyped")
fun < T : Any > String . toClass (loader: ClassLoader ? = null, initialize: Boolean = false): Class < T >

Convert String class name to Class with ClassLoader and initialize.

toClassOrNull
Link copied to clipboard
@ JvmName (name = "toClassTypedOrNull")
fun < T : Any > Type . toClassOrNull (): Class < T >?
fun Type . toClassOrNull (): Class < Any >?

Safely convert Type to Class or return null if it fails.

@ JvmOverloads
@ JvmName (name = "createOrNull")
fun String . toClassOrNull (loader: ClassLoader ? = null, initialize: Boolean = false): Class < Any >?
@ JvmOverloads
@ JvmName (name = "createOrNullTyped")
fun < T : Any > String . toClassOrNull (loader: ClassLoader ? = null, initialize: Boolean = false): Class < T >?

Convert String class name to Class with ClassLoader and initialize.

typeRef
Link copied to clipboard
inline fun < T : Any > typeRef (): TypeRef < T >

Create a TypeRef instance with the reified type parameter T.