模块 linlang.api

接口 LinCommand.TypeResolver

封闭接口:
LinCommand

public static interface LinCommand.TypeResolver
自定义命令参数类型解析器。
  • 方法详细资料

    • supports

      boolean supports(String typeId)
      判断是否支持参数类型。
      参数:
      typeId - 类型 ID
      返回:
      支持时为 true
    • parse

      Object parse(LinCommand.ParseCtx ctx, String token) throws Exception
      解析单个命令参数。
      参数:
      ctx - 解析上下文
      token - 原始参数文本
      返回:
      解析后的值
      抛出:
      Exception - 参数无效或解析失败时
    • complete

      List<String> complete(LinCommand.ParseCtx ctx, String prefix)
      提供参数补全候选。
      参数:
      ctx - 解析上下文
      prefix - 当前输入前缀
      返回:
      补全候选