Package org.jboss.jandex
Class JandexKotlin
java.lang.Object
org.jboss.jandex.JandexKotlin
Utilities to simplify handling Kotlin classes with Jandex.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeReturns the return type of the given Kotlinsuspendfunction.static booleanisKotlinClass(ClassInfo clazz) Returns whether the givenclazzis a Kotlin class.static booleanisKotlinContinuationParameter(MethodParameterInfo parameter) static booleanisKotlinMethod(MethodInfo method) Returns whether the givenmethodis a Kotlin function.static booleanisKotlinSuspendMethod(MethodInfo method) Returns whether the givenmethodis a Kotlinsuspendfunction.
-
Field Details
-
METADATA
The name ofkotlin.Metadata. This is an annotation that is present on all classes emitted by the Kotlin compiler. -
UNIT
The name ofkotlin.Unit. This is a unit type (type that is inhabited by exactly one value). When used as a return type, the Kotlin compiler usually emitsvoidfor compatibility with Java, but if a Kotlinsuspendfunction has a return type ofUnit, the type is retained in theCONTINUATIONparameter. -
CONTINUATION
The name ofkotlin.coroutines.Continuation. A synthetic parameter of this type is added by the Kotlin compiler to generatedsuspendfunctions and may be used to signal completion. Asuspendfunction may complete synchronously, in which case completion is signaled directly by the return value, or asynchronously, in which case the return value is theCOROUTINE_SUSPENDEDsentinel and completion is signaled through the continuation argument.
-
-
Constructor Details
-
JandexKotlin
public JandexKotlin()
-
-
Method Details
-
isKotlinClass
Returns whether the givenclazzis a Kotlin class.- Parameters:
clazz- the class to inspect, must not benull- Returns:
- whether the given
clazzis a Kotlin class
-
isKotlinMethod
Returns whether the givenmethodis a Kotlin function.- Parameters:
method- the method to inspect, must not benull- Returns:
- whether the given
methodis a Kotlin function
-
isKotlinSuspendMethod
Returns whether the givenmethodis a Kotlinsuspendfunction.- Parameters:
method- the method to inspect, must not benull- Returns:
- whether the given
methodis a Kotlinsuspendfunction
-
isKotlinContinuationParameter
- Parameters:
parameter- the method parameter to inspect, must not benull- Returns:
- whether the given
parameteris aCONTINUATIONparameter of a Kotlinsuspendfunction
-
getKotlinSuspendMethodResult
Returns the return type of the given Kotlinsuspendfunction. If the givenmethodis not a Kotlinsuspendfunction or if theCONTINUATIONparameter has an unexpected type signature, anIllegalArgumentExceptionis thrown.- Parameters:
method- the Kotlinsuspendfunction, must not benull- Returns:
- the return type of the given Kotlin
suspendfunction
-