Package-level declarations

Types

Link copied to clipboard
value class ReflectedClass<T : Any>(val javaClass: Class<T>)

Inlined wrapper for a Class providing reflection API using libGDX reflection utilities.

Link copied to clipboard
@RequiresOptIn(message = "This functionality uses reflection. APIs annotated with @Reflection rely on reflection and can throw com.badlogic.gdx.utils.reflect.ReflectionException when unable to complete an action. Reflection usage requires opt-in with @OptIn(Reflection::class) or propagating the warnings further with a @Reflection annotation. Note that reflection might not be fully supported by all platforms, especially third-party libGDX backends. Some platforms might require additional setup. For example, all classes that are instantiated solely by reflection must be listed in the robovm.xml file within the ForceLinkClasses section in order to work on iOS. Further reading: * https://libgdx.com/wiki/utils/reflection * https://kotlinlang.org/docs/opt-in-requirements.html ")
annotation class Reflection

Functions

Link copied to clipboard
inline fun <T : Annotation> Annotation.get(): T

Gets the instance of a declared annotation.

Link copied to clipboard
inline fun <T : Any> reflect(): ReflectedClass<T>

Wraps the selected T class with inlined ReflectedClass exposing libGDX reflection API.

fun <T : Any> reflect(javaClass: Class<T>): ReflectedClass<T>

Wraps the selected Class with inlined ReflectedClass exposing libGDX reflection API.

Wraps the selected class with inlined ReflectedClass exposing libGDX reflection API.

fun <T : Any> reflect(kotlinClass: KClass<T>): ReflectedClass<T>

Extracts Class from the given KClass and wraps it with inlined ReflectedClass exposing libGDX reflection API.