-
Notifications
You must be signed in to change notification settings - Fork 394
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
New Annotation Model #637
Milestone
Comments
Closed
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 24, 2023
- Split and separate new annotations with legacy annotations on a registration level. - Relates #637
jvalkeal
added a commit
to jvalkeal/spring-shell
that referenced
this issue
Mar 5, 2023
- Change ref field in OptionValues to providers takin an array. - Relates spring-projects#637
jvalkeal
added a commit
that referenced
this issue
Mar 18, 2023
jvalkeal
added a commit
that referenced
this issue
Apr 7, 2023
- Document better a relationship between annotation, legacy annotation and programmatic registration. - Relates #637
jvalkeal
added a commit
that referenced
this issue
Apr 10, 2023
- Add e2e samples - Add short option snippets as tabs content(to get later converted to an actual tabs). - Relates #637
jvalkeal
added a commit
that referenced
this issue
May 1, 2023
- Use tabbing model from a new docs backend. - Relates #637
Marking closed and expecting further issue in a separate tickes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current annotation model works like:
@ShellComponent
is needed to introduce wrapping class into context asBean
.StandardMethodTargetRegistrar
in a standard package queries@ShellComponent
beans from a context and scans@ShellMethod
methods and manually createsCommandRegistration
instances and register those intoCommandCatalog
.@ShellComponent
is a@Component
this wrapping class is then available as an object instance to target command invocation via reflection.Ultimate plan is to deprecate whole
spring-shell-standard
module and create a full modern annotation system replacement which aligns better withCommandRegistration
system and its new features(some only available if registration is created as a bean) which cannot be used with old annotations.We want to move away from all automatic ways what happens with
@ShellComponent
and align new annotation system with concepts from a modern boot/framework:In no particular order new annotations could look like(draft of some ideas and more detailed in annotation specific issues):
Command
@Command
on a class level would be used to mark it as target for finding commands and on a method level marking it as target for command logic. Annotation on a class level would be used to provide some defaults for methods in that particular class.Option
@Option
in a method parameter level to add metadata for command options.EnableCommand
@EnableCommand
annotation would be similar to boot's@ConfigurationProperties
defining class targets.CommandScan
@CommandScan
annotation would be similar to boot's@ConfigurationPropertiesScan
defining classpath scanning targets.ExitCode
@ExitCode
in a method level with@ExceptionResolver
would instruct non-interactive command what to return in case of an error.The text was updated successfully, but these errors were encountered: