kr.summitsystems.springbukkit.command.CommandAopUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-bukkit-command Show documentation
Show all versions of spring-bukkit-command Show documentation
Springframework based Bukkit plugin development kit.
The newest version!
package kr.summitsystems.springbukkit.command
import java.lang.reflect.Method
import java.lang.reflect.Parameter
import kotlin.coroutines.Continuation
import kotlin.reflect.KFunction
import kotlin.reflect.KParameter
import kotlin.reflect.full.valueParameters
object CommandAopUtils {
/**
*
*
* first parameter: CommandContext parameter
* last parameter: Continuation parameter (Coroutine)
*/
internal fun extractCommandParameters(method: Method): List {
return method.parameters
.filter { parameter ->
parameter.type != Continuation::class.java && parameter.type != CommandContext::class.java
}
}
internal fun extractCommandParameters(method: KFunction<*>): List {
return method.valueParameters
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy