CommandArgumentContext

interface CommandArgumentContext

指令参数环境, 即 CommandValueArgumentParser 的集合, 用于 CompositeCommandSimpleCommand.

在指令解析时, 总是从 CommandArgumentContextAware.context 搜索相关解析器

要构造 CommandArgumentContext, 参考 buildCommandArgumentContext

See also

Types

Builtins
Link copied to clipboard
object Builtins : CommandArgumentContext
Companion
Link copied to clipboard
object Companion
ParserPair
Link copied to clipboard
data class ParserPair<T : Any>(klass: KClass<T>, parser: CommandValueArgumentParser<T>)

Functions

get
Link copied to clipboard
abstract operator fun <T : Any> get(kClass: KClass<T>): CommandValueArgumentParser<T>?

获取一个 kClass 类型的解析器.

toList
Link copied to clipboard
abstract fun toList(): List<CommandArgumentContext.ParserPair<*>>

Inheritors

Builtins
Link copied to clipboard
EmptyCommandArgumentContext
Link copied to clipboard
SimpleCommandArgumentContext
Link copied to clipboard

Extensions

plus
Link copied to clipboard
operator fun CommandArgumentContext.plus(replacer: CommandArgumentContext): CommandArgumentContext

合并两个 buildCommandArgumentContext, replacer 将会替换 this 中重复的 parser.

operator fun CommandArgumentContext.plus(replacer: List<CommandArgumentContext.ParserPair<*>>): CommandArgumentContext

合并 thisreplacer, replacer 将会替换 this 中重复的 parser.