Skip to content

Commit acf82e7

Browse files
committed
Use discrete headings instead of titled blocks in reference manual
This code switches from titled blocks to discrete headings in order to properly format pseudo-section headers in the reference manual. Closes gh-33447
1 parent 29fdcf5 commit acf82e7

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-collaborators.adoc

+12-9
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ Kotlin::
159159
----
160160
======
161161

162-
.[[beans-factory-ctor-arguments-type]]Constructor argument type matching
163-
--
162+
[discrete]
163+
[[beans-factory-ctor-arguments-type]]
164+
==== Constructor argument type matching
165+
164166
In the preceding scenario, the container can use type matching with simple types if
165167
you explicitly specify the type of the constructor argument via the `type` attribute,
166168
as the following example shows:
@@ -172,10 +174,11 @@ as the following example shows:
172174
<constructor-arg type="java.lang.String" value="42"/>
173175
</bean>
174176
----
175-
--
176177

177-
.[[beans-factory-ctor-arguments-index]]Constructor argument index
178-
--
178+
[discrete]
179+
[[beans-factory-ctor-arguments-index]]
180+
==== Constructor argument index
181+
179182
You can use the `index` attribute to specify explicitly the index of constructor arguments,
180183
as the following example shows:
181184

@@ -191,10 +194,11 @@ In addition to resolving the ambiguity of multiple simple values, specifying an
191194
resolves ambiguity where a constructor has two arguments of the same type.
192195

193196
NOTE: The index is 0-based.
194-
--
195197

196-
.[[beans-factory-ctor-arguments-name]]Constructor argument name
197-
--
198+
[discrete]
199+
[[beans-factory-ctor-arguments-name]]
200+
==== Constructor argument name
201+
198202
You can also use the constructor parameter name for value disambiguation, as the following
199203
example shows:
200204

@@ -244,7 +248,6 @@ Kotlin::
244248
constructor(val years: Int, val ultimateAnswer: String)
245249
----
246250
======
247-
--
248251

249252

250253
[[beans-setter-injection]]

framework-docs/modules/ROOT/pages/core/beans/java/composing-configuration-classes.adoc

+12-10
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ TIP: Constructor injection in `@Configuration` classes is only supported as of S
331331
Framework 4.3. Note also that there is no need to specify `@Autowired` if the target
332332
bean defines only one constructor.
333333

334-
.[[beans-java-injecting-imported-beans-fq]]Fully-qualifying imported beans for ease of navigation
335-
--
334+
[discrete]
335+
[[beans-java-injecting-imported-beans-fq]]
336+
==== Fully-qualifying imported beans for ease of navigation
337+
336338
In the preceding scenario, using `@Autowired` works well and provides the desired
337339
modularity, but determining exactly where the autowired bean definitions are declared is
338340
still somewhat ambiguous. For example, as a developer looking at `ServiceConfig`, how do
@@ -501,7 +503,6 @@ Now `ServiceConfig` is loosely coupled with respect to the concrete
501503
get a type hierarchy of `RepositoryConfig` implementations. In this
502504
way, navigating `@Configuration` classes and their dependencies becomes no different
503505
than the usual process of navigating interface-based code.
504-
--
505506

506507
TIP: If you want to influence the startup creation order of certain beans, consider
507508
declaring some of them as `@Lazy` (for creation on first access instead of on startup)
@@ -594,8 +595,10 @@ that uses Spring XML, it is easier to create `@Configuration` classes on an
594595
as-needed basis and include them from the existing XML files. Later in this section, we cover the
595596
options for using `@Configuration` classes in this kind of "`XML-centric`" situation.
596597

597-
.[[beans-java-combining-xml-centric-declare-as-bean]]Declaring `@Configuration` classes as plain Spring `<bean/>` elements
598-
--
598+
[discrete]
599+
[[beans-java-combining-xml-centric-declare-as-bean]]
600+
==== Declaring `@Configuration` classes as plain Spring `<bean/>` elements
601+
599602
Remember that `@Configuration` classes are ultimately bean definitions in the
600603
container. In this series examples, we create a `@Configuration` class named `AppConfig` and
601604
include it within `system-test-config.xml` as a `<bean/>` definition. Because
@@ -703,16 +706,16 @@ Kotlin::
703706
----
704707
======
705708

706-
707709
NOTE: In `system-test-config.xml` file, the `AppConfig` `<bean/>` does not declare an `id`
708710
element. While it would be acceptable to do so, it is unnecessary, given that no other bean
709711
ever refers to it, and it is unlikely to be explicitly fetched from the container by name.
710712
Similarly, the `DataSource` bean is only ever autowired by type, so an explicit bean `id`
711713
is not strictly required.
712-
--
713714

714-
.[[beans-java-combining-xml-centric-component-scan]] Using <context:component-scan/> to pick up `@Configuration` classes
715-
--
715+
[discrete]
716+
[[beans-java-combining-xml-centric-component-scan]]
717+
==== Using <context:component-scan/> to pick up `@Configuration` classes
718+
716719
Because `@Configuration` is meta-annotated with `@Component`, `@Configuration`-annotated
717720
classes are automatically candidates for component scanning. Using the same scenario as
718721
described in the previous example, we can redefine `system-test-config.xml` to take advantage of component-scanning.
@@ -736,7 +739,6 @@ The following example shows the modified `system-test-config.xml` file:
736739
</bean>
737740
</beans>
738741
----
739-
--
740742

741743
[[beans-java-combining-java-centric]]
742744
=== `@Configuration` Class-centric Use of XML with `@ImportResource`

0 commit comments

Comments
 (0)