Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Command Annotation #638

Closed
Tracked by #637
jvalkeal opened this issue Jan 25, 2023 · 0 comments
Closed
Tracked by #637

@Command Annotation #638

jvalkeal opened this issue Jan 25, 2023 · 0 comments
Milestone

Comments

@jvalkeal
Copy link
Contributor

@Command annotation is a replacement for @ShellComponent and @ShellMethod.

@ShellComponent was used as a @Component to easily add class container into context as a bean and then methods in it became possible targets as invocation.

@ShellMethod was used to target methods in @ShellComponent bean as candidates as shell commands.

Plan is to do a modern update how @Command overall would work as we don't need separate annotations if we do a bit more spring kung fu for scanning things from a classpath.

  • @Command Can be defined on both class and method
  • Annotated on a class level would introduce it to be a candidate for command container(bean instance as we need only one).
  • Annotated on a method level would target that particular method as a CommandRegistration.
  • Annotation on a class level would allow defining some common parameters which has been a requested feature so that there is a less duplication on an actual methods.

Possible field ideas:

public @interface Command {
  String[] command() default {};
  String[] alias() default {};
  String group() default "";
  String description() default "";
  boolean hidden() default false;
  InteractionMode[] interactionMode() default {};
}
@jvalkeal jvalkeal modified the milestone: 3.1.0-M1 Jan 25, 2023
@jvalkeal jvalkeal mentioned this issue Jan 25, 2023
7 tasks
jvalkeal added a commit to jvalkeal/spring-shell that referenced this issue Jan 27, 2023
- This is a first commit to add new annotation model
  which eventually will replace old legacy annotations
  like ShellComponent, ShellMethod, @ShellOption, etc.
- Adds subset of features needed for parity with manual
  use of CommandRegistration.
- Relates spring-projects#637
- Relates spring-projects#638
- Relates spring-projects#639
- Relates spring-projects#640
- Relates spring-projects#641
jvalkeal added a commit that referenced this issue Feb 8, 2023
- Use @Reflective with @command
- This should automatically register reflection hints
  and make native work again
- Relates #638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant