Class MethodInvocationCompleter

java.lang.Object
com.ultikits.ultitools.commands.tabcomplete.MethodInvocationCompleter
All Implemented Interfaces:
TabCompleter

public class MethodInvocationCompleter extends Object implements TabCompleter
Completer that invokes suggestion methods annotated with @CmdSuggest.

调用 @CmdSuggest 注解标注的建议方法的补全器。

Since:
6.2.0
Version:
1.0.0
Author:
wisdomme
  • Field Details

    • logger

      private static final Logger logger
  • Constructor Details

    • MethodInvocationCompleter

      public MethodInvocationCompleter()
  • Method Details

    • complete

      public List<String> complete(TabCompletionContext context)
      Description copied from interface: TabCompleter
      Generates completion suggestions based on the given context. 根据给定的上下文生成补全建议。
      Specified by:
      complete in interface TabCompleter
      Parameters:
      context - the tab completion context containing command state
      Returns:
      list of suggestions, never null
    • getSuggestName

      private String getSuggestName(Method method, String paramName)
      Gets the suggest method name for a parameter. 获取参数的建议方法名称。
    • getSuggestMethodsByName

      private Method[] getSuggestMethodsByName(Object executor, String suggestName)
      Gets suggest methods by name from the executor class or @CmdSuggest classes. 从执行器类或 @CmdSuggest 类中按名称获取建议方法。
    • findMethodsByName

      private Method[] findMethodsByName(Class<?> clazz, String methodName)
      Finds methods by name in a class. 在类中按名称查找方法。
    • invokeSuggestMethod

      private List<String> invokeSuggestMethod(TabCompletionContext context, Method suggestMethod)
      Invokes the suggest method and returns the results. 调用建议方法并返回结果。