Class MethodInvocationCompleter
java.lang.Object
com.ultikits.ultitools.commands.tabcomplete.MethodInvocationCompleter
- All Implemented Interfaces:
TabCompleter
Completer that invokes suggestion methods annotated with @CmdSuggest.
调用 @CmdSuggest 注解标注的建议方法的补全器。
- Since:
- 6.2.0
- Version:
- 1.0.0
- Author:
- wisdomme
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomplete(TabCompletionContext context) Generates completion suggestions based on the given context.private Method[]findMethodsByName(Class<?> clazz, String methodName) Finds methods by name in a class.private Method[]getSuggestMethodsByName(Object executor, String suggestName) Gets suggest methods by name from the executor class or @CmdSuggest classes.private StringgetSuggestName(Method method, String paramName) Gets the suggest method name for a parameter.invokeSuggestMethod(TabCompletionContext context, Method suggestMethod) Invokes the suggest method and returns the results.
-
Field Details
-
logger
-
-
Constructor Details
-
MethodInvocationCompleter
public MethodInvocationCompleter()
-
-
Method Details
-
complete
Description copied from interface:TabCompleterGenerates completion suggestions based on the given context. 根据给定的上下文生成补全建议。- Specified by:
completein interfaceTabCompleter- Parameters:
context- the tab completion context containing command state- Returns:
- list of suggestions, never null
-
getSuggestName
Gets the suggest method name for a parameter. 获取参数的建议方法名称。 -
getSuggestMethodsByName
Gets suggest methods by name from the executor class or @CmdSuggest classes. 从执行器类或 @CmdSuggest 类中按名称获取建议方法。 -
findMethodsByName
Finds methods by name in a class. 在类中按名称查找方法。 -
invokeSuggestMethod
Invokes the suggest method and returns the results. 调用建议方法并返回结果。
-