Replace 'e.g.' with 'for example' in documentation and comments

Closes gh-33515
This commit is contained in:
Yanming Zhou 2024-09-26 14:03:46 +02:00 committed by Sam Brannen
parent e55fe9077f
commit 8941e2876e
722 changed files with 1290 additions and 1290 deletions

View File

@ -86,7 +86,7 @@ multiple edits or corrections of the same logical change. See
for an overview of streamlining the commit history. for an overview of streamlining the commit history.
1. Format commit messages using 55 characters for the subject line, 72 characters per line 1. Format commit messages using 55 characters for the subject line, 72 characters per line
for the description, followed by the issue fixed, e.g. `Closes gh-22276`. See the for the description, followed by the issue fixed, for example, `Closes gh-22276`. See the
[Commit Guidelines section of Pro Git](https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines) [Commit Guidelines section of Pro Git](https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines)
for best practices around commit messages, and use `git log` to see some examples. for best practices around commit messages, and use `git log` to see some examples.

View File

@ -9,7 +9,7 @@ You can make an introduction by using the `@DeclareParents` annotation. This ann
is used to declare that matching types have a new parent (hence the name). For example, is used to declare that matching types have a new parent (hence the name). For example,
given an interface named `UsageTracked` and an implementation of that interface named given an interface named `UsageTracked` and an implementation of that interface named
`DefaultUsageTracked`, the following aspect declares that all implementors of service `DefaultUsageTracked`, the following aspect declares that all implementors of service
interfaces also implement the `UsageTracked` interface (e.g. for statistics via JMX): interfaces also implement the `UsageTracked` interface (for example, for statistics via JMX):
[tabs] [tabs]
====== ======

View File

@ -65,7 +65,7 @@ with less potential for errors. For example, you do not need to invoke the `proc
method on the `JoinPoint` used for around advice, and, hence, you cannot fail to invoke it. method on the `JoinPoint` used for around advice, and, hence, you cannot fail to invoke it.
All advice parameters are statically typed so that you work with advice parameters of All advice parameters are statically typed so that you work with advice parameters of
the appropriate type (e.g. the type of the return value from a method execution) rather the appropriate type (for example, the type of the return value from a method execution) rather
than `Object` arrays. than `Object` arrays.
The concept of join points matched by pointcuts is the key to AOP, which distinguishes The concept of join points matched by pointcuts is the key to AOP, which distinguishes

View File

@ -20,7 +20,7 @@ can be found in the xref:core/beans/standard-annotations.adoc[relevant section].
[NOTE] [NOTE]
==== ====
Annotation injection is performed before external property injection. Thus, external Annotation injection is performed before external property injection. Thus, external
configuration (e.g. XML-specified bean properties) effectively overrides the annotations configuration (for example, XML-specified bean properties) effectively overrides the annotations
for properties when wired through mixed approaches. for properties when wired through mixed approaches.
==== ====

View File

@ -484,7 +484,7 @@ You can register as many event listeners as you wish, but note that, by default,
This means that the `publishEvent()` method blocks until all listeners have finished processing the event. This means that the `publishEvent()` method blocks until all listeners have finished processing the event.
One advantage of this synchronous and single-threaded approach is that, when a listener receives an event, One advantage of this synchronous and single-threaded approach is that, when a listener receives an event,
it operates inside the transaction context of the publisher if a transaction context is available. it operates inside the transaction context of the publisher if a transaction context is available.
If another strategy for event publication becomes necessary, e.g. asynchronous event processing by default, If another strategy for event publication becomes necessary, for example, asynchronous event processing by default,
see the javadoc for Spring's {spring-framework-api}/context/event/ApplicationEventMulticaster.html[`ApplicationEventMulticaster`] interface see the javadoc for Spring's {spring-framework-api}/context/event/ApplicationEventMulticaster.html[`ApplicationEventMulticaster`] interface
and {spring-framework-api}/context/event/SimpleApplicationEventMulticaster.html[`SimpleApplicationEventMulticaster`] implementation and {spring-framework-api}/context/event/SimpleApplicationEventMulticaster.html[`SimpleApplicationEventMulticaster`] implementation
for configuration options which can be applied to a custom "applicationEventMulticaster" bean definition. for configuration options which can be applied to a custom "applicationEventMulticaster" bean definition.
@ -864,7 +864,7 @@ Finally, as with classic `ApplicationListener` implementations, the actual multi
happens via a context-wide `ApplicationEventMulticaster` at runtime. By default, this is a happens via a context-wide `ApplicationEventMulticaster` at runtime. By default, this is a
`SimpleApplicationEventMulticaster` with synchronous event publication in the caller thread. `SimpleApplicationEventMulticaster` with synchronous event publication in the caller thread.
This can be replaced/customized through an "applicationEventMulticaster" bean definition, This can be replaced/customized through an "applicationEventMulticaster" bean definition,
e.g. for processing all events asynchronously and/or for handling listener exceptions: for example, for processing all events asynchronously and/or for handling listener exceptions:
[source,java,indent=0,subs="verbatim,quotes"] [source,java,indent=0,subs="verbatim,quotes"]
---- ----

View File

@ -144,7 +144,7 @@ based on the given configuration but no further activity with external bean acce
Otherwise there is a risk for an initialization deadlock. Otherwise there is a risk for an initialization deadlock.
For a scenario where expensive post-initialization activity is to be triggered, For a scenario where expensive post-initialization activity is to be triggered,
e.g. asynchronous database preparation steps, your bean should either implement for example, asynchronous database preparation steps, your bean should either implement
`SmartInitializingSingleton.afterSingletonsInstantiated()` or rely on the context `SmartInitializingSingleton.afterSingletonsInstantiated()` or rely on the context
refresh event: implementing `ApplicationListener<ContextRefreshedEvent>` or refresh event: implementing `ApplicationListener<ContextRefreshedEvent>` or
declaring its annotation equivalent `@EventListener(ContextRefreshedEvent.class)`. declaring its annotation equivalent `@EventListener(ContextRefreshedEvent.class)`.
@ -607,7 +607,7 @@ bean creation phase and its subsequent initial publication, they need to be decl
`volatile` or guarded by a common lock whenever accessed. `volatile` or guarded by a common lock whenever accessed.
Note that concurrent access to such configuration state in singleton bean instances, Note that concurrent access to such configuration state in singleton bean instances,
e.g. for controller instances or repository instances, is perfectly thread-safe after for example, for controller instances or repository instances, is perfectly thread-safe after
such safe initial publication from the container side. This includes common singleton such safe initial publication from the container side. This includes common singleton
`FactoryBean` instances which are processed within the general singleton lock as well. `FactoryBean` instances which are processed within the general singleton lock as well.
@ -617,7 +617,7 @@ structures (or in `volatile` fields for simple cases) as per common Java guideli
Deeper `Lifecycle` integration as shown above involves runtime-mutable state such as Deeper `Lifecycle` integration as shown above involves runtime-mutable state such as
a `runnable` field which will have to be declared as `volatile`. While the common a `runnable` field which will have to be declared as `volatile`. While the common
lifecycle callbacks follow a certain order, e.g. a start callback is guaranteed to lifecycle callbacks follow a certain order, for example, a start callback is guaranteed to
only happen after full initialization and a stop callback only after an initial start, only happen after full initialization and a stop callback only after an initial start,
there is a special case with the common stop before destroy arrangement: It is strongly there is a special case with the common stop before destroy arrangement: It is strongly
recommended that the internal state in any such bean also allows for an immediate recommended that the internal state in any such bean also allows for an immediate

View File

@ -219,7 +219,7 @@ parameter-based injection, as in the preceding example.
Avoid access to locally defined beans within a `@PostConstruct` method on the same configuration Avoid access to locally defined beans within a `@PostConstruct` method on the same configuration
class. This effectively leads to a circular reference since non-static `@Bean` methods semantically class. This effectively leads to a circular reference since non-static `@Bean` methods semantically
require a fully initialized configuration class instance to be called on. With circular references require a fully initialized configuration class instance to be called on. With circular references
disallowed (e.g. in Spring Boot 2.6+), this may trigger a `BeanCurrentlyInCreationException`. disallowed (for example, in Spring Boot 2.6+), this may trigger a `BeanCurrentlyInCreationException`.
Also, be particularly careful with `BeanPostProcessor` and `BeanFactoryPostProcessor` definitions Also, be particularly careful with `BeanPostProcessor` and `BeanFactoryPostProcessor` definitions
through `@Bean`. Those should usually be declared as `static @Bean` methods, not triggering the through `@Bean`. Those should usually be declared as `static @Bean` methods, not triggering the

View File

@ -29,7 +29,7 @@ a `DataBuffer` implementation and that does not involve allocation.
Note that WebFlux applications do not create a `DataBufferFactory` directly but instead Note that WebFlux applications do not create a `DataBufferFactory` directly but instead
access it through the `ServerHttpResponse` or the `ClientHttpRequest` on the client side. access it through the `ServerHttpResponse` or the `ClientHttpRequest` on the client side.
The type of factory depends on the underlying client or server, e.g. The type of factory depends on the underlying client or server, for example,
`NettyDataBufferFactory` for Reactor Netty, `DefaultDataBufferFactory` for others. `NettyDataBufferFactory` for Reactor Netty, `DefaultDataBufferFactory` for others.
@ -82,7 +82,7 @@ to use the convenience methods in `DataBufferUtils` that apply release or retain
`DataBufferUtils` offers a number of utility methods to operate on data buffers: `DataBufferUtils` offers a number of utility methods to operate on data buffers:
* Join a stream of data buffers into a single buffer possibly with zero copy, e.g. via * Join a stream of data buffers into a single buffer possibly with zero copy, for example, via
composite buffers, if that's supported by the underlying byte buffer API. composite buffers, if that's supported by the underlying byte buffer API.
* Turn `InputStream` or NIO `Channel` into `Flux<DataBuffer>`, and vice versa a * Turn `InputStream` or NIO `Channel` into `Flux<DataBuffer>`, and vice versa a
`Publisher<DataBuffer>` into `OutputStream` or NIO `Channel`. `Publisher<DataBuffer>` into `OutputStream` or NIO `Channel`.

View File

@ -38,7 +38,7 @@ manner, but through a nested property path. That means constructor binding creat
the target object and any objects it contains. the target object and any objects it contains.
Constructor binding supports `List`, `Map`, and array arguments either converted from Constructor binding supports `List`, `Map`, and array arguments either converted from
a single string, e.g. comma-separated list, or based on indexed keys such as a single string, for example, comma-separated list, or based on indexed keys such as
`accounts[2].name` or `account[KEY].name`. `accounts[2].name` or `account[KEY].name`.
Binding and conversion errors are reflected in the `BindingResult` of the `DataBinder`. Binding and conversion errors are reflected in the `BindingResult` of the `DataBinder`.

View File

@ -318,7 +318,7 @@ Kotlin::
The `FormatterRegistry` is an SPI for registering formatters and converters. The `FormatterRegistry` is an SPI for registering formatters and converters.
`FormattingConversionService` is an implementation of `FormatterRegistry` suitable for `FormattingConversionService` is an implementation of `FormatterRegistry` suitable for
most environments. You can programmatically or declaratively configure this variant most environments. You can programmatically or declaratively configure this variant
as a Spring bean, e.g. by using `FormattingConversionServiceFactoryBean`. Because this as a Spring bean, for example, by using `FormattingConversionServiceFactoryBean`. Because this
implementation also implements `ConversionService`, you can directly configure it implementation also implements `ConversionService`, you can directly configure it
for use with Spring's `DataBinder` and the Spring Expression Language (SpEL). for use with Spring's `DataBinder` and the Spring Expression Language (SpEL).

View File

@ -200,7 +200,7 @@ not involving a binding process. As of 6.1, this has been simplified through a n
`Validator.validateObject(Object)` method which is available by default now, returning `Validator.validateObject(Object)` method which is available by default now, returning
a simple ´Errors` representation which can be inspected: typically calling `hasErrors()` a simple ´Errors` representation which can be inspected: typically calling `hasErrors()`
or the new `failOnError` method for turning the error summary message into an exception or the new `failOnError` method for turning the error summary message into an exception
(e.g. `validator.validateObject(myObject).failOnError(IllegalArgumentException::new)`). (for example, `validator.validateObject(myObject).failOnError(IllegalArgumentException::new)`).

View File

@ -223,7 +223,7 @@ As of 6.1.2, Spring bypasses the default `getParameterType` resolution on Postgr
MS SQL Server. This is a common optimization to avoid further roundtrips to the DBMS just MS SQL Server. This is a common optimization to avoid further roundtrips to the DBMS just
for parameter type resolution which is known to make a very significant difference on for parameter type resolution which is known to make a very significant difference on
PostgreSQL and MS SQL Server specifically, in particular for batch operations. If you PostgreSQL and MS SQL Server specifically, in particular for batch operations. If you
happen to see a side effect e.g. when setting a byte array to null without specific type happen to see a side effect, for example, when setting a byte array to null without specific type
indication, you may explicitly set the `spring.jdbc.getParameterType.ignore=false` flag indication, you may explicitly set the `spring.jdbc.getParameterType.ignore=false` flag
as a system property (see above) to restore full `getParameterType` resolution. as a system property (see above) to restore full `getParameterType` resolution.

View File

@ -177,7 +177,7 @@ corresponding `DataSource` proxy class for the target connection pool: see
This is particularly useful for potentially empty transactions without actual statement This is particularly useful for potentially empty transactions without actual statement
execution (never fetching an actual resource in such a scenario), and also in front of execution (never fetching an actual resource in such a scenario), and also in front of
a routing `DataSource` which means to take the transaction-synchronized read-only flag a routing `DataSource` which means to take the transaction-synchronized read-only flag
and/or isolation level into account (e.g. `IsolationLevelDataSourceRouter`). and/or isolation level into account (for example, `IsolationLevelDataSourceRouter`).
`LazyConnectionDataSourceProxy` also provides special support for a read-only connection `LazyConnectionDataSourceProxy` also provides special support for a read-only connection
pool to use during a read-only transaction, avoiding the overhead of switching the JDBC pool to use during a read-only transaction, avoiding the overhead of switching the JDBC

View File

@ -175,7 +175,7 @@ a context-wide `LoadTimeWeaver` by using the `@EnableLoadTimeWeaving` annotation
`context:load-time-weaver` XML element. Such a global weaver is automatically picked up `context:load-time-weaver` XML element. Such a global weaver is automatically picked up
by all JPA `LocalContainerEntityManagerFactoryBean` instances. The following example by all JPA `LocalContainerEntityManagerFactoryBean` instances. The following example
shows the preferred way of setting up a load-time weaver, delivering auto-detection shows the preferred way of setting up a load-time weaver, delivering auto-detection
of the platform (e.g. Tomcat's weaving-capable class loader or Spring's JVM agent) of the platform (for example, Tomcat's weaving-capable class loader or Spring's JVM agent)
and automatic propagation of the weaver to all weaver-aware beans: and automatic propagation of the weaver to all weaver-aware beans:
[source,xml,indent=0,subs="verbatim,quotes"] [source,xml,indent=0,subs="verbatim,quotes"]
@ -469,7 +469,7 @@ a non-invasiveness perspective and can feel more natural to JPA developers.
What about providing JPA resources via constructors and other `@Autowired` injection points? What about providing JPA resources via constructors and other `@Autowired` injection points?
`EntityManagerFactory` can easily be injected via constructors and `@Autowired` fields/methods `EntityManagerFactory` can easily be injected via constructors and `@Autowired` fields/methods
as long as the target is defined as a bean, e.g. via `LocalContainerEntityManagerFactoryBean`. as long as the target is defined as a bean, for example, via `LocalContainerEntityManagerFactoryBean`.
The injection point matches the original `EntityManagerFactory` definition by type as-is. The injection point matches the original `EntityManagerFactory` definition by type as-is.
However, an `@PersistenceContext`-style shared `EntityManager` reference is not available for However, an `@PersistenceContext`-style shared `EntityManager` reference is not available for

View File

@ -469,10 +469,10 @@ Kotlin::
NOTE: R2DBC itself does not support Collection-like values. Nevertheless, NOTE: R2DBC itself does not support Collection-like values. Nevertheless,
expanding a given `List` in the example above works for named parameters expanding a given `List` in the example above works for named parameters
in Spring's R2DBC support, e.g. for use in `IN` clauses as shown above. in Spring's R2DBC support, for example, for use in `IN` clauses as shown above.
However, inserting or updating array-typed columns (e.g. in Postgres) However, inserting or updating array-typed columns (for example, in Postgres)
requires an array type that is supported by the underlying R2DBC driver: requires an array type that is supported by the underlying R2DBC driver:
typically a Java array, e.g. `String[]` to update a `text[]` column. typically a Java array, for example, `String[]` to update a `text[]` column.
Do not pass `Collection<String>` or the like as an array parameter. Do not pass `Collection<String>` or the like as an array parameter.
[[r2dbc-DatabaseClient-filter]] [[r2dbc-DatabaseClient-filter]]

View File

@ -250,7 +250,7 @@ the proxy are intercepted. This means that self-invocation (in effect, a method
the target object calling another method of the target object) does not lead to an actual the target object calling another method of the target object) does not lead to an actual
transaction at runtime even if the invoked method is marked with `@Transactional`. Also, transaction at runtime even if the invoked method is marked with `@Transactional`. Also,
the proxy must be fully initialized to provide the expected behavior, so you should not the proxy must be fully initialized to provide the expected behavior, so you should not
rely on this feature in your initialization code -- e.g. in a `@PostConstruct` method. rely on this feature in your initialization code -- for example, in a `@PostConstruct` method.
Consider using AspectJ mode (see the `mode` attribute in the following table) if you Consider using AspectJ mode (see the `mode` attribute in the following table) if you
expect self-invocations to be wrapped with transactions as well. In this case, there is expect self-invocations to be wrapped with transactions as well. In this case, there is
@ -564,7 +564,7 @@ transaction definitions from a base class as well. This effectively overrides
the default transaction manager choice for any unqualified base class methods. the default transaction manager choice for any unqualified base class methods.
Last but not least, such a type-level bean qualifier can serve multiple purposes, Last but not least, such a type-level bean qualifier can serve multiple purposes,
e.g. with a value of "order" it can be used for autowiring purposes (identifying for example, with a value of "order" it can be used for autowiring purposes (identifying
the order repository) as well as transaction manager selection, as long as the the order repository) as well as transaction manager selection, as long as the
target beans for autowiring as well as the associated transaction manager target beans for autowiring as well as the associated transaction manager
definitions declare the same qualifier value. Such a qualifier value only needs definitions declare the same qualifier value. Such a qualifier value only needs

View File

@ -41,7 +41,7 @@ operations need to execute within the same Reactor context in the same reactive
When configured with a `ReactiveTransactionManager`, all transaction-demarcated methods When configured with a `ReactiveTransactionManager`, all transaction-demarcated methods
are expected to return a reactive pipeline. Void methods or regular return types need are expected to return a reactive pipeline. Void methods or regular return types need
to be associated with a regular `PlatformTransactionManager`, e.g. through the to be associated with a regular `PlatformTransactionManager`, for example, through the
`transactionManager` attribute of the corresponding `@Transactional` declarations. `transactionManager` attribute of the corresponding `@Transactional` declarations.
==== ====

View File

@ -501,12 +501,12 @@ Placing this annotation on the class does not turn on any caching operation.
An operation-level customization always overrides a customization set on `@CacheConfig`. An operation-level customization always overrides a customization set on `@CacheConfig`.
Therefore, this gives three levels of customizations for each cache operation: Therefore, this gives three levels of customizations for each cache operation:
* Globally configured, e.g. through `CachingConfigurer`: see next section. * Globally configured, for example, through `CachingConfigurer`: see next section.
* At the class level, using `@CacheConfig`. * At the class level, using `@CacheConfig`.
* At the operation level. * At the operation level.
NOTE: Provider-specific settings are typically available on the `CacheManager` bean, NOTE: Provider-specific settings are typically available on the `CacheManager` bean,
e.g. on `CaffeineCacheManager`. These are effectively also global. for example, on `CaffeineCacheManager`. These are effectively also global.
[[cache-annotation-enable]] [[cache-annotation-enable]]

View File

@ -433,7 +433,7 @@ If no request factory is specified when the `RestClient` was built, it will use
Otherwise, if the `java.net.http` module is loaded, it will use Java's `HttpClient`. Otherwise, if the `java.net.http` module is loaded, it will use Java's `HttpClient`.
Finally, it will resort to the simple default. Finally, it will resort to the simple default.
TIP: Note that the `SimpleClientHttpRequestFactory` may raise an exception when accessing the status of a response that represents an error (e.g. 401). TIP: Note that the `SimpleClientHttpRequestFactory` may raise an exception when accessing the status of a response that represents an error (for example, 401).
If this is an issue, use any of the alternative request factories. If this is an issue, use any of the alternative request factories.
[[rest-webclient]] [[rest-webclient]]
@ -966,7 +966,7 @@ method parameters:
| `@RequestPart` | `@RequestPart`
| Add a request part, which may be a String (form field), `Resource` (file part), | Add a request part, which may be a String (form field), `Resource` (file part),
Object (entity to be encoded, e.g. as JSON), `HttpEntity` (part content and headers), Object (entity to be encoded, for example, as JSON), `HttpEntity` (part content and headers),
a Spring `Part`, or Reactive Streams `Publisher` of any of the above. a Spring `Part`, or Reactive Streams `Publisher` of any of the above.
| `MultipartFile` | `MultipartFile`

View File

@ -483,7 +483,7 @@ seconds:
==== ====
When destroying the annotated bean or closing the application context, Spring Framework cancels When destroying the annotated bean or closing the application context, Spring Framework cancels
scheduled tasks, which includes the next scheduled subscription to the `Publisher` as well scheduled tasks, which includes the next scheduled subscription to the `Publisher` as well
as any past subscription that is still currently active (e.g. for long-running publishers as any past subscription that is still currently active (for example, for long-running publishers
or even infinite publishers). or even infinite publishers).
==== ====

View File

@ -10,7 +10,7 @@ objects.
Spring's scripting support primarily targets Groovy and BeanShell. Beyond those Spring's scripting support primarily targets Groovy and BeanShell. Beyond those
specifically supported languages, the JSR-223 scripting mechanism is supported specifically supported languages, the JSR-223 scripting mechanism is supported
for integration with any JSR-223 capable language provider (as of Spring 4.2), for integration with any JSR-223 capable language provider (as of Spring 4.2),
e.g. JRuby. for example, JRuby.
You can find fully working examples of where this dynamic language support can be You can find fully working examples of where this dynamic language support can be
immediately useful in xref:languages/dynamic.adoc#dynamic-language-scenarios[Scenarios]. immediately useful in xref:languages/dynamic.adoc#dynamic-language-scenarios[Scenarios].
@ -179,7 +179,7 @@ Each of the supported languages has a corresponding `<lang:language/>` element:
* `<lang:groovy/>` (Groovy) * `<lang:groovy/>` (Groovy)
* `<lang:bsh/>` (BeanShell) * `<lang:bsh/>` (BeanShell)
* `<lang:std/>` (JSR-223, e.g. with JRuby) * `<lang:std/>` (JSR-223, for example, with JRuby)
The exact attributes and child elements that are available for configuration depends on The exact attributes and child elements that are available for configuration depends on
exactly which language the bean has been defined in (the language-specific sections exactly which language the bean has been defined in (the language-specific sections

View File

@ -73,7 +73,7 @@ developers may choose to use instead of the Spring-specific mechanisms provided
by the Spring Framework. Originally, those were based on common `javax` packages. by the Spring Framework. Originally, those were based on common `javax` packages.
As of Spring Framework 6.0, Spring has been upgraded to the Jakarta EE 9 level As of Spring Framework 6.0, Spring has been upgraded to the Jakarta EE 9 level
(e.g. Servlet 5.0+, JPA 3.0+), based on the `jakarta` namespace instead of the (for example, Servlet 5.0+, JPA 3.0+), based on the `jakarta` namespace instead of the
traditional `javax` packages. With EE 9 as the minimum and EE 10 supported already, traditional `javax` packages. With EE 9 as the minimum and EE 10 supported already,
Spring is prepared to provide out-of-the-box support for the further evolution of Spring is prepared to provide out-of-the-box support for the further evolution of
the Jakarta EE APIs. Spring Framework 6.0 is fully compatible with Tomcat 10.1, the Jakarta EE APIs. Spring Framework 6.0 is fully compatible with Tomcat 10.1,

View File

@ -113,7 +113,7 @@ a natural fit to use `Flux` and `Mono` with declarative operators and transparen
pressure support. pressure support.
The API in RSocket Java is intentionally minimal and basic. It focuses on protocol The API in RSocket Java is intentionally minimal and basic. It focuses on protocol
features and leaves the application programming model (e.g. RPC codegen vs other) as a features and leaves the application programming model (for example, RPC codegen vs other) as a
higher level, independent concern. higher level, independent concern.
The main contract The main contract
@ -271,7 +271,7 @@ Kotlin::
---- ----
====== ======
`RSocketStrategies` is designed for re-use. In some scenarios, e.g. client and server in `RSocketStrategies` is designed for re-use. In some scenarios, for example, client and server in
the same application, it may be preferable to declare it in Spring configuration. the same application, it may be preferable to declare it in Spring configuration.
@ -361,7 +361,7 @@ Kotlin::
====== ======
For the above you may also need to use `setHandlerPredicate` in `RSocketMessageHandler` to For the above you may also need to use `setHandlerPredicate` in `RSocketMessageHandler` to
switch to a different strategy for detecting client responders, e.g. based on a custom switch to a different strategy for detecting client responders, for example, based on a custom
annotation such as `@RSocketClientResponder` vs the default `@Controller`. This annotation such as `@RSocketClientResponder` vs the default `@Controller`. This
is necessary in scenarios with client and server, or multiple clients in the same is necessary in scenarios with client and server, or multiple clients in the same
application. application.
@ -798,7 +798,7 @@ use the following method arguments:
| Requester for making requests to the remote end. | Requester for making requests to the remote end.
| `@DestinationVariable` | `@DestinationVariable`
| Value extracted from the route based on variables in the mapping pattern, e.g. | Value extracted from the route based on variables in the mapping pattern, for example,
pass:q[`@MessageMapping("find.radar.{id}")`]. pass:q[`@MessageMapping("find.radar.{id}")`].
| `@Header` | `@Header`
@ -955,7 +955,7 @@ xref:rsocket.adoc#rsocket-requester-server[Server Requester] for details.
Responders must interpret metadata. Responders must interpret metadata.
{rsocket-protocol-extensions}/CompositeMetadata.md[Composite metadata] allows independently {rsocket-protocol-extensions}/CompositeMetadata.md[Composite metadata] allows independently
formatted metadata values (e.g. for routing, security, tracing) each with its own mime formatted metadata values (for example, for routing, security, tracing) each with its own mime
type. Applications need a way to configure metadata mime types to support, and a way type. Applications need a way to configure metadata mime types to support, and a way
to access extracted values. to access extracted values.

View File

@ -193,7 +193,7 @@ Then we define expectations with two kinds of responses:
* a response obtained through a call to the `/quoteOfTheDay` endpoint * a response obtained through a call to the `/quoteOfTheDay` endpoint
In the second case, the request is executed through the `ClientHttpRequestFactory` that was In the second case, the request is executed through the `ClientHttpRequestFactory` that was
captured earlier. This generates a response that could e.g. come from an actual remote server, captured earlier. This generates a response that could, for example, come from an actual remote server,
depending on how the `RestTemplate` was originally configured. depending on how the `RestTemplate` was originally configured.
[[spring-mvc-test-client-static-imports]] [[spring-mvc-test-client-static-imports]]

View File

@ -403,7 +403,7 @@ Java::
.expectStatus().isOk() .expectStatus().isOk()
.expectBody(Person.class) .expectBody(Person.class)
.consumeWith(result -> { .consumeWith(result -> {
// custom assertions (e.g. AssertJ)... // custom assertions (for example, AssertJ)...
}); });
---- ----
@ -416,7 +416,7 @@ Kotlin::
.expectStatus().isOk() .expectStatus().isOk()
.expectBody<Person>() .expectBody<Person>()
.consumeWith { .consumeWith {
// custom assertions (e.g. AssertJ)... // custom assertions (for example, AssertJ)...
} }
---- ----
====== ======

View File

@ -103,7 +103,7 @@ on its specific integration strategies.
JavaServer Faces (JSF) is the JCP's standard component-based, event-driven web JavaServer Faces (JSF) is the JCP's standard component-based, event-driven web
user interface framework. It is an official part of the Jakarta EE umbrella but also user interface framework. It is an official part of the Jakarta EE umbrella but also
individually usable, e.g. through embedding Mojarra or MyFaces within Tomcat. individually usable, for example, through embedding Mojarra or MyFaces within Tomcat.
Please note that recent versions of JSF became closely tied to CDI infrastructure Please note that recent versions of JSF became closely tied to CDI infrastructure
in application servers, with some new JSF functionality only working in such an in application servers, with some new JSF functionality only working in such an

View File

@ -3,8 +3,8 @@
xref:web/webflux-webclient/client-attributes.adoc[Attributes] provide a convenient way to pass information to the filter xref:web/webflux-webclient/client-attributes.adoc[Attributes] provide a convenient way to pass information to the filter
chain but they only influence the current request. If you want to pass information that chain but they only influence the current request. If you want to pass information that
propagates to additional requests that are nested, e.g. via `flatMap`, or executed after, propagates to additional requests that are nested, for example, via `flatMap`, or executed after,
e.g. via `concatMap`, then you'll need to use the Reactor `Context`. for example, via `concatMap`, then you'll need to use the Reactor `Context`.
The Reactor `Context` needs to be populated at the end of a reactive chain in order to The Reactor `Context` needs to be populated at the end of a reactive chain in order to
apply to all operations. For example: apply to all operations. For example:

View File

@ -64,7 +64,7 @@ this `Map`.
You can also extend `ProblemDetail` to add dedicated non-standard properties. You can also extend `ProblemDetail` to add dedicated non-standard properties.
The copy constructor in `ProblemDetail` allows a subclass to make it easy to be created The copy constructor in `ProblemDetail` allows a subclass to make it easy to be created
from an existing `ProblemDetail`. This could be done centrally, e.g. from an from an existing `ProblemDetail`. This could be done centrally, for example, from an
`@ControllerAdvice` such as `ResponseEntityExceptionHandler` that re-creates the `@ControllerAdvice` such as `ResponseEntityExceptionHandler` that re-creates the
`ProblemDetail` of an exception into a subclass with the additional non-standard fields. `ProblemDetail` of an exception into a subclass with the additional non-standard fields.
@ -107,7 +107,7 @@ Message codes and arguments for each error are also resolved via `MessageSource`
| `MissingRequestValueException` | `MissingRequestValueException`
| (default) | (default)
| `+{0}+` a label for the value (e.g. "request header", "cookie value", ...), `+{1}+` the value name | `+{0}+` a label for the value (for example, "request header", "cookie value", ...), `+{1}+` the value name
| `NotAcceptableStatusException` | `NotAcceptableStatusException`
| (default) | (default)

View File

@ -657,7 +657,7 @@ include the version of the jar and can also match against incoming URLs without
-- for example, from `/webjars/jquery/jquery.min.js` to `/webjars/jquery/1.2.0/jquery.min.js`. -- for example, from `/webjars/jquery/jquery.min.js` to `/webjars/jquery/1.2.0/jquery.min.js`.
TIP: The Java configuration based on `ResourceHandlerRegistry` provides further options TIP: The Java configuration based on `ResourceHandlerRegistry` provides further options
for fine-grained control, e.g. last-modified behavior and optimized resource resolution. for fine-grained control, for example, last-modified behavior and optimized resource resolution.

View File

@ -82,10 +82,10 @@ parameters. While `@BindParam` is supported out of the box, you can also use a
different annotation by setting a `DataBinder.NameResolver` on `DataBinder` different annotation by setting a `DataBinder.NameResolver` on `DataBinder`
Constructor binding supports `List`, `Map`, and array arguments either converted from Constructor binding supports `List`, `Map`, and array arguments either converted from
a single string, e.g. comma-separated list, or based on indexed keys such as a single string, for example, comma-separated list, or based on indexed keys such as
`accounts[2].name` or `account[KEY].name`. `accounts[2].name` or `account[KEY].name`.
WebFlux, unlike Spring MVC, supports reactive types in the model, e.g. `Mono<Account>`. WebFlux, unlike Spring MVC, supports reactive types in the model, for example, `Mono<Account>`.
You can declare a `@ModelAttribute` argument with or without a reactive type wrapper, and You can declare a `@ModelAttribute` argument with or without a reactive type wrapper, and
it will be resolved accordingly to the actual value. it will be resolved accordingly to the actual value.

View File

@ -343,7 +343,7 @@ You can declare a shared `produces` attribute at the class level. Unlike most ot
mapping attributes, however, when used at the class level, a method-level `produces` attribute mapping attributes, however, when used at the class level, a method-level `produces` attribute
overrides rather than extend the class level declaration. overrides rather than extend the class level declaration.
TIP: `MediaType` provides constants for commonly used media types -- e.g. TIP: `MediaType` provides constants for commonly used media types -- for example,
`APPLICATION_JSON_VALUE`, `APPLICATION_XML_VALUE`. `APPLICATION_JSON_VALUE`, `APPLICATION_XML_VALUE`.

View File

@ -170,7 +170,7 @@ A `HandlerAdapter` may expose its exception handling mechanism as a
A `HandlerAdapter` may also choose to implement `DispatchExceptionHandler`. In that case A `HandlerAdapter` may also choose to implement `DispatchExceptionHandler`. In that case
`DispatcherHandler` will apply it to exceptions that arise before a handler is mapped, `DispatcherHandler` will apply it to exceptions that arise before a handler is mapped,
e.g. during handler mapping, or earlier, e.g. in a `WebFilter`. for example, during handler mapping, or earlier, for example, in a `WebFilter`.
See also xref:web/webflux/controller/ann-exceptions.adoc[Exceptions] in the "`Annotated Controller`" section or See also xref:web/webflux/controller/ann-exceptions.adoc[Exceptions] in the "`Annotated Controller`" section or
xref:web/webflux/reactive-spring.adoc#webflux-exception-handler[Exceptions] in the WebHandler API section. xref:web/webflux/reactive-spring.adoc#webflux-exception-handler[Exceptions] in the WebHandler API section.

View File

@ -468,7 +468,7 @@ to encode and decode HTTP message content.
* An `Encoder` can be wrapped with `EncoderHttpMessageWriter` to adapt it for use in a web * An `Encoder` can be wrapped with `EncoderHttpMessageWriter` to adapt it for use in a web
application, while a `Decoder` can be wrapped with `DecoderHttpMessageReader`. application, while a `Decoder` can be wrapped with `DecoderHttpMessageReader`.
* {spring-framework-api}/core/io/buffer/DataBuffer.html[`DataBuffer`] abstracts different * {spring-framework-api}/core/io/buffer/DataBuffer.html[`DataBuffer`] abstracts different
byte buffer representations (e.g. Netty `ByteBuf`, `java.nio.ByteBuffer`, etc.) and is byte buffer representations (for example, Netty `ByteBuf`, `java.nio.ByteBuffer`, etc.) and is
what all codecs work on. See xref:core/databuffer-codec.adoc[Data Buffers and Codecs] in the what all codecs work on. See xref:core/databuffer-codec.adoc[Data Buffers and Codecs] in the
"Spring Core" section for more on this topic. "Spring Core" section for more on this topic.
@ -493,8 +493,8 @@ The `Jackson2Decoder` works as follows:
* Jackson's asynchronous, non-blocking parser is used to aggregate a stream of byte chunks * Jackson's asynchronous, non-blocking parser is used to aggregate a stream of byte chunks
into ``TokenBuffer``'s each representing a JSON object. into ``TokenBuffer``'s each representing a JSON object.
* Each `TokenBuffer` is passed to Jackson's `ObjectMapper` to create a higher level object. * Each `TokenBuffer` is passed to Jackson's `ObjectMapper` to create a higher level object.
* When decoding to a single-value publisher (e.g. `Mono`), there is one `TokenBuffer`. * When decoding to a single-value publisher (for example, `Mono`), there is one `TokenBuffer`.
* When decoding to a multi-value publisher (e.g. `Flux`), each `TokenBuffer` is passed to * When decoding to a multi-value publisher (for example, `Flux`), each `TokenBuffer` is passed to
the `ObjectMapper` as soon as enough bytes are received for a fully formed object. The the `ObjectMapper` as soon as enough bytes are received for a fully formed object. The
input content can be a JSON array, or any input content can be a JSON array, or any
https://en.wikipedia.org/wiki/JSON_streaming[line-delimited JSON] format such as NDJSON, https://en.wikipedia.org/wiki/JSON_streaming[line-delimited JSON] format such as NDJSON,
@ -502,7 +502,7 @@ JSON Lines, or JSON Text Sequences.
The `Jackson2Encoder` works as follows: The `Jackson2Encoder` works as follows:
* For a single value publisher (e.g. `Mono`), simply serialize it through the * For a single value publisher (for example, `Mono`), simply serialize it through the
`ObjectMapper`. `ObjectMapper`.
* For a multi-value publisher with `application/json`, by default collect the values with * For a multi-value publisher with `application/json`, by default collect the values with
`Flux#collectToList()` and then serialize the resulting collection. `Flux#collectToList()` and then serialize the resulting collection.

View File

@ -88,7 +88,7 @@ class- or method-level `@CrossOrigin` annotations (other handlers can implement
The rules for combining global and local configuration are generally additive -- for example, The rules for combining global and local configuration are generally additive -- for example,
all global and all local origins. For those attributes where only a single value can be all global and all local origins. For those attributes where only a single value can be
accepted, e.g. `allowCredentials` and `maxAge`, the local overrides the global value. See accepted, for example, `allowCredentials` and `maxAge`, the local overrides the global value. See
{spring-framework-api}/web/cors/CorsConfiguration.html#combine-org.springframework.web.cors.CorsConfiguration-[`CorsConfiguration#combine(CorsConfiguration)`] {spring-framework-api}/web/cors/CorsConfiguration.html#combine-org.springframework.web.cors.CorsConfiguration-[`CorsConfiguration#combine(CorsConfiguration)`]
for more details. for more details.

View File

@ -64,7 +64,7 @@ this `Map`.
You can also extend `ProblemDetail` to add dedicated non-standard properties. You can also extend `ProblemDetail` to add dedicated non-standard properties.
The copy constructor in `ProblemDetail` allows a subclass to make it easy to be created The copy constructor in `ProblemDetail` allows a subclass to make it easy to be created
from an existing `ProblemDetail`. This could be done centrally, e.g. from an from an existing `ProblemDetail`. This could be done centrally, for example, from an
`@ControllerAdvice` such as `ResponseEntityExceptionHandler` that re-creates the `@ControllerAdvice` such as `ResponseEntityExceptionHandler` that re-creates the
`ProblemDetail` of an exception into a subclass with the additional non-standard fields. `ProblemDetail` of an exception into a subclass with the additional non-standard fields.

View File

@ -58,7 +58,7 @@ include the version of the jar and can also match against incoming URLs without
-- for example, from `/webjars/jquery/jquery.min.js` to `/webjars/jquery/1.2.0/jquery.min.js`. -- for example, from `/webjars/jquery/jquery.min.js` to `/webjars/jquery/1.2.0/jquery.min.js`.
TIP: The Java configuration based on `ResourceHandlerRegistry` provides further options TIP: The Java configuration based on `ResourceHandlerRegistry` provides further options
for fine-grained control, e.g. last-modified behavior and optimized resource resolution. for fine-grained control, for example, last-modified behavior and optimized resource resolution.

View File

@ -13,8 +13,8 @@ include-code::./SimpleController[indent=0]
[[mvc-ann-exceptionhandler-exc]] [[mvc-ann-exceptionhandler-exc]]
== Exception Mapping == Exception Mapping
The exception may match against a top-level exception being propagated (e.g. a direct The exception may match against a top-level exception being propagated (for example, a direct
`IOException` being thrown) or against a nested cause within a wrapper exception (e.g. `IOException` being thrown) or against a nested cause within a wrapper exception (for example,
an `IOException` wrapped inside an `IllegalStateException`). As of 5.3, this can match an `IOException` wrapped inside an `IllegalStateException`). As of 5.3, this can match
at arbitrary cause levels, whereas previously only an immediate cause was considered. at arbitrary cause levels, whereas previously only an immediate cause was considered.

View File

@ -117,7 +117,7 @@ parameters. While `@BindParam` is supported out of the box, you can also use a
different annotation by setting a `DataBinder.NameResolver` on `DataBinder` different annotation by setting a `DataBinder.NameResolver` on `DataBinder`
Constructor binding supports `List`, `Map`, and array arguments either converted from Constructor binding supports `List`, `Map`, and array arguments either converted from
a single string, e.g. comma-separated list, or based on indexed keys such as a single string, for example, comma-separated list, or based on indexed keys such as
`accounts[2].name` or `account[KEY].name`. `accounts[2].name` or `account[KEY].name`.
In some cases, you may want access to a model attribute without data binding. For such In some cases, you may want access to a model attribute without data binding. For such

View File

@ -42,7 +42,7 @@ content of the provided resource to the response `OutputStream`. Note that the
`InputStream` should be lazily retrieved by the `Resource` handle in order to reliably `InputStream` should be lazily retrieved by the `Resource` handle in order to reliably
close it after it has been copied to the response. If you are using `InputStreamResource` close it after it has been copied to the response. If you are using `InputStreamResource`
for such a purpose, make sure to construct it with an on-demand `InputStreamSource` for such a purpose, make sure to construct it with an on-demand `InputStreamSource`
(e.g. through a lambda expression that retrieves the actual `InputStream`). (for example, through a lambda expression that retrieves the actual `InputStream`).
You can use `@ResponseBody` with reactive types. You can use `@ResponseBody` with reactive types.
See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[Reactive Types] for more details. See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[Reactive Types] for more details.

View File

@ -33,14 +33,14 @@ Kotlin::
====== ======
The body will usually be provided as a value object to be rendered to a corresponding The body will usually be provided as a value object to be rendered to a corresponding
response representation (e.g. JSON) by one of the registered `HttpMessageConverters`. response representation (for example, JSON) by one of the registered `HttpMessageConverters`.
A `ResponseEntity<Resource>` can be returned for file content, copying the `InputStream` A `ResponseEntity<Resource>` can be returned for file content, copying the `InputStream`
content of the provided resource to the response `OutputStream`. Note that the content of the provided resource to the response `OutputStream`. Note that the
`InputStream` should be lazily retrieved by the `Resource` handle in order to reliably `InputStream` should be lazily retrieved by the `Resource` handle in order to reliably
close it after it has been copied to the response. If you are using `InputStreamResource` close it after it has been copied to the response. If you are using `InputStreamResource`
for such a purpose, make sure to construct it with an on-demand `InputStreamSource` for such a purpose, make sure to construct it with an on-demand `InputStreamSource`
(e.g. through a lambda expression that retrieves the actual `InputStream`). Also, custom (for example, through a lambda expression that retrieves the actual `InputStream`). Also, custom
subclasses of `InputStreamResource` are only supported in combination with a custom subclasses of `InputStreamResource` are only supported in combination with a custom
`contentLength()` implementation which avoids consuming the stream for that purpose. `contentLength()` implementation which avoids consuming the stream for that purpose.

View File

@ -93,9 +93,9 @@ supported for all return values.
`ResponseEntity`. See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-http-streaming[HTTP Streaming]. `ResponseEntity`. See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-http-streaming[HTTP Streaming].
| Reactor and other reactive types registered via `ReactiveAdapterRegistry` | Reactor and other reactive types registered via `ReactiveAdapterRegistry`
| A single value type, e.g. `Mono`, is comparable to returning `DeferredResult`. | A single value type, for example, `Mono`, is comparable to returning `DeferredResult`.
A multi-value type, e.g. `Flux`, may be treated as a stream depending on the requested A multi-value type, for example, `Flux`, may be treated as a stream depending on the requested
media type, e.g. "text/event-stream", "application/json+stream", or otherwise is media type, for example, "text/event-stream", "application/json+stream", or otherwise is
collected to a List and rendered as a single value. See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and collected to a List and rendered as a single value. See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and
xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[Reactive Types]. xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[Reactive Types].

View File

@ -26,7 +26,7 @@ method intends to accept a null value as well, either declare your argument as `
or mark it as `required=false` in the corresponding `@RequestParam`, etc. annotation. This is or mark it as `required=false` in the corresponding `@RequestParam`, etc. annotation. This is
a best practice and the recommended solution for regressions encountered in a 5.3 upgrade. a best practice and the recommended solution for regressions encountered in a 5.3 upgrade.
Alternatively, you may specifically handle e.g. the resulting `MissingPathVariableException` Alternatively, you may specifically handle, for example, the resulting `MissingPathVariableException`
in the case of a required `@PathVariable`. A null value after conversion will be treated like in the case of a required `@PathVariable`. A null value after conversion will be treated like
an empty original value, so the corresponding `Missing...Exception` variants will be thrown. an empty original value, so the corresponding `Missing...Exception` variants will be thrown.
==== ====

View File

@ -105,7 +105,7 @@ default from version 6.0. See xref:web/webmvc/mvc-config/path-matching.adoc[MVC
customizations of path matching options. customizations of path matching options.
`PathPattern` supports the same pattern syntax as `AntPathMatcher`. In addition, it also `PathPattern` supports the same pattern syntax as `AntPathMatcher`. In addition, it also
supports the capturing pattern, e.g. `+{*spring}+`, for matching 0 or more path segments supports the capturing pattern, for example, `+{*spring}+`, for matching 0 or more path segments
at the end of a path. `PathPattern` also restricts the use of `+**+` for matching multiple at the end of a path. `PathPattern` also restricts the use of `+**+` for matching multiple
path segments such that it's only allowed at the end of a pattern. This eliminates many path segments such that it's only allowed at the end of a pattern. This eliminates many
cases of ambiguity when choosing the best matching pattern for a given request. cases of ambiguity when choosing the best matching pattern for a given request.
@ -272,7 +272,7 @@ To completely disable the use of path extensions in versions prior to 5.3, set t
* `favorPathExtension(false)`, see xref:web/webmvc/mvc-config/content-negotiation.adoc[ContentNegotiationConfigurer] * `favorPathExtension(false)`, see xref:web/webmvc/mvc-config/content-negotiation.adoc[ContentNegotiationConfigurer]
Having a way to request content types other than through the `"Accept"` header can still Having a way to request content types other than through the `"Accept"` header can still
be useful, e.g. when typing a URL in a browser. A safe alternative to path extensions is be useful, for example, when typing a URL in a browser. A safe alternative to path extensions is
to use the query parameter strategy. If you must use file extensions, consider restricting to use the query parameter strategy. If you must use file extensions, consider restricting
them to a list of explicitly registered extensions through the `mediaTypes` property of them to a list of explicitly registered extensions through the `mediaTypes` property of
xref:web/webmvc/mvc-config/content-negotiation.adoc[ContentNegotiationConfigurer]. xref:web/webmvc/mvc-config/content-negotiation.adoc[ContentNegotiationConfigurer].

View File

@ -47,7 +47,7 @@ The following table provides more details on the `ViewResolver` hierarchy:
| Implementation of the `ViewResolver` interface that interprets a view name as a | Implementation of the `ViewResolver` interface that interprets a view name as a
bean name in the current application context. This is a very flexible variant which bean name in the current application context. This is a very flexible variant which
allows for mixing and matching different view types based on distinct view names. allows for mixing and matching different view types based on distinct view names.
Each such `View` can be defined as a bean e.g. in XML or in configuration classes. Each such `View` can be defined as a bean, for example, in XML or in configuration classes.
|=== |===

View File

@ -29,7 +29,7 @@ WebSocket support does not depend on Spring MVC. It is relatively simple to
integrate a `WebSocketHandler` into other HTTP-serving environments with the help of integrate a `WebSocketHandler` into other HTTP-serving environments with the help of
{spring-framework-api}/web/socket/server/support/WebSocketHttpRequestHandler.html[`WebSocketHttpRequestHandler`]. {spring-framework-api}/web/socket/server/support/WebSocketHttpRequestHandler.html[`WebSocketHttpRequestHandler`].
When using the `WebSocketHandler` API directly vs indirectly, e.g. through the When using the `WebSocketHandler` API directly vs indirectly, for example, through the
xref:web/websocket/stomp.adoc[STOMP] messaging, the application must synchronize the sending of messages xref:web/websocket/stomp.adoc[STOMP] messaging, the application must synchronize the sending of messages
since the underlying standard WebSocket session (JSR-356) does not allow concurrent since the underlying standard WebSocket session (JSR-356) does not allow concurrent
sending. One option is to wrap the `WebSocketSession` with sending. One option is to wrap the `WebSocketSession` with

View File

@ -38,7 +38,7 @@ to inform the server that the original port was `443`.
==== X-Forwarded-Proto ==== X-Forwarded-Proto
While not standard, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto[`X-Forwarded-Proto: (https|http)`] While not standard, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto[`X-Forwarded-Proto: (https|http)`]
is a de-facto standard header that is used to communicate the original protocol (e.g. https / https) is a de-facto standard header that is used to communicate the original protocol (for example, https / https)
to a downstream server. For example, if a request of `https://example.com/resource` is sent to to a downstream server. For example, if a request of `https://example.com/resource` is sent to
a proxy which forwards the request to `http://localhost:8080/resource`, then a header of a proxy which forwards the request to `http://localhost:8080/resource`, then a header of
`X-Forwarded-Proto: https` can be sent to inform the server that the original protocol was `https`. `X-Forwarded-Proto: https` can be sent to inform the server that the original protocol was `https`.
@ -48,7 +48,7 @@ a proxy which forwards the request to `http://localhost:8080/resource`, then a h
==== X-Forwarded-Ssl ==== X-Forwarded-Ssl
While not standard, `X-Forwarded-Ssl: (on|off)` is a de-facto standard header that is used to communicate the While not standard, `X-Forwarded-Ssl: (on|off)` is a de-facto standard header that is used to communicate the
original protocol (e.g. https / https) to a downstream server. For example, if a request of original protocol (for example, https / https) to a downstream server. For example, if a request of
`https://example.com/resource` is sent to a proxy which forwards the request to `https://example.com/resource` is sent to a proxy which forwards the request to
`http://localhost:8080/resource`, then a header of `X-Forwarded-Ssl: on` to inform the server that the `http://localhost:8080/resource`, then a header of `X-Forwarded-Ssl: on` to inform the server that the
original protocol was `https`. original protocol was `https`.
@ -103,7 +103,7 @@ applications on the same server. However, this should not be visible in URL path
the public API where applications may use different subdomains that provides benefits the public API where applications may use different subdomains that provides benefits
such as: such as:
* Added security, e.g. same origin policy * Added security, for example, same origin policy
* Independent scaling of applications (different domain points to different IP address) * Independent scaling of applications (different domain points to different IP address)
==== ====

View File

@ -46,7 +46,7 @@ A complete introduction of how WebSockets work is beyond the scope of this docum
See RFC 6455, the WebSocket chapter of HTML5, or any of the many introductions and See RFC 6455, the WebSocket chapter of HTML5, or any of the many introductions and
tutorials on the Web. tutorials on the Web.
Note that, if a WebSocket server is running behind a web server (e.g. nginx), you Note that, if a WebSocket server is running behind a web server (for example, nginx), you
likely need to configure it to pass WebSocket upgrade requests on to the WebSocket likely need to configure it to pass WebSocket upgrade requests on to the WebSocket
server. Likewise, if the application runs in a cloud environment, check the server. Likewise, if the application runs in a cloud environment, check the
instructions of the cloud provider related to WebSocket support. instructions of the cloud provider related to WebSocket support.

View File

@ -23,7 +23,7 @@ import javax.annotation.Nonnull;
* *
* <p>The user should implement the {@link * <p>The user should implement the {@link
* #construct(ConstructorInvocation)} method to modify the original * #construct(ConstructorInvocation)} method to modify the original
* behavior. E.g. the following class implements a singleton * behavior. For example, the following class implements a singleton
* interceptor (allows only one unique instance for the intercepted * interceptor (allows only one unique instance for the intercepted
* class): * class):
* *

View File

@ -24,7 +24,7 @@ import javax.annotation.Nullable;
* are nested "on top" of the target. * are nested "on top" of the target.
* *
* <p>The user should implement the {@link #invoke(MethodInvocation)} * <p>The user should implement the {@link #invoke(MethodInvocation)}
* method to modify the original behavior. E.g. the following class * method to modify the original behavior. For example, the following class
* implements a tracing interceptor (traces all the calls on the * implements a tracing interceptor (traces all the calls on the
* intercepted method(s)): * intercepted method(s)):
* *

View File

@ -21,7 +21,7 @@ package org.springframework.aop;
* *
* <p>A pointcut is composed of a {@link ClassFilter} and a {@link MethodMatcher}. * <p>A pointcut is composed of a {@link ClassFilter} and a {@link MethodMatcher}.
* Both these basic terms and a Pointcut itself can be combined to build up combinations * Both these basic terms and a Pointcut itself can be combined to build up combinations
* (e.g. through {@link org.springframework.aop.support.ComposablePointcut}). * (for example, through {@link org.springframework.aop.support.ComposablePointcut}).
* *
* @author Rod Johnson * @author Rod Johnson
* @see ClassFilter * @see ClassFilter

View File

@ -103,7 +103,7 @@ public class AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorA
// broad an impact. Instead we now override isInfrastructureClass to avoid proxying // broad an impact. Instead we now override isInfrastructureClass to avoid proxying
// aspects. I'm not entirely happy with that as there is no good reason not // aspects. I'm not entirely happy with that as there is no good reason not
// to advise aspects, except that it causes advice invocation to go through a // to advise aspects, except that it causes advice invocation to go through a
// proxy, and if the aspect implements e.g the Ordered interface it will be // proxy, and if the aspect implements, for example, the Ordered interface it will be
// proxied by that interface and fail at runtime as the advice method is not // proxied by that interface and fail at runtime as the advice method is not
// defined on the interface. We could potentially relax the restriction about // defined on the interface. We could potentially relax the restriction about
// not advising aspects in the future. // not advising aspects in the future.

View File

@ -160,7 +160,7 @@ public class AspectMetadata implements Serializable {
/** /**
* Return a Spring pointcut expression for a singleton aspect. * Return a Spring pointcut expression for a singleton aspect.
* (e.g. {@code Pointcut.TRUE} if it's a singleton). * (for example, {@code Pointcut.TRUE} if it's a singleton).
*/ */
public Pointcut getPerClausePointcut() { public Pointcut getPerClausePointcut() {
return this.perClausePointcut; return this.perClausePointcut;

View File

@ -135,7 +135,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
* Check whether the given bean is eligible for advising with this * Check whether the given bean is eligible for advising with this
* post-processor's {@link Advisor}. * post-processor's {@link Advisor}.
* <p>Delegates to {@link #isEligible(Class)} for target class checking. * <p>Delegates to {@link #isEligible(Class)} for target class checking.
* Can be overridden e.g. to specifically exclude certain beans by name. * Can be overridden, for example, to specifically exclude certain beans by name.
* <p>Note: Only called for regular bean instances but not for existing * <p>Note: Only called for regular bean instances but not for existing
* proxy instances which implement {@link Advised} and allow for adding * proxy instances which implement {@link Advised} and allow for adding
* the local {@link Advisor} to the existing proxy's {@link Advisor} chain. * the local {@link Advisor} to the existing proxy's {@link Advisor} chain.

View File

@ -91,7 +91,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
/** /**
* Set additional interceptors (or advisors) to be applied before the * Set additional interceptors (or advisors) to be applied before the
* implicit transaction interceptor, e.g. a PerformanceMonitorInterceptor. * implicit transaction interceptor, for example, a PerformanceMonitorInterceptor.
* <p>You may specify any AOP Alliance MethodInterceptors or other * <p>You may specify any AOP Alliance MethodInterceptors or other
* Spring AOP Advices, as well as Spring AOP Advisors. * Spring AOP Advices, as well as Spring AOP Advisors.
* @see org.springframework.aop.interceptor.PerformanceMonitorInterceptor * @see org.springframework.aop.interceptor.PerformanceMonitorInterceptor

View File

@ -47,7 +47,7 @@ import org.springframework.lang.Nullable;
* *
* <p><b>NOTE:</b> This class is considered internal and should not be * <p><b>NOTE:</b> This class is considered internal and should not be
* directly accessed. The sole reason for it being public is compatibility * directly accessed. The sole reason for it being public is compatibility
* with existing framework integrations (e.g. Pitchfork). For any other * with existing framework integrations (for example, Pitchfork). For any other
* purposes, use the {@link ProxyMethodInvocation} interface instead. * purposes, use the {@link ProxyMethodInvocation} interface instead.
* *
* @author Rod Johnson * @author Rod Johnson

View File

@ -71,7 +71,7 @@ import org.springframework.util.StringUtils;
* Instead of x repetitive proxy definitions for x target beans, you can register * Instead of x repetitive proxy definitions for x target beans, you can register
* one single such post processor with the bean factory to achieve the same effect. * one single such post processor with the bean factory to achieve the same effect.
* *
* <p>Subclasses can apply any strategy to decide if a bean is to be proxied, e.g. by type, * <p>Subclasses can apply any strategy to decide if a bean is to be proxied, for example, by type,
* by name, by definition details, etc. They can also return additional interceptors that * by name, by definition details, etc. They can also return additional interceptors that
* should just be applied to the specific bean instance. A simple concrete implementation is * should just be applied to the specific bean instance. A simple concrete implementation is
* {@link BeanNameAutoProxyCreator}, identifying the beans to be proxied via given names. * {@link BeanNameAutoProxyCreator}, identifying the beans to be proxied via given names.
@ -403,7 +403,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
/** /**
* Subclasses should override this method to return {@code true} if the * Subclasses should override this method to return {@code true} if the
* given bean should not be considered for auto-proxying by this post-processor. * given bean should not be considered for auto-proxying by this post-processor.
* <p>Sometimes we need to be able to avoid this happening, e.g. if it will lead to * <p>Sometimes we need to be able to avoid this happening, for example, if it will lead to
* a circular reference or if the existing target instance needs to be preserved. * a circular reference or if the existing target instance needs to be preserved.
* This implementation returns {@code false} unless the bean name indicates an * This implementation returns {@code false} unless the bean name indicates an
* "original instance" according to {@code AutowireCapableBeanFactory} conventions. * "original instance" according to {@code AutowireCapableBeanFactory} conventions.
@ -619,7 +619,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
/** /**
* Return whether the given bean is to be proxied, what additional * Return whether the given bean is to be proxied, what additional
* advices (e.g. AOP Alliance interceptors) and advisors to apply. * advices (for example, AOP Alliance interceptors) and advisors to apply.
* @param beanClass the class of the bean to advise * @param beanClass the class of the bean to advise
* @param beanName the name of the bean * @param beanName the name of the bean
* @param customTargetSource the TargetSource returned by the * @param customTargetSource the TargetSource returned by the

View File

@ -47,7 +47,7 @@ public abstract class AutoProxyUtils {
/** /**
* Bean definition attribute that indicates the original target class of an * Bean definition attribute that indicates the original target class of an
* auto-proxied bean, e.g. to be used for the introspection of annotations * auto-proxied bean, for example, to be used for the introspection of annotations
* on the target class behind an interface-based proxy. * on the target class behind an interface-based proxy.
* @since 4.2.3 * @since 4.2.3
* @see #determineTargetClass * @see #determineTargetClass

View File

@ -54,13 +54,13 @@ public class BeanNameAutoProxyCreator extends AbstractAutoProxyCreator {
/** /**
* Set the names of the beans that should automatically get wrapped with proxies. * Set the names of the beans that should automatically get wrapped with proxies.
* A name can specify a prefix to match by ending with "*", e.g. "myBean,tx*" * A name can specify a prefix to match by ending with "*", for example, "myBean,tx*"
* will match the bean named "myBean" and all beans whose name start with "tx". * will match the bean named "myBean" and all beans whose name start with "tx".
* <p><b>NOTE:</b> In case of a FactoryBean, only the objects created by the * <p><b>NOTE:</b> In case of a FactoryBean, only the objects created by the
* FactoryBean will get proxied. This default behavior applies as of Spring 2.0. * FactoryBean will get proxied. This default behavior applies as of Spring 2.0.
* If you intend to proxy a FactoryBean instance itself (a rare use case, but * If you intend to proxy a FactoryBean instance itself (a rare use case, but
* Spring 1.2's default behavior), specify the bean name of the FactoryBean * Spring 1.2's default behavior), specify the bean name of the FactoryBean
* including the factory-bean prefix "&amp;": e.g. "&amp;myFactoryBean". * including the factory-bean prefix "&amp;": for example, "&amp;myFactoryBean".
* @see org.springframework.beans.factory.FactoryBean * @see org.springframework.beans.factory.FactoryBean
* @see org.springframework.beans.factory.BeanFactory#FACTORY_BEAN_PREFIX * @see org.springframework.beans.factory.BeanFactory#FACTORY_BEAN_PREFIX
*/ */

View File

@ -52,7 +52,7 @@ import org.springframework.util.function.SingletonSupplier;
* <p>Provides support for <i>executor qualification</i> on a method-by-method basis. * <p>Provides support for <i>executor qualification</i> on a method-by-method basis.
* {@code AsyncExecutionAspectSupport} objects must be constructed with a default {@code * {@code AsyncExecutionAspectSupport} objects must be constructed with a default {@code
* Executor}, but each individual method may further qualify a specific {@code Executor} * Executor}, but each individual method may further qualify a specific {@code Executor}
* bean to be used when executing it, e.g. through an annotation attribute. * bean to be used when executing it, for example, through an annotation attribute.
* *
* @author Chris Beams * @author Chris Beams
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -148,7 +148,7 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport imple
/** /**
* This implementation searches for a unique {@link org.springframework.core.task.TaskExecutor} * This implementation searches for a unique {@link org.springframework.core.task.TaskExecutor}
* bean in the context, or for an {@link Executor} bean named "taskExecutor" otherwise. * bean in the context, or for an {@link Executor} bean named "taskExecutor" otherwise.
* If neither of the two is resolvable (e.g. if no {@code BeanFactory} was configured at all), * If neither of the two is resolvable (for example, if no {@code BeanFactory} was configured at all),
* this implementation falls back to a newly created {@link SimpleAsyncTaskExecutor} instance * this implementation falls back to a newly created {@link SimpleAsyncTaskExecutor} instance
* for local use if no default could be found. * for local use if no default could be found.
* @see #DEFAULT_TASK_EXECUTOR_BEAN_NAME * @see #DEFAULT_TASK_EXECUTOR_BEAN_NAME

View File

@ -31,7 +31,7 @@ import org.springframework.util.ConcurrencyThrottleSupport;
* <p>Can be applied to methods of local services that involve heavy use * <p>Can be applied to methods of local services that involve heavy use
* of system resources, in a scenario where it is more efficient to * of system resources, in a scenario where it is more efficient to
* throttle concurrency for a specific service rather than restricting * throttle concurrency for a specific service rather than restricting
* the entire thread pool (e.g. the web container's thread pool). * the entire thread pool (for example, the web container's thread pool).
* *
* <p>The default concurrency limit of this interceptor is 1. * <p>The default concurrency limit of this interceptor is 1.
* Specify the "concurrencyLimit" bean property to change this value. * Specify the "concurrencyLimit" bean property to change this value.

View File

@ -30,7 +30,7 @@ import org.springframework.lang.Nullable;
/** /**
* Interceptor that exposes the current {@link org.aopalliance.intercept.MethodInvocation} * Interceptor that exposes the current {@link org.aopalliance.intercept.MethodInvocation}
* as a thread-local object. We occasionally need to do this; for example, when a pointcut * as a thread-local object. We occasionally need to do this; for example, when a pointcut
* (e.g. an AspectJ expression pointcut) needs to know the full invocation context. * (for example, an AspectJ expression pointcut) needs to know the full invocation context.
* *
* <p>Don't use this interceptor unless this is really necessary. Target objects should * <p>Don't use this interceptor unless this is really necessary. Target objects should
* not normally know about Spring AOP, as this creates a dependency on Spring API. * not normally know about Spring AOP, as this creates a dependency on Spring API.

View File

@ -29,7 +29,7 @@ import org.springframework.util.ObjectUtils;
* Abstract base regular expression pointcut bean. JavaBean properties are: * Abstract base regular expression pointcut bean. JavaBean properties are:
* <ul> * <ul>
* <li>pattern: regular expression for the fully-qualified method names to match. * <li>pattern: regular expression for the fully-qualified method names to match.
* The exact regexp syntax will depend on the subclass (e.g. Perl5 regular expressions) * The exact regexp syntax will depend on the subclass (for example, Perl5 regular expressions)
* <li>patterns: alternative property taking a String array of patterns. * <li>patterns: alternative property taking a String array of patterns.
* The result will be the union of these patterns. * The result will be the union of these patterns.
* </ul> * </ul>

View File

@ -194,7 +194,7 @@ public abstract class AopUtils {
/** /**
* Given a method, which may come from an interface, and a target class used * Given a method, which may come from an interface, and a target class used
* in the current AOP invocation, find the corresponding target method if there * in the current AOP invocation, find the corresponding target method if there
* is one. E.g. the method may be {@code IFoo.bar()} and the target class * is one. For example, the method may be {@code IFoo.bar()} and the target class
* may be {@code DefaultFoo}. In this case, the method may be * may be {@code DefaultFoo}. In this case, the method may be
* {@code DefaultFoo.bar()}. This enables attributes on that method to be found. * {@code DefaultFoo.bar()}. This enables attributes on that method to be found.
* <p><b>NOTE:</b> In contrast to {@link org.springframework.util.ClassUtils#getMostSpecificMethod}, * <p><b>NOTE:</b> In contrast to {@link org.springframework.util.ClassUtils#getMostSpecificMethod},

View File

@ -93,7 +93,7 @@ class ControlFlowPointcutTests {
/** /**
* Check that we can use a cflow pointcut in conjunction with * Check that we can use a cflow pointcut in conjunction with
* a static pointcut: e.g. all setter methods that are invoked under * a static pointcut: for example, all setter methods that are invoked under
* a particular class. This greatly reduces the number of calls * a particular class. This greatly reduces the number of calls
* to the cflow pointcut, meaning that it's not so prohibitively * to the cflow pointcut, meaning that it's not so prohibitively
* expensive. * expensive.

View File

@ -474,7 +474,7 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
else { else {
Throwable cause = ex.getTargetException(); Throwable cause = ex.getTargetException();
if (cause instanceof UndeclaredThrowableException) { if (cause instanceof UndeclaredThrowableException) {
// May happen e.g. with Groovy-generated methods // May happen, for example, with Groovy-generated methods
cause = cause.getCause(); cause = cause.getCause();
} }
throw new MethodInvocationException(propertyChangeEvent, cause); throw new MethodInvocationException(propertyChangeEvent, cause);

View File

@ -23,7 +23,7 @@ import org.springframework.lang.Nullable;
/** /**
* Strategy interface for creating {@link BeanInfo} instances for Spring beans. * Strategy interface for creating {@link BeanInfo} instances for Spring beans.
* Can be used to plug in custom bean property resolution strategies (e.g. for other * Can be used to plug in custom bean property resolution strategies (for example, for other
* languages on the JVM) or more efficient {@link BeanInfo} retrieval algorithms. * languages on the JVM) or more efficient {@link BeanInfo} retrieval algorithms.
* *
* <p>BeanInfoFactories are instantiated by the {@link CachedIntrospectionResults}, * <p>BeanInfoFactories are instantiated by the {@link CachedIntrospectionResults},

View File

@ -125,7 +125,7 @@ public abstract class BeanUtils {
* The cause may notably indicate a {@link NoSuchMethodException} if no * The cause may notably indicate a {@link NoSuchMethodException} if no
* primary/default constructor was found, a {@link NoClassDefFoundError} * primary/default constructor was found, a {@link NoClassDefFoundError}
* or other {@link LinkageError} in case of an unresolvable class definition * or other {@link LinkageError} in case of an unresolvable class definition
* (e.g. due to a missing dependency at runtime), or an exception thrown * (for example, due to a missing dependency at runtime), or an exception thrown
* from the constructor invocation itself. * from the constructor invocation itself.
* @see Constructor#newInstance * @see Constructor#newInstance
*/ */
@ -248,7 +248,7 @@ public abstract class BeanUtils {
// No public constructors -> check non-public // No public constructors -> check non-public
ctors = clazz.getDeclaredConstructors(); ctors = clazz.getDeclaredConstructors();
if (ctors.length == 1) { if (ctors.length == 1) {
// A single non-public constructor, e.g. from a non-public record type // A single non-public constructor, for example, from a non-public record type
return (Constructor<T>) ctors[0]; return (Constructor<T>) ctors[0];
} }
} }
@ -538,7 +538,7 @@ public abstract class BeanUtils {
/** /**
* Find a JavaBeans PropertyEditor following the 'Editor' suffix convention * Find a JavaBeans PropertyEditor following the 'Editor' suffix convention
* (e.g. "mypackage.MyDomainClass" &rarr; "mypackage.MyDomainClassEditor"). * (for example, "mypackage.MyDomainClass" &rarr; "mypackage.MyDomainClassEditor").
* <p>Compatible to the standard JavaBeans convention as implemented by * <p>Compatible to the standard JavaBeans convention as implemented by
* {@link java.beans.PropertyEditorManager} but isolated from the latter's * {@link java.beans.PropertyEditorManager} but isolated from the latter's
* registered default editors for primitive types. * registered default editors for primitive types.
@ -560,7 +560,7 @@ public abstract class BeanUtils {
} }
} }
catch (Throwable ex) { catch (Throwable ex) {
// e.g. AccessControlException on Google App Engine // for example, AccessControlException on Google App Engine
return null; return null;
} }
} }

View File

@ -107,7 +107,7 @@ public final class CachedIntrospectionResults {
* Accept the given ClassLoader as cache-safe, even if its classes would * Accept the given ClassLoader as cache-safe, even if its classes would
* not qualify as cache-safe in this CachedIntrospectionResults class. * not qualify as cache-safe in this CachedIntrospectionResults class.
* <p>This configuration method is only relevant in scenarios where the Spring * <p>This configuration method is only relevant in scenarios where the Spring
* classes reside in a 'common' ClassLoader (e.g. the system ClassLoader) * classes reside in a 'common' ClassLoader (for example, the system ClassLoader)
* whose lifecycle is not coupled to the application. In such a scenario, * whose lifecycle is not coupled to the application. In such a scenario,
* CachedIntrospectionResults would by default not cache any of the application's * CachedIntrospectionResults would by default not cache any of the application's
* classes, since they would create a leak in the common ClassLoader. * classes, since they would create a leak in the common ClassLoader.
@ -290,7 +290,7 @@ public final class CachedIntrospectionResults {
currClass = currClass.getSuperclass(); currClass = currClass.getSuperclass();
} }
// Check for record-style accessors without prefix: e.g. "lastName()" // Check for record-style accessors without prefix: for example, "lastName()"
// - accessor method directly referring to instance field of same name // - accessor method directly referring to instance field of same name
// - same convention for component accessors of Java 15 record classes // - same convention for component accessors of Java 15 record classes
introspectPlainAccessors(beanClass, readMethodNames); introspectPlainAccessors(beanClass, readMethodNames);

View File

@ -41,7 +41,7 @@ import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
/** /**
* Decorator for a standard {@link BeanInfo} object, e.g. as created by * Decorator for a standard {@link BeanInfo} object, for example, as created by
* {@link Introspector#getBeanInfo(Class)}, designed to discover and register * {@link Introspector#getBeanInfo(Class)}, designed to discover and register
* static and/or non-void returning setter methods. For example: * static and/or non-void returning setter methods. For example:
* *

View File

@ -20,7 +20,7 @@ import org.springframework.lang.Nullable;
/** /**
* Thrown on an unrecoverable problem encountered in the * Thrown on an unrecoverable problem encountered in the
* beans packages or sub-packages, e.g. bad class or field. * beans packages or sub-packages, for example, bad class or field.
* *
* @author Rod Johnson * @author Rod Johnson
*/ */

View File

@ -21,7 +21,7 @@ import org.springframework.lang.Nullable;
/** /**
* Exception thrown when a BeanFactory encounters an invalid bean definition: * Exception thrown when a BeanFactory encounters an invalid bean definition:
* e.g. in case of incomplete or contradictory bean metadata. * for example, in case of incomplete or contradictory bean metadata.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -36,7 +36,7 @@ import org.springframework.lang.Nullable;
* singleton in the scope of the factory). Which type of instance will be returned * singleton in the scope of the factory). Which type of instance will be returned
* depends on the bean factory configuration: the API is the same. Since Spring * depends on the bean factory configuration: the API is the same. Since Spring
* 2.0, further scopes are available depending on the concrete application * 2.0, further scopes are available depending on the concrete application
* context (e.g. "request" and "session" scopes in a web environment). * context (for example, "request" and "session" scopes in a web environment).
* *
* <p>The point of this approach is that the BeanFactory is a central registry * <p>The point of this approach is that the BeanFactory is a central registry
* of application components, and centralizes configuration of application * of application components, and centralizes configuration of application

View File

@ -18,7 +18,7 @@ package org.springframework.beans.factory;
/** /**
* Interface to be implemented by beans that need to react once all their properties * Interface to be implemented by beans that need to react once all their properties
* have been set by a {@link BeanFactory}: e.g. to perform custom initialization, * have been set by a {@link BeanFactory}: for example, to perform custom initialization,
* or merely to check that all mandatory properties have been set. * or merely to check that all mandatory properties have been set.
* *
* <p>An alternative to implementing {@code InitializingBean} is specifying a custom * <p>An alternative to implementing {@code InitializingBean} is specifying a custom

View File

@ -38,10 +38,10 @@ import org.springframework.lang.Nullable;
* iteration and allows for collection-style {@link #stream} access. * iteration and allows for collection-style {@link #stream} access.
* *
* <p>As of 6.2, this interface declares default implementations for all methods. * <p>As of 6.2, this interface declares default implementations for all methods.
* This makes it easier to implement in a custom fashion, e.g. for unit tests. * This makes it easier to implement in a custom fashion, for example, for unit tests.
* For typical purposes, implement {@link #stream()} to enable all other methods. * For typical purposes, implement {@link #stream()} to enable all other methods.
* Alternatively, you may implement the specific methods that your callers expect, * Alternatively, you may implement the specific methods that your callers expect,
* e.g. just {@link #getObject()} or {@link #getIfAvailable()}. * for example, just {@link #getObject()} or {@link #getIfAvailable()}.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 4.3 * @since 4.3

View File

@ -21,7 +21,7 @@ package org.springframework.beans.factory;
* during {@link BeanFactory} bootstrap. This interface can be implemented by * during {@link BeanFactory} bootstrap. This interface can be implemented by
* singleton beans in order to perform some initialization after the regular * singleton beans in order to perform some initialization after the regular
* singleton instantiation algorithm, avoiding side effects with accidental early * singleton instantiation algorithm, avoiding side effects with accidental early
* initialization (e.g. from {@link ListableBeanFactory#getBeansOfType} calls). * initialization (for example, from {@link ListableBeanFactory#getBeansOfType} calls).
* In that sense, it is an alternative to {@link InitializingBean} which gets * In that sense, it is an alternative to {@link InitializingBean} which gets
* triggered right at the end of a bean's local construction phase. * triggered right at the end of a bean's local construction phase.
* *

View File

@ -50,7 +50,7 @@ public abstract class BeanFactoryAnnotationUtils {
/** /**
* Retrieve all beans of type {@code T} from the given {@code BeanFactory} declaring a * Retrieve all beans of type {@code T} from the given {@code BeanFactory} declaring a
* qualifier (e.g. via {@code <qualifier>} or {@code @Qualifier}) matching the given * qualifier (for example, via {@code <qualifier>} or {@code @Qualifier}) matching the given
* qualifier, or having a bean name matching the given qualifier. * qualifier, or having a bean name matching the given qualifier.
* @param beanFactory the factory to get the target beans from (also searching ancestors) * @param beanFactory the factory to get the target beans from (also searching ancestors)
* @param beanType the type of beans to retrieve * @param beanType the type of beans to retrieve
@ -75,7 +75,7 @@ public abstract class BeanFactoryAnnotationUtils {
/** /**
* Obtain a bean of type {@code T} from the given {@code BeanFactory} declaring a * Obtain a bean of type {@code T} from the given {@code BeanFactory} declaring a
* qualifier (e.g. via {@code <qualifier>} or {@code @Qualifier}) matching the given * qualifier (for example, via {@code <qualifier>} or {@code @Qualifier}) matching the given
* qualifier, or having a bean name matching the given qualifier. * qualifier, or having a bean name matching the given qualifier.
* @param beanFactory the factory to get the target bean from (also searching ancestors) * @param beanFactory the factory to get the target bean from (also searching ancestors)
* @param beanType the type of bean to retrieve * @param beanType the type of bean to retrieve
@ -109,7 +109,7 @@ public abstract class BeanFactoryAnnotationUtils {
/** /**
* Obtain a bean of type {@code T} from the given {@code BeanFactory} declaring a qualifier * Obtain a bean of type {@code T} from the given {@code BeanFactory} declaring a qualifier
* (e.g. {@code <qualifier>} or {@code @Qualifier}) matching the given qualifier). * (for example, {@code <qualifier>} or {@code @Qualifier}) matching the given qualifier).
* @param bf the factory to get the target bean from * @param bf the factory to get the target bean from
* @param beanType the type of bean to retrieve * @param beanType the type of bean to retrieve
* @param qualifier the qualifier for selecting between multiple bean matches * @param qualifier the qualifier for selecting between multiple bean matches

View File

@ -153,7 +153,7 @@ public final class ParameterResolutionDelegate {
* an empty {@code AnnotatedElement}. * an empty {@code AnnotatedElement}.
* <h4>WARNING</h4> * <h4>WARNING</h4>
* <p>The {@code AnnotatedElement} returned by this method should never be cast and * <p>The {@code AnnotatedElement} returned by this method should never be cast and
* treated as a {@code Parameter} since the metadata (e.g., {@link Parameter#getName()}, * treated as a {@code Parameter} since the metadata (for example, {@link Parameter#getName()},
* {@link Parameter#getType()}, etc.) will not match those for the declared parameter * {@link Parameter#getType()}, etc.) will not match those for the declared parameter
* at the given index in an inner class constructor. * at the given index in an inner class constructor.
* @return the supplied {@code parameter} or the <em>effective</em> {@code Parameter} * @return the supplied {@code parameter} or the <em>effective</em> {@code Parameter}

View File

@ -105,7 +105,7 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
/** /**
* Suffix for the "original instance" convention when initializing an existing * Suffix for the "original instance" convention when initializing an existing
* bean instance: to be appended to the fully-qualified bean class name, * bean instance: to be appended to the fully-qualified bean class name,
* e.g. "com.mypackage.MyClass.ORIGINAL", in order to enforce the given instance * for example, "com.mypackage.MyClass.ORIGINAL", in order to enforce the given instance
* to be returned, i.e. no proxies etc. * to be returned, i.e. no proxies etc.
* @since 5.1 * @since 5.1
* @see #initializeBean(Object, String) * @see #initializeBean(Object, String)
@ -128,7 +128,7 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
* Constructor resolution is based on Kotlin primary / single public / single non-public, * Constructor resolution is based on Kotlin primary / single public / single non-public,
* with a fallback to the default constructor in ambiguous scenarios, also influenced * with a fallback to the default constructor in ambiguous scenarios, also influenced
* by {@link SmartInstantiationAwareBeanPostProcessor#determineCandidateConstructors} * by {@link SmartInstantiationAwareBeanPostProcessor#determineCandidateConstructors}
* (e.g. for annotation-driven constructor selection). * (for example, for annotation-driven constructor selection).
* @param beanClass the class of the bean to create * @param beanClass the class of the bean to create
* @return the new bean instance * @return the new bean instance
* @throws BeansException if instantiation or wiring failed * @throws BeansException if instantiation or wiring failed
@ -137,7 +137,7 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
/** /**
* Populate the given bean instance through applying after-instantiation callbacks * Populate the given bean instance through applying after-instantiation callbacks
* and bean property post-processing (e.g. for annotation-driven injection). * and bean property post-processing (for example, for annotation-driven injection).
* <p>Note: This is essentially intended for (re-)populating annotated fields and * <p>Note: This is essentially intended for (re-)populating annotated fields and
* methods, either for new instances or for deserialized instances. It does * methods, either for new instances or for deserialized instances. It does
* <i>not</i> imply traditional by-name or by-type autowiring of properties; * <i>not</i> imply traditional by-name or by-type autowiring of properties;
@ -196,7 +196,7 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
* Instantiate a new bean instance of the given class with the specified autowire * Instantiate a new bean instance of the given class with the specified autowire
* strategy. All constants defined in this interface are supported here. * strategy. All constants defined in this interface are supported here.
* Can also be invoked with {@code AUTOWIRE_NO} in order to just apply * Can also be invoked with {@code AUTOWIRE_NO} in order to just apply
* before-instantiation callbacks (e.g. for annotation-driven injection). * before-instantiation callbacks (for example, for annotation-driven injection).
* <p>Does <i>not</i> apply standard {@link BeanPostProcessor BeanPostProcessors} * <p>Does <i>not</i> apply standard {@link BeanPostProcessor BeanPostProcessors}
* callbacks or perform any further initialization of the bean. This interface * callbacks or perform any further initialization of the bean. This interface
* offers distinct, fine-grained operations for those purposes, for example * offers distinct, fine-grained operations for those purposes, for example
@ -223,7 +223,7 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
/** /**
* Autowire the bean properties of the given bean instance by name or type. * Autowire the bean properties of the given bean instance by name or type.
* Can also be invoked with {@code AUTOWIRE_NO} in order to just apply * Can also be invoked with {@code AUTOWIRE_NO} in order to just apply
* after-instantiation callbacks (e.g. for annotation-driven injection). * after-instantiation callbacks (for example, for annotation-driven injection).
* <p>Does <i>not</i> apply standard {@link BeanPostProcessor BeanPostProcessors} * <p>Does <i>not</i> apply standard {@link BeanPostProcessor BeanPostProcessors}
* callbacks or perform any further initialization of the bean. This interface * callbacks or perform any further initialization of the bean. This interface
* offers distinct, fine-grained operations for those purposes, for example * offers distinct, fine-grained operations for those purposes, for example

View File

@ -241,7 +241,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
boolean hasEmbeddedValueResolver(); boolean hasEmbeddedValueResolver();
/** /**
* Resolve the given embedded value, e.g. an annotation attribute. * Resolve the given embedded value, for example, an annotation attribute.
* @param value the value to resolve * @param value the value to resolve
* @return the resolved value (may be the original value as-is) * @return the resolved value (may be the original value as-is)
* @since 3.0 * @since 3.0
@ -255,7 +255,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* <p>Note: Post-processors submitted here will be applied in the order of * <p>Note: Post-processors submitted here will be applied in the order of
* registration; any ordering semantics expressed through implementing the * registration; any ordering semantics expressed through implementing the
* {@link org.springframework.core.Ordered} interface will be ignored. Note * {@link org.springframework.core.Ordered} interface will be ignored. Note
* that autodetected post-processors (e.g. as beans in an ApplicationContext) * that autodetected post-processors (for example, as beans in an ApplicationContext)
* will always be applied after programmatically registered ones. * will always be applied after programmatically registered ones.
* @param beanPostProcessor the post-processor to register * @param beanPostProcessor the post-processor to register
*/ */

View File

@ -66,13 +66,13 @@ public interface ConfigurableListableBeanFactory
* Register a special dependency type with corresponding autowired value. * Register a special dependency type with corresponding autowired value.
* <p>This is intended for factory/context references that are supposed * <p>This is intended for factory/context references that are supposed
* to be autowirable but are not defined as beans in the factory: * to be autowirable but are not defined as beans in the factory:
* e.g. a dependency of type ApplicationContext resolved to the * for example, a dependency of type ApplicationContext resolved to the
* ApplicationContext instance that the bean is living in. * ApplicationContext instance that the bean is living in.
* <p>Note: There are no such default types registered in a plain BeanFactory, * <p>Note: There are no such default types registered in a plain BeanFactory,
* not even for the BeanFactory interface itself. * not even for the BeanFactory interface itself.
* @param dependencyType the dependency type to register. This will typically * @param dependencyType the dependency type to register. This will typically
* be a base interface such as BeanFactory, with extensions of it resolved * be a base interface such as BeanFactory, with extensions of it resolved
* as well if declared as an autowiring dependency (e.g. ListableBeanFactory), * as well if declared as an autowiring dependency (for example, ListableBeanFactory),
* as long as the given value actually implements the extended interface. * as long as the given value actually implements the extended interface.
* @param autowiredValue the corresponding autowired value. This may also be an * @param autowiredValue the corresponding autowired value. This may also be an
* implementation of the {@link org.springframework.beans.factory.ObjectFactory} * implementation of the {@link org.springframework.beans.factory.ObjectFactory}
@ -126,7 +126,7 @@ public interface ConfigurableListableBeanFactory
* Clear the merged bean definition cache, removing entries for beans * Clear the merged bean definition cache, removing entries for beans
* which are not considered eligible for full metadata caching yet. * which are not considered eligible for full metadata caching yet.
* <p>Typically triggered after changes to the original bean definitions, * <p>Typically triggered after changes to the original bean definitions,
* e.g. after applying a {@link BeanFactoryPostProcessor}. Note that metadata * for example, after applying a {@link BeanFactoryPostProcessor}. Note that metadata
* for beans which have already been created at this point will be kept around. * for beans which have already been created at this point will be kept around.
* @since 4.2 * @since 4.2
* @see #getBeanDefinition * @see #getBeanDefinition

View File

@ -76,7 +76,7 @@ import org.springframework.util.ClassUtils;
* *
* <p> * <p>
* Also supports "java.lang.String[]"-style array class names and primitive * Also supports "java.lang.String[]"-style array class names and primitive
* class names (e.g. "boolean"). Delegates to {@link ClassUtils} for actual * class names (for example, "boolean"). Delegates to {@link ClassUtils} for actual
* class name resolution. * class name resolution.
* *
* <p><b>NOTE:</b> Custom property editors registered with this configurer do * <p><b>NOTE:</b> Custom property editors registered with this configurer do

View File

@ -180,7 +180,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
/** /**
* Check whether the underlying field is annotated with any variant of a * Check whether the underlying field is annotated with any variant of a
* {@code Nullable} annotation, e.g. {@code jakarta.annotation.Nullable} or * {@code Nullable} annotation, for example, {@code jakarta.annotation.Nullable} or
* {@code edu.umd.cs.findbugs.annotations.Nullable}. * {@code edu.umd.cs.findbugs.annotations.Nullable}.
*/ */
private boolean hasNullableAnnotation() { private boolean hasNullableAnnotation() {
@ -381,7 +381,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
/** /**
* Determine whether this dependency supports lazy resolution, * Determine whether this dependency supports lazy resolution,
* e.g. through extra proxying. The default is {@code true}. * for example, through extra proxying. The default is {@code true}.
* @since 6.1.2 * @since 6.1.2
* @see org.springframework.beans.factory.support.AutowireCandidateResolver#getLazyResolutionProxyIfNecessary * @see org.springframework.beans.factory.support.AutowireCandidateResolver#getLazyResolutionProxyIfNecessary
*/ */

View File

@ -31,7 +31,7 @@ public interface DestructionAwareBeanPostProcessor extends BeanPostProcessor {
/** /**
* Apply this BeanPostProcessor to the given bean instance before its * Apply this BeanPostProcessor to the given bean instance before its
* destruction, e.g. invoking custom destruction callbacks. * destruction, for example, invoking custom destruction callbacks.
* <p>Like DisposableBean's {@code destroy} and a custom destroy method, this * <p>Like DisposableBean's {@code destroy} and a custom destroy method, this
* callback will only apply to beans which the container fully manages the * callback will only apply to beans which the container fully manages the
* lifecycle for. This is usually the case for singletons and scoped beans. * lifecycle for. This is usually the case for singletons and scoped beans.

View File

@ -140,7 +140,7 @@ public class FieldRetrievingFactoryBean
/** /**
* Set a fully qualified static field name to retrieve, * Set a fully qualified static field name to retrieve,
* e.g. "example.MyExampleClass.MY_EXAMPLE_FIELD". * for example, "example.MyExampleClass.MY_EXAMPLE_FIELD".
* Convenient alternative to specifying targetClass and targetField. * Convenient alternative to specifying targetClass and targetField.
* @see #setTargetClass * @see #setTargetClass
* @see #setTargetField * @see #setTargetField
@ -190,7 +190,7 @@ public class FieldRetrievingFactoryBean
if (lastDotIndex == -1 || lastDotIndex == this.staticField.length()) { if (lastDotIndex == -1 || lastDotIndex == this.staticField.length()) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"staticField must be a fully qualified class plus static field name: " + "staticField must be a fully qualified class plus static field name: " +
"e.g. 'example.MyExampleClass.MY_EXAMPLE_FIELD'"); "for example, 'example.MyExampleClass.MY_EXAMPLE_FIELD'");
} }
String className = this.staticField.substring(0, lastDotIndex); String className = this.staticField.substring(0, lastDotIndex);
String fieldName = this.staticField.substring(lastDotIndex + 1); String fieldName = this.staticField.substring(lastDotIndex + 1);

View File

@ -180,7 +180,7 @@ public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfi
/** /**
* Set a value that should be treated as {@code null} when resolved * Set a value that should be treated as {@code null} when resolved
* as a placeholder value: e.g. "" (empty String) or "null". * as a placeholder value: for example, "" (empty String) or "null".
* <p>Note that this will only apply to full property values, * <p>Note that this will only apply to full property values,
* not to parts of concatenated values. * not to parts of concatenated values.
* <p>By default, no such null value is defined. This means that * <p>By default, no such null value is defined. This means that

View File

@ -121,7 +121,7 @@ public class PropertyPathFactoryBean implements FactoryBean<Object>, BeanNameAwa
* Specify the name of a target bean to apply the property path to. * Specify the name of a target bean to apply the property path to.
* Alternatively, specify a target object directly. * Alternatively, specify a target object directly.
* @param targetBeanName the bean name to be looked up in the * @param targetBeanName the bean name to be looked up in the
* containing bean factory (e.g. "testBean") * containing bean factory (for example, "testBean")
* @see #setTargetObject * @see #setTargetObject
*/ */
public void setTargetBeanName(String targetBeanName) { public void setTargetBeanName(String targetBeanName) {
@ -131,7 +131,7 @@ public class PropertyPathFactoryBean implements FactoryBean<Object>, BeanNameAwa
/** /**
* Specify the property path to apply to the target. * Specify the property path to apply to the target.
* @param propertyPath the property path, potentially nested * @param propertyPath the property path, potentially nested
* (e.g. "age" or "spouse.age") * (for example, "age" or "spouse.age")
*/ */
public void setPropertyPath(String propertyPath) { public void setPropertyPath(String propertyPath) {
this.propertyPath = StringUtils.trimAllWhitespace(propertyPath); this.propertyPath = StringUtils.trimAllWhitespace(propertyPath);

View File

@ -93,7 +93,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
/** /**
* Set the system property mode by the name of the corresponding constant, * Set the system property mode by the name of the corresponding constant,
* e.g. "SYSTEM_PROPERTIES_MODE_OVERRIDE". * for example, "SYSTEM_PROPERTIES_MODE_OVERRIDE".
* @param constantName name of the constant * @param constantName name of the constant
* @see #setSystemPropertiesMode * @see #setSystemPropertiesMode
*/ */

View File

@ -31,7 +31,7 @@ import org.springframework.lang.Nullable;
* <p>{@link org.springframework.context.ApplicationContext} implementations * <p>{@link org.springframework.context.ApplicationContext} implementations
* such as a {@link org.springframework.web.context.WebApplicationContext} * such as a {@link org.springframework.web.context.WebApplicationContext}
* may register additional standard scopes specific to their environment, * may register additional standard scopes specific to their environment,
* e.g. {@link org.springframework.web.context.WebApplicationContext#SCOPE_REQUEST "request"} * for example, {@link org.springframework.web.context.WebApplicationContext#SCOPE_REQUEST "request"}
* and {@link org.springframework.web.context.WebApplicationContext#SCOPE_SESSION "session"}, * and {@link org.springframework.web.context.WebApplicationContext#SCOPE_SESSION "session"},
* based on this Scope SPI. * based on this Scope SPI.
* *
@ -125,7 +125,7 @@ public interface Scope {
/** /**
* Resolve the contextual object for the given key, if any. * Resolve the contextual object for the given key, if any.
* E.g. the HttpServletRequest object for key "request". * For example, the HttpServletRequest object for key "request".
* @param key the contextual key * @param key the contextual key
* @return the corresponding object, or {@code null} if none found * @return the corresponding object, or {@code null} if none found
* @throws IllegalStateException if the underlying scope is not currently active * @throws IllegalStateException if the underlying scope is not currently active

View File

@ -77,7 +77,7 @@ public abstract class YamlProcessor {
* A map of document matchers allowing callers to selectively use only * A map of document matchers allowing callers to selectively use only
* some of the documents in a YAML resource. In YAML documents are * some of the documents in a YAML resource. In YAML documents are
* separated by {@code ---} lines, and each document is converted * separated by {@code ---} lines, and each document is converted
* to properties before the match is made. E.g. * to properties before the match is made. For example,
* <pre class="code"> * <pre class="code">
* environment: dev * environment: dev
* url: https://dev.bar.com * url: https://dev.bar.com

View File

@ -32,7 +32,7 @@ import org.springframework.lang.Nullable;
* has a lot of similar features. * has a lot of similar features.
* *
* <p><b>Note: All exposed values are of type {@code String}</b> for access through * <p><b>Note: All exposed values are of type {@code String}</b> for access through
* the common {@link Properties#getProperty} method (e.g. in configuration property * the common {@link Properties#getProperty} method (for example, in configuration property
* resolution through {@link PropertyResourceConfigurer#setProperties(Properties)}). * resolution through {@link PropertyResourceConfigurer#setProperties(Properties)}).
* If this is not desirable, use {@link YamlMapFactoryBean} instead. * If this is not desirable, use {@link YamlMapFactoryBean} instead.
* *

View File

@ -28,7 +28,7 @@ import org.springframework.beans.factory.config.BeanReference;
* it is now possible for a single logical configuration entity, in this case an XML tag, to * it is now possible for a single logical configuration entity, in this case an XML tag, to
* create multiple {@link BeanDefinition BeanDefinitions} and {@link BeanReference RuntimeBeanReferences} * create multiple {@link BeanDefinition BeanDefinitions} and {@link BeanReference RuntimeBeanReferences}
* in order to provide more succinct configuration and greater convenience to end users. As such, it can * in order to provide more succinct configuration and greater convenience to end users. As such, it can
* no longer be assumed that each configuration entity (e.g. XML tag) maps to one {@link BeanDefinition}. * no longer be assumed that each configuration entity (for example, XML tag) maps to one {@link BeanDefinition}.
* For tool vendors and other users who wish to present visualization or support for configuring Spring * For tool vendors and other users who wish to present visualization or support for configuring Spring
* applications it is important that there is some mechanism in place to tie the {@link BeanDefinition BeanDefinitions} * applications it is important that there is some mechanism in place to tie the {@link BeanDefinition BeanDefinitions}
* in the {@link org.springframework.beans.factory.BeanFactory} back to the configuration data in a way * in the {@link org.springframework.beans.factory.BeanFactory} back to the configuration data in a way

View File

@ -205,7 +205,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/** /**
* Set the ParameterNameDiscoverer to use for resolving method parameter * Set the ParameterNameDiscoverer to use for resolving method parameter
* names if needed (e.g. for constructor names). * names if needed (for example, for constructor names).
* <p>Default is a {@link DefaultParameterNameDiscoverer}. * <p>Default is a {@link DefaultParameterNameDiscoverer}.
*/ */
public void setParameterNameDiscoverer(@Nullable ParameterNameDiscoverer parameterNameDiscoverer) { public void setParameterNameDiscoverer(@Nullable ParameterNameDiscoverer parameterNameDiscoverer) {
@ -539,7 +539,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/** /**
* Actually create the specified bean. Pre-creation processing has already happened * Actually create the specified bean. Pre-creation processing has already happened
* at this point, e.g. checking {@code postProcessBeforeInstantiation} callbacks. * at this point, for example, checking {@code postProcessBeforeInstantiation} callbacks.
* <p>Differentiates between default bean instantiation, use of a * <p>Differentiates between default bean instantiation, use of a
* factory method, and autowiring a constructor. * factory method, and autowiring a constructor.
* @param beanName the name of the bean * @param beanName the name of the bean
@ -821,7 +821,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
return cachedReturnType.resolve(); return cachedReturnType.resolve();
} }
catch (LinkageError err) { catch (LinkageError err) {
// E.g. a NoClassDefFoundError for a generic method return type // For example, a NoClassDefFoundError for a generic method return type
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("Failed to resolve type for factory method of bean '" + beanName + "': " + logger.debug("Failed to resolve type for factory method of bean '" + beanName + "': " +
(uniqueCandidate != null ? uniqueCandidate : commonType), err); (uniqueCandidate != null ? uniqueCandidate : commonType), err);

View File

@ -1075,7 +1075,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* Specify whether the configured initializer method is the default. * Specify whether the configured initializer method is the default.
* <p>The default value is {@code true} for a locally specified init method * <p>The default value is {@code true} for a locally specified init method
* but switched to {@code false} for a shared setting in a defaults section * but switched to {@code false} for a shared setting in a defaults section
* (e.g. {@code bean init-method} versus {@code beans default-init-method} * (for example, {@code bean init-method} versus {@code beans default-init-method}
* level in XML) which might not apply to all contained bean definitions. * level in XML) which might not apply to all contained bean definitions.
* @see #setInitMethodName * @see #setInitMethodName
* @see #applyDefaults * @see #applyDefaults
@ -1135,7 +1135,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* Specify whether the configured destroy method is the default. * Specify whether the configured destroy method is the default.
* <p>The default value is {@code true} for a locally specified destroy method * <p>The default value is {@code true} for a locally specified destroy method
* but switched to {@code false} for a shared setting in a defaults section * but switched to {@code false} for a shared setting in a defaults section
* (e.g. {@code bean destroy-method} versus {@code beans default-destroy-method} * (for example, {@code bean destroy-method} versus {@code beans default-destroy-method}
* level in XML) which might not apply to all contained bean definitions. * level in XML) which might not apply to all contained bean definitions.
* @see #setDestroyMethodName * @see #setDestroyMethodName
* @see #applyDefaults * @see #applyDefaults
@ -1241,7 +1241,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
} }
/** /**
* Set the originating (e.g. decorated) BeanDefinition, if any. * Set the originating (for example, decorated) BeanDefinition, if any.
*/ */
public void setOriginatingBeanDefinition(BeanDefinition originatingBd) { public void setOriginatingBeanDefinition(BeanDefinition originatingBd) {
this.resource = new BeanDefinitionResource(originatingBd); this.resource = new BeanDefinitionResource(originatingBd);

View File

@ -147,7 +147,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
@Nullable @Nullable
private TypeConverter typeConverter; private TypeConverter typeConverter;
/** String resolvers to apply e.g. to annotation attribute values. */ /** String resolvers to apply, for example, to annotation attribute values. */
private final List<StringValueResolver> embeddedValueResolvers = new CopyOnWriteArrayList<>(); private final List<StringValueResolver> embeddedValueResolvers = new CopyOnWriteArrayList<>();
/** BeanPostProcessors to apply. */ /** BeanPostProcessors to apply. */
@ -1511,7 +1511,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* Clear the merged bean definition cache, removing entries for beans * Clear the merged bean definition cache, removing entries for beans
* which are not considered eligible for full metadata caching yet. * which are not considered eligible for full metadata caching yet.
* <p>Typically triggered after changes to the original bean definitions, * <p>Typically triggered after changes to the original bean definitions,
* e.g. after applying a {@code BeanFactoryPostProcessor}. Note that metadata * for example, after applying a {@code BeanFactoryPostProcessor}. Note that metadata
* for beans which have already been created at this point will be kept around. * for beans which have already been created at this point will be kept around.
* @since 4.2 * @since 4.2
*/ */
@ -1570,7 +1570,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
if (!ObjectUtils.isEmpty(typesToMatch)) { if (!ObjectUtils.isEmpty(typesToMatch)) {
// When just doing type checks (i.e. not creating an actual instance yet), // When just doing type checks (i.e. not creating an actual instance yet),
// use the specified temporary class loader (e.g. in a weaving scenario). // use the specified temporary class loader (for example, in a weaving scenario).
ClassLoader tempClassLoader = getTempClassLoader(); ClassLoader tempClassLoader = getTempClassLoader();
if (tempClassLoader != null) { if (tempClassLoader != null) {
dynamicLoader = tempClassLoader; dynamicLoader = tempClassLoader;

View File

@ -50,7 +50,7 @@ public interface AutowireCandidateResolver {
* <p>The default implementation checks {@link DependencyDescriptor#isRequired()}. * <p>The default implementation checks {@link DependencyDescriptor#isRequired()}.
* @param descriptor the descriptor for the target method parameter or field * @param descriptor the descriptor for the target method parameter or field
* @return whether the descriptor is marked as required or possibly indicating * @return whether the descriptor is marked as required or possibly indicating
* non-required status some other way (e.g. through a parameter annotation) * non-required status some other way (for example, through a parameter annotation)
* @since 5.0 * @since 5.0
* @see DependencyDescriptor#isRequired() * @see DependencyDescriptor#isRequired()
*/ */

View File

@ -122,7 +122,7 @@ abstract class AutowireUtils {
/** /**
* Resolve the given autowiring value against the given required type, * Resolve the given autowiring value against the given required type,
* e.g. an {@link ObjectFactory} value to its actual object result. * for example, an {@link ObjectFactory} value to its actual object result.
* @param autowiringValue the value to resolve * @param autowiringValue the value to resolve
* @param requiredType the type to assign the result to * @param requiredType the type to assign the result to
* @return the resolved value * @return the resolved value
@ -157,7 +157,7 @@ abstract class AutowireUtils {
* the given {@code method} does not declare any {@linkplain * the given {@code method} does not declare any {@linkplain
* Method#getTypeParameters() formal type variables}</li> * Method#getTypeParameters() formal type variables}</li>
* <li>the {@linkplain Method#getReturnType() standard return type}, if the * <li>the {@linkplain Method#getReturnType() standard return type}, if the
* target return type cannot be inferred (e.g., due to type erasure)</li> * target return type cannot be inferred (for example, due to type erasure)</li>
* <li>{@code null}, if the length of the given arguments array is shorter * <li>{@code null}, if the length of the given arguments array is shorter
* than the length of the {@linkplain * than the length of the {@linkplain
* Method#getGenericParameterTypes() formal argument list} for the given * Method#getGenericParameterTypes() formal argument list} for the given
@ -182,8 +182,8 @@ abstract class AutowireUtils {
Type[] methodParameterTypes = method.getGenericParameterTypes(); Type[] methodParameterTypes = method.getGenericParameterTypes();
Assert.isTrue(args.length == methodParameterTypes.length, "Argument array does not match parameter count"); Assert.isTrue(args.length == methodParameterTypes.length, "Argument array does not match parameter count");
// Ensure that the type variable (e.g., T) is declared directly on the method // Ensure that the type variable (for example, T) is declared directly on the method
// itself (e.g., via <T>), not on the enclosing class or interface. // itself (for example, via <T>), not on the enclosing class or interface.
boolean locallyDeclaredTypeVariableMatchesReturnType = false; boolean locallyDeclaredTypeVariableMatchesReturnType = false;
for (TypeVariable<Method> currentTypeVariable : declaredTypeVariables) { for (TypeVariable<Method> currentTypeVariable : declaredTypeVariables) {
if (currentTypeVariable.equals(genericReturnType)) { if (currentTypeVariable.equals(genericReturnType)) {

View File

@ -918,7 +918,7 @@ class ConstructorResolver {
catch (NoSuchBeanDefinitionException ex) { catch (NoSuchBeanDefinitionException ex) {
if (fallback) { if (fallback) {
// Single constructor or factory method -> let's return an empty array/collection // Single constructor or factory method -> let's return an empty array/collection
// for e.g. a vararg or a non-null List/Set/Map parameter. // for example, a vararg or a non-null List/Set/Map parameter.
if (paramType.isArray()) { if (paramType.isArray()) {
return Array.newInstance(paramType.componentType(), 0); return Array.newInstance(paramType.componentType(), 0);
} }
@ -1323,7 +1323,7 @@ class ConstructorResolver {
// No public constructors -> check non-public // No public constructors -> check non-public
ctors = clazz.getDeclaredConstructors(); ctors = clazz.getDeclaredConstructors();
if (ctors.length == 1) { if (ctors.length == 1) {
// A single non-public constructor, e.g. from a non-public record type // A single non-public constructor, for example, from a non-public record type
return ctors; return ctors;
} }
} }

View File

@ -349,7 +349,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
this.dependencyComparator = otherListableFactory.dependencyComparator; this.dependencyComparator = otherListableFactory.dependencyComparator;
// A clone of the AutowireCandidateResolver since it is potentially BeanFactoryAware // A clone of the AutowireCandidateResolver since it is potentially BeanFactoryAware
setAutowireCandidateResolver(otherListableFactory.getAutowireCandidateResolver().cloneIfNecessary()); setAutowireCandidateResolver(otherListableFactory.getAutowireCandidateResolver().cloneIfNecessary());
// Make resolvable dependencies (e.g. ResourceLoader) available here as well // Make resolvable dependencies (for example, ResourceLoader) available here as well
this.resolvableDependencies.putAll(otherListableFactory.resolvableDependencies); this.resolvableDependencies.putAll(otherListableFactory.resolvableDependencies);
} }
} }
@ -772,7 +772,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
} }
if (containsBeanDefinition(beanName)) { if (containsBeanDefinition(beanName)) {
RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName); RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName);
// Check raw bean class, e.g. in case of a proxy. // Check raw bean class, for example, in case of a proxy.
if (bd.hasBeanClass() && bd.getFactoryMethodName() == null) { if (bd.hasBeanClass() && bd.getFactoryMethodName() == null) {
Class<?> beanClass = bd.getBeanClass(); Class<?> beanClass = bd.getBeanClass();
if (beanClass != beanType) { if (beanClass != beanType) {
@ -811,7 +811,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
} }
if (containsBeanDefinition(beanName)) { if (containsBeanDefinition(beanName)) {
RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName); RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName);
// Check raw bean class, e.g. in case of a proxy. // Check raw bean class, for example, in case of a proxy.
if (bd.hasBeanClass() && bd.getFactoryMethodName() == null) { if (bd.hasBeanClass() && bd.getFactoryMethodName() == null) {
Class<?> beanClass = bd.getBeanClass(); Class<?> beanClass = bd.getBeanClass();
if (beanClass != beanType) { if (beanClass != beanType) {
@ -1211,7 +1211,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
boolean explicitBeanOverride = (this.allowBeanDefinitionOverriding != null); boolean explicitBeanOverride = (this.allowBeanDefinitionOverriding != null);
if (existingDefinition.getRole() < beanDefinition.getRole()) { if (existingDefinition.getRole() < beanDefinition.getRole()) {
// e.g. was ROLE_APPLICATION, now overriding with ROLE_SUPPORT or ROLE_INFRASTRUCTURE // for example, was ROLE_APPLICATION, now overriding with ROLE_SUPPORT or ROLE_INFRASTRUCTURE
if (logger.isInfoEnabled()) { if (logger.isInfoEnabled()) {
logger.info("Overriding user-defined bean definition for bean '" + beanName + logger.info("Overriding user-defined bean definition for bean '" + beanName +
"' with a framework-generated bean definition: replacing [" + "' with a framework-generated bean definition: replacing [" +
@ -1290,7 +1290,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
// Remove corresponding bean from singleton cache, if any. Shouldn't usually // Remove corresponding bean from singleton cache, if any. Shouldn't usually
// be necessary, rather just meant for overriding a context's default beans // be necessary, rather just meant for overriding a context's default beans
// (e.g. the default StaticMessageSource in a StaticApplicationContext). // (for example, the default StaticMessageSource in a StaticApplicationContext).
destroySingleton(beanName); destroySingleton(beanName);
// Remove a cached primary marker for the given bean. // Remove a cached primary marker for the given bean.
@ -1521,7 +1521,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
InjectionPoint previousInjectionPoint = ConstructorResolver.setCurrentInjectionPoint(descriptor); InjectionPoint previousInjectionPoint = ConstructorResolver.setCurrentInjectionPoint(descriptor);
try { try {
// Step 1: pre-resolved shortcut for single bean match, e.g. from @Autowired // Step 1: pre-resolved shortcut for single bean match, for example, from @Autowired
Object shortcut = descriptor.resolveShortcut(this); Object shortcut = descriptor.resolveShortcut(this);
if (shortcut != null) { if (shortcut != null) {
return shortcut; return shortcut;
@ -1529,7 +1529,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
Class<?> type = descriptor.getDependencyType(); Class<?> type = descriptor.getDependencyType();
// Step 2: pre-defined value or expression, e.g. from @Value // Step 2: pre-defined value or expression, for example, from @Value
Object value = getAutowireCandidateResolver().getSuggestedValue(descriptor); Object value = getAutowireCandidateResolver().getSuggestedValue(descriptor);
if (value != null) { if (value != null) {
if (value instanceof String strValue) { if (value instanceof String strValue) {

View File

@ -157,7 +157,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
/** /**
* Add the given singleton factory for building the specified singleton * Add the given singleton factory for building the specified singleton
* if necessary. * if necessary.
* <p>To be called for early exposure purposes, e.g. to be able to * <p>To be called for early exposure purposes, for example, to be able to
* resolve circular references. * resolve circular references.
* @param beanName the name of the bean * @param beanName the name of the bean
* @param singletonFactory the factory for the singleton object * @param singletonFactory the factory for the singleton object
@ -340,7 +340,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
/** /**
* Register an exception that happened to get suppressed during the creation of a * Register an exception that happened to get suppressed during the creation of a
* singleton bean instance, e.g. a temporary circular reference resolution problem. * singleton bean instance, for example, a temporary circular reference resolution problem.
* <p>The default implementation preserves any given exception in this registry's * <p>The default implementation preserves any given exception in this registry's
* collection of suppressed exceptions, up to a limit of 100 exceptions, adding * collection of suppressed exceptions, up to a limit of 100 exceptions, adding
* them as related causes to an eventual top-level {@link BeanCreationException}. * them as related causes to an eventual top-level {@link BeanCreationException}.
@ -451,7 +451,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
/** /**
* Register a containment relationship between two beans, * Register a containment relationship between two beans,
* e.g. between an inner bean and its containing outer bean. * for example, between an inner bean and its containing outer bean.
* <p>Also registers the containing bean as dependent on the contained bean * <p>Also registers the containing bean as dependent on the contained bean
* in terms of destruction order. * in terms of destruction order.
* @param containedBeanName the name of the contained (inner) bean * @param containedBeanName the name of the contained (inner) bean

Some files were not shown because too many files have changed in this diff Show More