Rename ShellMethod.help() to value(), as it is the only mandatory attribute.
This commit is contained in:
@@ -37,13 +37,13 @@ public @interface ShellMethod {
|
||||
* The name(s) by which this method can be invoked via Spring Shell. If not specified, the actual method name
|
||||
* will be used (turning camelCase humps into "-").
|
||||
*/
|
||||
String[] value() default {};
|
||||
String[] key() default {};
|
||||
|
||||
/**
|
||||
* A description for the command. Should not contain any formatting (e.g. html) characters and would typically
|
||||
* start with a capital letter and end with a dot.
|
||||
*/
|
||||
String help() default "";
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* The prefix to use for assigning parameters by name.
|
||||
|
||||
@@ -50,12 +50,12 @@ public class StandardMethodTargetRegistrar implements MethodTargetRegistrar {
|
||||
Class<?> clazz = bean.getClass();
|
||||
ReflectionUtils.doWithMethods(clazz, method -> {
|
||||
ShellMethod shellMapping = method.getAnnotation(ShellMethod.class);
|
||||
String[] keys = shellMapping.value();
|
||||
String[] keys = shellMapping.key();
|
||||
if (keys.length == 0) {
|
||||
keys = new String[] {method.getName()};
|
||||
}
|
||||
for (String key : keys) {
|
||||
MethodTarget target = new MethodTarget(method, bean, shellMapping.help());
|
||||
MethodTarget target = new MethodTarget(method, bean, shellMapping.value());
|
||||
registry.register(key, target);
|
||||
commands.put(key, target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user