Registration section

- Move bean/anno sections here
- Relates #558
This commit is contained in:
Janne Valkealahti
2022-10-30 05:43:44 +00:00
parent bec85188aa
commit a518414015
4 changed files with 15 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
=== Annotation Model
==== Annotation Model
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
When you use the standard API, methods on beans are turned into executable commands, provided that:

View File

@@ -1,4 +1,4 @@
=== Programmatic Model
==== Programmatic Model
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
In the programmatic model, `CommandRegistration` is defined as a `@Bean`, and it is automatically registered:

View File

@@ -0,0 +1,12 @@
=== Registration
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
There are two different ways to define a command: through an annotation model and
through a programmatic model. In the annotation model, you define your methods
in a class and annotate the class and the methods with specific annotations.
In the programmatic model, you use a more low level approach, defining command
registrations (either as beans or by dynamically registering with a command catalog).
include::using-shell-commands-annotationmodel.adoc[]
include::using-shell-commands-programmaticmodel.adoc[]

View File

@@ -5,15 +5,7 @@ In this section, we go through an actual command registration and leave command
and execution for later in a documentation. You can find more detailed info in
<<appendix-tech-intro-registration>>.
There are two different ways to define a command: through an annotation model and
through a programmatic model. In the annotation model, you define your methods
in a class and annotate the class and the methods with specific annotations. In the programmatic model,
you use a more low level approach, defining command registrations (either
as beans or by dynamically registering with a command catalog).
include::using-shell-commands-annotationmodel.adoc[]
include::using-shell-commands-programmaticmodel.adoc[]
include::using-shell-commands-registration.adoc[]
include::using-shell-commands-organize.adoc[]