Java Code Examples for kotlin.reflect.KFunction#isSuspend()

The following examples show how to use kotlin.reflect.KFunction#isSuspend() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractEncoderMethodReturnValueHandler.java    From spring-analysis-note with MIT License 5 votes vote down vote up
static private boolean isSuspend(@Nullable Method method) {
	if (method == null) {
		return false;
	}
	KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method);
	return (function != null && function.isSuspend());
}
 
Example 2
Source File: MethodParameter.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Return the generic return type of the method, with support of suspending
 * functions via Kotlin reflection.
 */
static private Type getGenericReturnType(Method method) {
	KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method);
	if (function != null && function.isSuspend()) {
		return ReflectJvmMapping.getJavaType(function.getReturnType());
	}
	return method.getGenericReturnType();
}
 
Example 3
Source File: MethodParameter.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Return the return type of the method, with support of suspending
 * functions via Kotlin reflection.
 */
static private Class<?> getReturnType(Method method) {
	KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method);
	if (function != null && function.isSuspend()) {
		Type paramType = ReflectJvmMapping.getJavaType(function.getReturnType());
		Class<?> paramClass = ResolvableType.forType(paramType).resolve();
		Assert.notNull(paramClass, "Type " + paramType + "can't be resolved to a class");
		return paramClass;
	}
	return method.getReturnType();
}
 
Example 4
Source File: AbstractMessageWriterResultHandler.java    From spring-analysis-note with MIT License 4 votes vote down vote up
static private boolean isSuspend(Method method) {
	KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method);
	return function != null && function.isSuspend();
}