Class KotlinReflectionUtils
java.lang.Object
io.fluxzero.common.reflection.KotlinReflectionUtils
Provides utilities for bridging Java reflection with Kotlin reflection.
This class enables Fluxzero internals to interact with Kotlin symbols at runtime, such as retrieving
KFunction or KParameter instances from Java Methods,
Constructors, and Parameters.
It is used primarily to support nullability introspection and Kotlin-specific constructs in reflection-based logic.
Note: This utility is internal and should not be considered part of the public API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic kotlin.reflect.KFunction<?> asKotlinFunction(Executable executable) Maps a Java method or constructor to its Kotlin reflection function, or returns null if no mapping exists.static kotlin.reflect.KParameterasKotlinParameter(Parameter parameter) Maps a Java parameter to the corresponding Kotlin value parameter.static Class<?> convertIfKotlinClass(Object classObject) Returns the Java class represented by a Kotlin class literal, or null for other inputs.static StringgetKotlinParameterName(Parameter parameter) Returns the Kotlin source parameter name for a Java reflection parameter.static Constructor<?> getPrimaryConstructor(Class<?> type) Returns the Java reflection constructor that corresponds to a Kotlin class' primary constructor.
-
Constructor Details
-
KotlinReflectionUtils
public KotlinReflectionUtils()
-
-
Method Details
-
asKotlinParameter
Maps a Java parameter to the corresponding Kotlin value parameter. Returns null if no value parameter matches, and throwsIllegalStateExceptionif the executable has no Kotlin function. -
getKotlinParameterName
-
getPrimaryConstructor
Returns the Java reflection constructor that corresponds to a Kotlin class' primary constructor.- Parameters:
type- the Kotlin type to inspect- Returns:
- the Java constructor for the Kotlin primary constructor, or
nullwhen none is available
-
asKotlinFunction
Maps a Java method or constructor to its Kotlin reflection function, or returns null if no mapping exists. -
convertIfKotlinClass
-