Replace 'e.g.' with 'for example' in documentation and comments
Closes gh-33515
This commit is contained in:
committed by
Sam Brannen
parent
e55fe9077f
commit
8941e2876e
@@ -114,7 +114,7 @@ public interface Cache {
|
||||
* but is allowed to return a completed {@link CompletableFuture} if the
|
||||
* corresponding value is immediately available.
|
||||
* <p>Can return {@code null} if the cache can immediately determine that
|
||||
* it contains no mapping for this key (e.g. through an in-memory key map).
|
||||
* it contains no mapping for this key (for example, through an in-memory key map).
|
||||
* Otherwise, the cached value will be returned in the {@link CompletableFuture},
|
||||
* with {@code null} indicating a late-determined cache miss. A nested
|
||||
* {@link ValueWrapper} potentially indicates a nullable cached value;
|
||||
@@ -200,7 +200,7 @@ public interface Cache {
|
||||
* </code></pre>
|
||||
* except that the action is performed atomically. While all out-of-the-box
|
||||
* {@link CacheManager} implementations are able to perform the put atomically,
|
||||
* the operation may also be implemented in two steps, e.g. with a check for
|
||||
* the operation may also be implemented in two steps, for example, with a check for
|
||||
* presence and a subsequent put, in a non-atomic way. Check the documentation
|
||||
* of the native cache implementation that you are using for more details.
|
||||
* <p>The default implementation delegates to {@link #get(Object)} and
|
||||
@@ -245,7 +245,7 @@ public interface Cache {
|
||||
* <p>The default implementation delegates to {@link #evict(Object)},
|
||||
* returning {@code false} for not-determined prior presence of the key.
|
||||
* Cache providers and in particular cache decorators are encouraged
|
||||
* to perform immediate eviction if possible (e.g. in case of generally
|
||||
* to perform immediate eviction if possible (for example, in case of generally
|
||||
* deferred cache operations within a transaction) and to reliably
|
||||
* determine prior presence of the given key.
|
||||
* @param key the key whose mapping is to be removed from the cache
|
||||
|
||||
@@ -78,9 +78,9 @@ public @interface Cacheable {
|
||||
* will all receive a put/evict request for the same newly cached value.
|
||||
* <p>Note that asynchronous/reactive cache access may not fully consult all
|
||||
* specified caches, depending on the target cache. In the case of late-determined
|
||||
* cache misses (e.g. with Redis), further caches will not get consulted anymore.
|
||||
* cache misses (for example, with Redis), further caches will not get consulted anymore.
|
||||
* As a consequence, specifying multiple cache names in an async cache mode setup
|
||||
* only makes sense with early-determined cache misses (e.g. with Caffeine).
|
||||
* only makes sense with early-determined cache misses (for example, with Caffeine).
|
||||
* @since 4.2
|
||||
* @see #value
|
||||
* @see CacheConfig#cacheNames
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface CachingConfigurer {
|
||||
* {@link CacheResolver} directly.
|
||||
* <p>Implementations must explicitly declare
|
||||
* {@link org.springframework.context.annotation.Bean @Bean} so that
|
||||
* the cache manager participates in the lifecycle of the context, e.g.
|
||||
* the cache manager participates in the lifecycle of the context, for example,
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
* @EnableCaching
|
||||
@@ -75,7 +75,7 @@ public interface CachingConfigurer {
|
||||
* the cache manager is ignored.
|
||||
* <p>Implementations must explicitly declare
|
||||
* {@link org.springframework.context.annotation.Bean @Bean} so that
|
||||
* the cache resolver participates in the lifecycle of the context, e.g.
|
||||
* the cache resolver participates in the lifecycle of the context, for example,
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
* @EnableCaching
|
||||
|
||||
@@ -176,7 +176,7 @@ public @interface EnableCaching {
|
||||
* For example, other beans marked with Spring's {@code @Transactional} annotation will
|
||||
* be upgraded to subclass proxying at the same time. This approach has no negative
|
||||
* impact in practice unless one is explicitly expecting one type of proxy vs another,
|
||||
* e.g. in tests.
|
||||
* for example, in tests.
|
||||
*/
|
||||
boolean proxyTargetClass() default false;
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
|
||||
* <p>Switch this flag to "true" in order to ignore Reactive Streams Publishers and
|
||||
* process them as regular return values through synchronous caching, restoring 6.0
|
||||
* behavior. Note that this is not recommended and only works in very limited
|
||||
* scenarios, e.g. with manual {@code Mono.cache()}/{@code Flux.cache()} calls.
|
||||
* scenarios, for example, with manual {@code Mono.cache()}/{@code Flux.cache()} calls.
|
||||
* @since 6.1.3
|
||||
* @see org.reactivestreams.Publisher
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ public class NameMatchCacheOperationSource implements CacheOperationSource, Seri
|
||||
|
||||
/**
|
||||
* Set a name/attribute map, consisting of method names
|
||||
* (e.g. "myMethod") and CacheOperation instances
|
||||
* (for example, "myMethod") and CacheOperation instances
|
||||
* (or Strings to be converted to CacheOperation instances).
|
||||
* @see CacheOperation
|
||||
*/
|
||||
|
||||
@@ -107,7 +107,7 @@ public interface ApplicationContext extends EnvironmentCapable, ListableBeanFact
|
||||
* @return the AutowireCapableBeanFactory for this context
|
||||
* @throws IllegalStateException if the context does not support the
|
||||
* {@link AutowireCapableBeanFactory} interface, or does not hold an
|
||||
* autowire-capable bean factory yet (e.g. if {@code refresh()} has
|
||||
* autowire-capable bean factory yet (for example, if {@code refresh()} has
|
||||
* never been called), or if the context has been closed already
|
||||
* @see ConfigurableApplicationContext#refresh()
|
||||
* @see ConfigurableApplicationContext#getBeanFactory()
|
||||
|
||||
@@ -25,7 +25,7 @@ package org.springframework.context;
|
||||
* <p>Can be implemented by both components (typically a Spring bean defined in a
|
||||
* Spring context) and containers (typically a Spring {@link ApplicationContext}
|
||||
* itself). Containers will propagate start/stop signals to all components that
|
||||
* apply within each container, e.g. for a stop/restart scenario at runtime.
|
||||
* apply within each container, for example, for a stop/restart scenario at runtime.
|
||||
*
|
||||
* <p>Can be used for direct invocations or for management operations via JMX.
|
||||
* In the latter case, the {@link org.springframework.jmx.export.MBeanExporter}
|
||||
|
||||
@@ -26,12 +26,12 @@ package org.springframework.context;
|
||||
public interface LifecycleProcessor extends Lifecycle {
|
||||
|
||||
/**
|
||||
* Notification of context refresh, e.g. for auto-starting components.
|
||||
* Notification of context refresh, for example, for auto-starting components.
|
||||
*/
|
||||
void onRefresh();
|
||||
|
||||
/**
|
||||
* Notification of context close phase, e.g. for auto-stopping components.
|
||||
* Notification of context close phase, for example, for auto-stopping components.
|
||||
*/
|
||||
void onClose();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface MessageSource {
|
||||
|
||||
/**
|
||||
* Try to resolve the message. Return default message if no message was found.
|
||||
* @param code the message code to look up, e.g. 'calculator.noRateSet'.
|
||||
* @param code the message code to look up, for example, 'calculator.noRateSet'.
|
||||
* MessageSource users are encouraged to base message names on qualified class
|
||||
* or package names, avoiding potential conflicts and ensuring maximum clarity.
|
||||
* @param args an array of arguments that will be filled in for params within
|
||||
@@ -59,7 +59,7 @@ public interface MessageSource {
|
||||
|
||||
/**
|
||||
* Try to resolve the message. Treat as an error if the message can't be found.
|
||||
* @param code the message code to look up, e.g. 'calculator.noRateSet'.
|
||||
* @param code the message code to look up, for example, 'calculator.noRateSet'.
|
||||
* MessageSource users are encouraged to base message names on qualified class
|
||||
* or package names, avoiding potential conflicts and ensuring maximum clarity.
|
||||
* @param args an array of arguments that will be filled in for params within
|
||||
|
||||
@@ -56,7 +56,7 @@ public class PayloadApplicationEvent<T> extends ApplicationEvent implements Reso
|
||||
* @param source the object on which the event initially occurred (never {@code null})
|
||||
* @param payload the payload object (never {@code null})
|
||||
* @param payloadType the type object of payload object (can be {@code null}).
|
||||
* Note that this is meant to indicate the payload type (e.g. {@code String}),
|
||||
* Note that this is meant to indicate the payload type (for example, {@code String}),
|
||||
* not the full event type (such as {@code PayloadApplicationEvent<<String>}).
|
||||
* @since 6.0
|
||||
*/
|
||||
|
||||
@@ -73,7 +73,7 @@ public interface SmartLifecycle extends Lifecycle, Phased {
|
||||
* {@code SmartLifecycle} beans into a later startup phase and an earlier
|
||||
* shutdown phase.
|
||||
* <p>Note that certain {@code SmartLifecycle} components come with a different
|
||||
* default phase: e.g. executors/schedulers with {@code Integer.MAX_VALUE / 2}.
|
||||
* default phase: for example, executors/schedulers with {@code Integer.MAX_VALUE / 2}.
|
||||
* @since 5.1
|
||||
* @see #getPhase()
|
||||
* @see org.springframework.scheduling.concurrent.ExecutorConfigurationSupport#DEFAULT_PHASE
|
||||
|
||||
@@ -60,7 +60,7 @@ public class AnnotatedBeanDefinitionReader {
|
||||
|
||||
/**
|
||||
* Create a new {@code AnnotatedBeanDefinitionReader} for the given registry.
|
||||
* <p>If the registry is {@link EnvironmentCapable}, e.g. is an {@code ApplicationContext},
|
||||
* <p>If the registry is {@link EnvironmentCapable}, for example, is an {@code ApplicationContext},
|
||||
* the {@link Environment} will be inherited, otherwise a new
|
||||
* {@link StandardEnvironment} will be created and used.
|
||||
* @param registry the {@code BeanFactory} to load bean definitions into,
|
||||
@@ -130,7 +130,7 @@ public class AnnotatedBeanDefinitionReader {
|
||||
* <p>Calls to {@code register} are idempotent; adding the same
|
||||
* component class more than once has no additional effect.
|
||||
* @param componentClasses one or more component classes,
|
||||
* e.g. {@link Configuration @Configuration} classes
|
||||
* for example, {@link Configuration @Configuration} classes
|
||||
*/
|
||||
public void register(Class<?>... componentClasses) {
|
||||
for (Class<?> componentClass : componentClasses) {
|
||||
@@ -224,7 +224,7 @@ public class AnnotatedBeanDefinitionReader {
|
||||
* @param supplier a callback for creating an instance of the bean
|
||||
* (may be {@code null})
|
||||
* @param customizers one or more callbacks for customizing the factory's
|
||||
* {@link BeanDefinition}, e.g. setting a lazy-init or primary flag
|
||||
* {@link BeanDefinition}, for example, setting a lazy-init or primary flag
|
||||
* @since 5.2
|
||||
*/
|
||||
public <T> void registerBean(Class<T> beanClass, @Nullable String name, @Nullable Supplier<T> supplier,
|
||||
@@ -243,7 +243,7 @@ public class AnnotatedBeanDefinitionReader {
|
||||
* @param supplier a callback for creating an instance of the bean
|
||||
* (may be {@code null})
|
||||
* @param customizers one or more callbacks for customizing the factory's
|
||||
* {@link BeanDefinition}, e.g. setting a lazy-init or primary flag
|
||||
* {@link BeanDefinition}, for example, setting a lazy-init or primary flag
|
||||
* @since 5.0
|
||||
*/
|
||||
private <T> void doRegisterBean(Class<T> beanClass, @Nullable String name,
|
||||
|
||||
@@ -241,7 +241,7 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator {
|
||||
/**
|
||||
* Derive a default bean name from the given bean definition.
|
||||
* <p>The default implementation simply builds a decapitalized version
|
||||
* of the short class name: e.g. "mypackage.MyJdbcDao" → "myJdbcDao".
|
||||
* of the short class name: for example, "mypackage.MyJdbcDao" → "myJdbcDao".
|
||||
* <p>Note that inner classes will thus have names of the form
|
||||
* "outerClassName.InnerClassName", which because of the period in the
|
||||
* name may be an issue if you are autowiring by name.
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface AnnotationConfigRegistry {
|
||||
* <p>Calls to {@code register} are idempotent; adding the same
|
||||
* component class more than once has no additional effect.
|
||||
* @param componentClasses one or more component classes,
|
||||
* e.g. {@link Configuration @Configuration} classes
|
||||
* for example, {@link Configuration @Configuration} classes
|
||||
*/
|
||||
void register(Class<?>... componentClasses);
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ public @interface Bean {
|
||||
* method (i.e., detection occurs reflectively against the bean instance itself at
|
||||
* creation time).
|
||||
* <p>To disable destroy method inference for a particular {@code @Bean}, specify an
|
||||
* empty string as the value, e.g. {@code @Bean(destroyMethod="")}. Note that the
|
||||
* empty string as the value, for example, {@code @Bean(destroyMethod="")}. Note that the
|
||||
* {@link org.springframework.beans.factory.DisposableBean} callback interface will
|
||||
* nevertheless get detected and the corresponding destroy method invoked: In other
|
||||
* words, {@code destroyMethod=""} only affects custom close/shutdown methods and
|
||||
|
||||
@@ -312,7 +312,7 @@ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateCo
|
||||
|
||||
/**
|
||||
* Register the specified bean with the given registry.
|
||||
* <p>Can be overridden in subclasses, e.g. to adapt the registration
|
||||
* <p>Can be overridden in subclasses, for example, to adapt the registration
|
||||
* process or to register further bean definitions for each scanned bean.
|
||||
* @param definitionHolder the bean definition plus bean name for the bean
|
||||
* @param registry the BeanDefinitionRegistry to register the bean with
|
||||
|
||||
@@ -81,7 +81,7 @@ import org.springframework.util.StringValueResolver;
|
||||
* {@link org.springframework.beans.factory.config.BeanPostProcessor} implementation
|
||||
* that supports common Java annotations out of the box, in particular the common
|
||||
* annotations in the {@code jakarta.annotation} package. These common Java
|
||||
* annotations are supported in many Jakarta EE technologies (e.g. JSF and JAX-RS).
|
||||
* annotations are supported in many Jakarta EE technologies (for example, JSF and JAX-RS).
|
||||
*
|
||||
* <p>This post-processor includes support for the {@link jakarta.annotation.PostConstruct}
|
||||
* and {@link jakarta.annotation.PreDestroy} annotations - as init annotation
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.core.type.filter.TypeFilter;
|
||||
* <p>Note that the {@code <context:component-scan>} element has an
|
||||
* {@code annotation-config} attribute; however, this annotation does not. This is because
|
||||
* in almost all cases when using {@code @ComponentScan}, default annotation config
|
||||
* processing (e.g. processing {@code @Autowired} and friends) is assumed. Furthermore,
|
||||
* processing (for example, processing {@code @Autowired} and friends) is assumed. Furthermore,
|
||||
* when using {@link AnnotationConfigApplicationContext}, annotation config processors are
|
||||
* always registered, meaning that any attempt to disable them at the
|
||||
* {@code @ComponentScan} level would be ignored.
|
||||
@@ -103,7 +103,7 @@ public @interface ComponentScan {
|
||||
* within the Spring container.
|
||||
* <p>The default value of the {@link BeanNameGenerator} interface itself indicates
|
||||
* that the scanner used to process this {@code @ComponentScan} annotation should
|
||||
* use its inherited bean name generator, e.g. the default
|
||||
* use its inherited bean name generator, for example, the default
|
||||
* {@link AnnotationBeanNameGenerator} or any custom instance supplied to the
|
||||
* application context at bootstrap time.
|
||||
* @see AnnotationConfigApplicationContext#setBeanNameGenerator(BeanNameGenerator)
|
||||
|
||||
@@ -443,14 +443,14 @@ public @interface Configuration {
|
||||
|
||||
/**
|
||||
* Specify whether {@code @Bean} methods should get proxied in order to enforce
|
||||
* bean lifecycle behavior, e.g. to return shared singleton bean instances even
|
||||
* bean lifecycle behavior, for example, to return shared singleton bean instances even
|
||||
* in case of direct {@code @Bean} method calls in user code. This feature
|
||||
* requires method interception, implemented through a runtime-generated CGLIB
|
||||
* subclass which comes with limitations such as the configuration class and
|
||||
* its methods not being allowed to declare {@code final}.
|
||||
* <p>The default is {@code true}, allowing for 'inter-bean references' via direct
|
||||
* method calls within the configuration class as well as for external calls to
|
||||
* this configuration's {@code @Bean} methods, e.g. from another configuration class.
|
||||
* this configuration's {@code @Bean} methods, for example, from another configuration class.
|
||||
* If this is not needed since each of this particular configuration's {@code @Bean}
|
||||
* methods is self-contained and designed as a plain factory method for container use,
|
||||
* switch this flag to {@code false} in order to avoid CGLIB subclass processing.
|
||||
|
||||
@@ -201,7 +201,7 @@ class ConfigurationClassBeanDefinitionReader {
|
||||
this.registry.registerAlias(beanName, alias);
|
||||
}
|
||||
|
||||
// Has this effectively been overridden before (e.g. via XML)?
|
||||
// Has this effectively been overridden before (for example, via XML)?
|
||||
if (isOverriddenByExistingDefinition(beanMethod, beanName)) {
|
||||
if (beanName.equals(beanMethod.getConfigurationClass().getBeanName())) {
|
||||
throw new BeanDefinitionStoreException(beanMethod.getConfigurationClass().getResource().getDescription(),
|
||||
|
||||
@@ -102,7 +102,7 @@ class ConfigurationClassEnhancer {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(String.format("Ignoring request to enhance %s as it has " +
|
||||
"already been enhanced. This usually indicates that more than one " +
|
||||
"ConfigurationClassPostProcessor has been registered (e.g. via " +
|
||||
"ConfigurationClassPostProcessor has been registered (for example, via " +
|
||||
"<context:annotation-config>). This is harmless, but you may " +
|
||||
"want check your configuration and remove one CCPP if possible",
|
||||
configClass.getName()));
|
||||
@@ -164,7 +164,7 @@ class ConfigurationClassEnhancer {
|
||||
/**
|
||||
* Marker interface to be implemented by all @Configuration CGLIB subclasses.
|
||||
* Facilitates idempotent behavior for {@link ConfigurationClassEnhancer#enhance}
|
||||
* through checking to see if candidate classes are already assignable to it, e.g.
|
||||
* through checking to see if candidate classes are already assignable to it, for example,
|
||||
* have already been enhanced.
|
||||
* <p>Also extends {@link BeanFactoryAware}, as all enhanced {@code @Configuration}
|
||||
* classes require access to the {@link BeanFactory} that created them.
|
||||
|
||||
@@ -229,7 +229,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
|
||||
* class names instead of standard component overriding).
|
||||
* <p>Note that this strategy does <em>not</em> apply to {@link Bean} methods.
|
||||
* <p>This setter is typically only appropriate when configuring the post-processor as a
|
||||
* standalone bean definition in XML, e.g. not using the dedicated {@code AnnotationConfig*}
|
||||
* standalone bean definition in XML, for example, not using the dedicated {@code AnnotationConfig*}
|
||||
* application contexts or the {@code <context:annotation-config>} element. Any bean name
|
||||
* generator specified against the application context will take precedence over any set here.
|
||||
* @since 3.1.1
|
||||
|
||||
@@ -103,7 +103,7 @@ import java.lang.annotation.Target;
|
||||
*
|
||||
* <b>Note: {@code @EnableAspectJAutoProxy} applies to its local application context only,
|
||||
* allowing for selective proxying of beans at different levels.</b> Please redeclare
|
||||
* {@code @EnableAspectJAutoProxy} in each individual context, e.g. the common root web
|
||||
* {@code @EnableAspectJAutoProxy} in each individual context, for example, the common root web
|
||||
* application context and any separate {@code DispatcherServlet} application contexts,
|
||||
* if you need to apply its behavior at multiple levels.
|
||||
*
|
||||
|
||||
@@ -92,7 +92,7 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
|
||||
* </pre>
|
||||
*
|
||||
* <p>The code example differs from the XML example in that it actually instantiates the
|
||||
* {@code MyLoadTimeWeaver} type, meaning that it can also configure the instance, e.g.
|
||||
* {@code MyLoadTimeWeaver} type, meaning that it can also configure the instance, for example,
|
||||
* calling the {@code #addClassTransformer} method. This demonstrates how the code-based
|
||||
* configuration approach is more flexible through direct programmatic access.
|
||||
*
|
||||
|
||||
@@ -73,7 +73,7 @@ public class Jsr330ScopeMetadataResolver implements ScopeMetadataResolver {
|
||||
/**
|
||||
* Resolve the given annotation type into a named Spring scope.
|
||||
* <p>The default implementation simply checks against registered scopes.
|
||||
* Can be overridden for custom mapping rules, e.g. naming conventions.
|
||||
* Can be overridden for custom mapping rules, for example, naming conventions.
|
||||
* @param annotationType the JSR-330 annotation type
|
||||
* @return the Spring scope name
|
||||
*/
|
||||
|
||||
@@ -34,8 +34,8 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Common delegate code for the handling of parser strategies, e.g.
|
||||
* {@code TypeFilter}, {@code ImportSelector}, {@code ImportBeanDefinitionRegistrar}
|
||||
* Common delegate code for the handling of parser strategies, for example,
|
||||
* {@code TypeFilter}, {@code ImportSelector}, {@code ImportBeanDefinitionRegistrar}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Phillip Webb
|
||||
|
||||
@@ -63,7 +63,7 @@ import org.springframework.core.env.Profiles;
|
||||
* details about supported formats.
|
||||
*
|
||||
* <p>This is analogous to the behavior in Spring XML: if the {@code profile} attribute of
|
||||
* the {@code beans} element is supplied e.g., {@code <beans profile="p1,p2">}, the
|
||||
* the {@code beans} element is supplied, for example, {@code <beans profile="p1,p2">}, the
|
||||
* {@code beans} element will not be parsed unless at least profile 'p1' or 'p2' has been
|
||||
* activated. Likewise, if a {@code @Component} or {@code @Configuration} class is marked
|
||||
* with {@code @Profile({"p1", "p2"})}, that class will not be registered or processed unless
|
||||
|
||||
@@ -222,7 +222,7 @@ public @interface PropertySource {
|
||||
boolean ignoreResourceNotFound() default false;
|
||||
|
||||
/**
|
||||
* A specific character encoding for the given resources, e.g. "UTF-8".
|
||||
* A specific character encoding for the given resources, for example, "UTF-8".
|
||||
* @since 4.3
|
||||
*/
|
||||
String encoding() default "";
|
||||
|
||||
@@ -298,7 +298,7 @@ public abstract class AbstractApplicationEventMulticaster
|
||||
else {
|
||||
// Remove non-matching listeners that originally came from
|
||||
// ApplicationListenerDetector, possibly ruled out by additional
|
||||
// BeanDefinition metadata (e.g. factory method generics) above.
|
||||
// BeanDefinition metadata (for example, factory method generics) above.
|
||||
Object listener = beanFactory.getSingleton(listenerBeanName);
|
||||
if (retriever != null) {
|
||||
filteredListeners.remove(listener);
|
||||
|
||||
@@ -73,12 +73,12 @@ public interface ApplicationEventMulticaster {
|
||||
/**
|
||||
* Remove all matching listeners from the set of registered
|
||||
* {@code ApplicationListener} instances (which includes adapter classes
|
||||
* such as {@link ApplicationListenerMethodAdapter}, e.g. for annotated
|
||||
* such as {@link ApplicationListenerMethodAdapter}, for example, for annotated
|
||||
* {@link EventListener} methods).
|
||||
* <p>Note: This just applies to instance registrations, not to listeners
|
||||
* registered by bean name.
|
||||
* @param predicate the predicate to identify listener instances to remove,
|
||||
* e.g. checking {@link SmartApplicationListener#getListenerId()}
|
||||
* for example, checking {@link SmartApplicationListener#getListenerId()}
|
||||
* @since 5.3.5
|
||||
* @see #addApplicationListener(ApplicationListener)
|
||||
* @see #removeApplicationListener(ApplicationListener)
|
||||
|
||||
@@ -455,7 +455,7 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe
|
||||
String msg = "The event listener method class '" + methodDeclaringClass.getName() +
|
||||
"' is not an instance of the actual bean class '" +
|
||||
targetBeanClass.getName() + "'. If the bean requires proxying " +
|
||||
"(e.g. due to @Transactional), please use class-based proxying.";
|
||||
"(for example, due to @Transactional), please use class-based proxying.";
|
||||
throw new IllegalStateException(getInvocationErrorMessage(targetBean, msg, args));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public @interface EventListener {
|
||||
|
||||
/**
|
||||
* An optional identifier for the listener, defaulting to the fully-qualified
|
||||
* signature of the declaring method (e.g. "mypackage.MyClass.myMethod()").
|
||||
* signature of the declaring method (for example, "mypackage.MyClass.myMethod()").
|
||||
* @since 5.3.5
|
||||
* @see SmartApplicationListener#getListenerId()
|
||||
* @see ApplicationEventMulticaster#removeApplicationListeners(Predicate)
|
||||
|
||||
@@ -86,7 +86,7 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM
|
||||
* unless the TaskExecutor explicitly supports this.
|
||||
* <p>{@link ApplicationListener} instances which declare no support for asynchronous
|
||||
* execution ({@link ApplicationListener#supportsAsyncExecution()} always run within
|
||||
* the original thread which published the event, e.g. the transaction-synchronized
|
||||
* the original thread which published the event, for example, the transaction-synchronized
|
||||
* {@link org.springframework.transaction.event.TransactionalApplicationListener}.
|
||||
* @since 2.0
|
||||
* @see org.springframework.core.task.SyncTaskExecutor
|
||||
@@ -117,7 +117,7 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM
|
||||
* and logs exceptions (a la
|
||||
* {@link org.springframework.scheduling.support.TaskUtils#LOG_AND_SUPPRESS_ERROR_HANDLER})
|
||||
* or an implementation that logs exceptions while nevertheless propagating them
|
||||
* (e.g. {@link org.springframework.scheduling.support.TaskUtils#LOG_AND_PROPAGATE_ERROR_HANDLER}).
|
||||
* (for example, {@link org.springframework.scheduling.support.TaskUtils#LOG_AND_PROPAGATE_ERROR_HANDLER}).
|
||||
* @since 4.1
|
||||
*/
|
||||
public void setErrorHandler(@Nullable ErrorHandler errorHandler) {
|
||||
|
||||
@@ -118,7 +118,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* {@link org.springframework.core.io.DefaultResourceLoader}.
|
||||
* Consequently treats non-URL resource paths as class path resources
|
||||
* (supporting full class path resource names that include the package path,
|
||||
* e.g. "mypackage/myresource.dat"), unless the {@link #getResourceByPath}
|
||||
* for example, "mypackage/myresource.dat"), unless the {@link #getResourceByPath}
|
||||
* method is overridden in a subclass.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
@@ -791,7 +791,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(beanFactory, getBeanFactoryPostProcessors());
|
||||
|
||||
// Detect a LoadTimeWeaver and prepare for weaving, if found in the meantime
|
||||
// (e.g. through an @Bean method registered by ConfigurationClassPostProcessor)
|
||||
// (for example, through an @Bean method registered by ConfigurationClassPostProcessor)
|
||||
if (!NativeDetector.inNativeImage() && beanFactory.getTempClassLoader() == null &&
|
||||
beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
|
||||
beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));
|
||||
@@ -1083,7 +1083,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
|
||||
/**
|
||||
* Determine whether an active startup/shutdown thread is currently stuck,
|
||||
* e.g. through a {@code System.exit} call in a user component.
|
||||
* for example, through a {@code System.exit} call in a user component.
|
||||
*/
|
||||
private boolean isStartupShutdownThreadStuck() {
|
||||
Thread activeThread = this.startupShutdownThread;
|
||||
|
||||
@@ -87,7 +87,7 @@ public abstract class AbstractMessageSource extends MessageSourceSupport impleme
|
||||
/**
|
||||
* Specify locale-independent common messages, with the message code as key
|
||||
* and the full message String (may contain argument placeholders) as value.
|
||||
* <p>May also link to an externally defined Properties object, e.g. defined
|
||||
* <p>May also link to an externally defined Properties object, for example, defined
|
||||
* through a {@link org.springframework.beans.factory.config.PropertiesFactoryBean}.
|
||||
*/
|
||||
public void setCommonMessages(@Nullable Properties commonMessages) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public abstract class AbstractResourceBasedMessageSource extends AbstractMessage
|
||||
* Set a single basename, following the basic ResourceBundle convention
|
||||
* of not specifying file extension or language codes. The resource location
|
||||
* format is up to the specific {@code MessageSource} implementation.
|
||||
* <p>Regular and XMl properties files are supported: e.g. "messages" will find
|
||||
* <p>Regular and XMl properties files are supported: for example, "messages" will find
|
||||
* a "messages.properties", "messages_en.properties" etc arrangement as well
|
||||
* as "messages.xml", "messages_en.xml" etc.
|
||||
* @param basename the single basename
|
||||
@@ -70,7 +70,7 @@ public abstract class AbstractResourceBasedMessageSource extends AbstractMessage
|
||||
* Set an array of basenames, each following the basic ResourceBundle convention
|
||||
* of not specifying file extension or language codes. The resource location
|
||||
* format is up to the specific {@code MessageSource} implementation.
|
||||
* <p>Regular and XMl properties files are supported: e.g. "messages" will find
|
||||
* <p>Regular and XMl properties files are supported: for example, "messages" will find
|
||||
* a "messages.properties", "messages_en.properties" etc arrangement as well
|
||||
* as "messages.xml", "messages_en.xml" etc.
|
||||
* <p>The associated resource bundles will be checked sequentially when resolving
|
||||
@@ -142,7 +142,7 @@ public abstract class AbstractResourceBasedMessageSource extends AbstractMessage
|
||||
/**
|
||||
* Set whether to fall back to the system Locale if no files for a specific
|
||||
* Locale have been found. Default is "true"; if this is turned off, the only
|
||||
* fallback will be the default file (e.g. "messages.properties" for
|
||||
* fallback will be the default file (for example, "messages.properties" for
|
||||
* basename "messages").
|
||||
* <p>Falling back to the system Locale is the default behavior of
|
||||
* {@code java.util.ResourceBundle}. However, this is often not desirable
|
||||
|
||||
@@ -98,7 +98,7 @@ public abstract class AbstractXmlApplicationContext extends AbstractRefreshableC
|
||||
/**
|
||||
* Initialize the bean definition reader used for loading the bean definitions
|
||||
* of this context. The default implementation sets the validating flag.
|
||||
* <p>Can be overridden in subclasses, e.g. for turning off XML validation
|
||||
* <p>Can be overridden in subclasses, for example, for turning off XML validation
|
||||
* or using a different {@link BeanDefinitionDocumentReader} implementation.
|
||||
* @param reader the bean definition reader used by this context
|
||||
* @see XmlBeanDefinitionReader#setValidating
|
||||
|
||||
@@ -28,13 +28,13 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Convenient superclass for application objects that want to be aware of
|
||||
* the application context, e.g. for custom lookup of collaborating beans
|
||||
* the application context, for example, for custom lookup of collaborating beans
|
||||
* or for context-specific resource access. It saves the application
|
||||
* context reference and provides an initialization callback method.
|
||||
* Furthermore, it offers numerous convenience methods for message lookup.
|
||||
*
|
||||
* <p>There is no requirement to subclass this class: It just makes things
|
||||
* a little easier if you need access to the context, e.g. for access to
|
||||
* a little easier if you need access to the context, for example, for access to
|
||||
* file resources or to the message source. Note that many application
|
||||
* objects do not need to be aware of the application context at all,
|
||||
* as they can receive collaborating beans via bean references.
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.util.Assert;
|
||||
/**
|
||||
* Standalone XML application context, taking the context definition files
|
||||
* from the class path, interpreting plain paths as class path resource names
|
||||
* that include the package path (e.g. "mypackage/myresource.txt"). Useful for
|
||||
* that include the package path (for example, "mypackage/myresource.txt"). Useful for
|
||||
* test harnesses as well as for application contexts embedded within JARs.
|
||||
*
|
||||
* <p>The config location defaults can be overridden via {@link #getConfigLocations},
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.lang.Nullable;
|
||||
/**
|
||||
* Standalone XML application context, taking the context definition files
|
||||
* from the file system or from URLs, interpreting plain paths as relative
|
||||
* file system locations (e.g. "mydir/myfile.txt"). Useful for test harnesses
|
||||
* file system locations (for example, "mydir/myfile.txt"). Useful for test harnesses
|
||||
* as well as for standalone environments.
|
||||
*
|
||||
* <p><b>NOTE:</b> Plain paths will always be interpreted as relative
|
||||
|
||||
@@ -510,7 +510,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem
|
||||
* @param beanClass the class of the bean (resolving a public constructor
|
||||
* to be autowired, possibly simply the default constructor)
|
||||
* @param customizers one or more callbacks for customizing the factory's
|
||||
* {@link BeanDefinition}, e.g. setting a lazy-init or primary flag
|
||||
* {@link BeanDefinition}, for example, setting a lazy-init or primary flag
|
||||
* @since 5.0
|
||||
* @see #registerBean(String, Class, Supplier, BeanDefinitionCustomizer...)
|
||||
*/
|
||||
@@ -525,7 +525,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem
|
||||
* @param beanClass the class of the bean (resolving a public constructor
|
||||
* to be autowired, possibly simply the default constructor)
|
||||
* @param customizers one or more callbacks for customizing the factory's
|
||||
* {@link BeanDefinition}, e.g. setting a lazy-init or primary flag
|
||||
* {@link BeanDefinition}, for example, setting a lazy-init or primary flag
|
||||
* @since 5.0
|
||||
* @see #registerBean(String, Class, Supplier, BeanDefinitionCustomizer...)
|
||||
*/
|
||||
@@ -543,7 +543,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem
|
||||
* @param beanClass the class of the bean
|
||||
* @param supplier a callback for creating an instance of the bean
|
||||
* @param customizers one or more callbacks for customizing the factory's
|
||||
* {@link BeanDefinition}, e.g. setting a lazy-init or primary flag
|
||||
* {@link BeanDefinition}, for example, setting a lazy-init or primary flag
|
||||
* @since 5.0
|
||||
* @see #registerBean(String, Class, Supplier, BeanDefinitionCustomizer...)
|
||||
*/
|
||||
@@ -565,7 +565,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem
|
||||
* @param supplier a callback for creating an instance of the bean (in case
|
||||
* of {@code null}, resolving a public constructor to be autowired instead)
|
||||
* @param customizers one or more callbacks for customizing the factory's
|
||||
* {@link BeanDefinition}, e.g. setting a lazy-init or primary flag
|
||||
* {@link BeanDefinition}, for example, setting a lazy-init or primary flag
|
||||
* @since 5.0
|
||||
*/
|
||||
public <T> void registerBean(@Nullable String beanName, Class<T> beanClass,
|
||||
|
||||
@@ -66,7 +66,7 @@ import org.springframework.lang.Nullable;
|
||||
* </pre>
|
||||
*
|
||||
* <p>Alternatively, load a Groovy bean definition script like the following
|
||||
* from an external resource (e.g. an "applicationContext.groovy" file):
|
||||
* from an external resource (for example, an "applicationContext.groovy" file):
|
||||
*
|
||||
* <pre class="code">
|
||||
* import org.hibernate.SessionFactory
|
||||
|
||||
@@ -170,7 +170,7 @@ public class MessageSourceAccessor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance)
|
||||
* Retrieve the given MessageSourceResolvable (for example, an ObjectError instance)
|
||||
* in the default Locale.
|
||||
* @param resolvable the MessageSourceResolvable
|
||||
* @return the message
|
||||
@@ -181,7 +181,7 @@ public class MessageSourceAccessor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance)
|
||||
* Retrieve the given MessageSourceResolvable (for example, an ObjectError instance)
|
||||
* in the given Locale.
|
||||
* @param resolvable the MessageSourceResolvable
|
||||
* @param locale the Locale in which to do lookup
|
||||
|
||||
@@ -204,7 +204,7 @@ final class PostProcessorRegistrationDelegate {
|
||||
invokeBeanFactoryPostProcessors(nonOrderedPostProcessors, beanFactory);
|
||||
|
||||
// Clear cached merged bean definitions since the post-processors might have
|
||||
// modified the original metadata, e.g. replacing placeholders in values...
|
||||
// modified the original metadata, for example, replacing placeholders in values...
|
||||
beanFactory.clearMetadataCache();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.util.StringValueResolver;
|
||||
* {@code PropertyPlaceholderConfigurer} to ensure backward compatibility. See the spring-context
|
||||
* XSD documentation for complete details.
|
||||
*
|
||||
* <p>Any local properties (e.g. those added via {@link #setProperties}, {@link #setLocations}
|
||||
* <p>Any local properties (for example, those added via {@link #setProperties}, {@link #setLocations}
|
||||
* et al.) are added as a {@code PropertySource}. Search precedence of local properties is
|
||||
* based on the value of the {@link #setLocalOverride localOverride} property, which is by
|
||||
* default {@code false} meaning that local properties are to be searched last, after all
|
||||
|
||||
@@ -63,7 +63,7 @@ import org.springframework.util.StringUtils;
|
||||
* other than "-1" (caching forever) might not work reliably in this case.
|
||||
*
|
||||
* <p>For a typical web application, message files could be placed in {@code WEB-INF}:
|
||||
* e.g. a "WEB-INF/messages" basename would find a "WEB-INF/messages.properties",
|
||||
* for example, a "WEB-INF/messages" basename would find a "WEB-INF/messages.properties",
|
||||
* "WEB-INF/messages_en.properties" etc arrangement as well as "WEB-INF/messages.xml",
|
||||
* "WEB-INF/messages_en.xml" etc. Note that message definitions in a <i>previous</i>
|
||||
* resource bundle will override ones in a later bundle, due to sequential lookup.
|
||||
@@ -137,7 +137,7 @@ public class ReloadableResourceBundleMessageSource extends AbstractResourceBased
|
||||
* <p>Only applies to classic properties files, not to XML files.
|
||||
* @param fileEncodings a Properties with filenames as keys and charset
|
||||
* names as values. Filenames have to match the basename syntax,
|
||||
* with optional locale-specific components: e.g. "WEB-INF/messages"
|
||||
* with optional locale-specific components: for example, "WEB-INF/messages"
|
||||
* or "WEB-INF/messages_en".
|
||||
* @see #setBasenames
|
||||
* @see org.springframework.util.PropertiesPersister#load
|
||||
|
||||
@@ -99,7 +99,7 @@ public @interface DateTimeFormat {
|
||||
* a style or ISO format.
|
||||
* <p>Note: This pattern follows the original {@link java.text.SimpleDateFormat} style,
|
||||
* as also supported by Joda-Time, with strict parsing semantics towards overflows
|
||||
* (e.g. rejecting a Feb 29 value for a non-leap-year). As a consequence, 'yy'
|
||||
* (for example, rejecting a Feb 29 value for a non-leap-year). As a consequence, 'yy'
|
||||
* characters indicate a year in the traditional style, not a "year-of-era" as in the
|
||||
* {@link java.time.format.DateTimeFormatter} specification (i.e. 'yy' turns into 'uu'
|
||||
* when going through a {@code DateTimeFormatter} with strict resolution mode).
|
||||
|
||||
@@ -74,7 +74,7 @@ public @interface NumberFormat {
|
||||
|
||||
/**
|
||||
* The default format for the annotated type: typically 'number' but possibly
|
||||
* 'currency' for a money type (e.g. {@code javax.money.MonetaryAmount}).
|
||||
* 'currency' for a money type (for example, {@code javax.money.MonetaryAmount}).
|
||||
* @since 4.2
|
||||
*/
|
||||
DEFAULT,
|
||||
|
||||
@@ -39,7 +39,7 @@ abstract class DateTimeFormatterUtils {
|
||||
*/
|
||||
static DateTimeFormatter createStrictDateTimeFormatter(String pattern) {
|
||||
// Using strict resolution to align with Joda-Time and standard DateFormat behavior:
|
||||
// otherwise, an overflow like e.g. Feb 29 for a non-leap-year wouldn't get rejected.
|
||||
// otherwise, an overflow like, for example, Feb 29 for a non-leap-year wouldn't get rejected.
|
||||
// However, with strict resolution, a year digit needs to be specified as 'u'...
|
||||
String patternToUse = StringUtils.replace(pattern, "yy", "uu");
|
||||
return DateTimeFormatter.ofPattern(patternToUse).withResolverStyle(ResolverStyle.STRICT);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DurationFormatter implements Formatter<Duration> {
|
||||
|
||||
/**
|
||||
* Create a {@code DurationFormatter} in a specific {@link DurationFormat.Style}.
|
||||
* <p>When a unit is needed but cannot be determined (e.g. printing a Duration in the
|
||||
* <p>When a unit is needed but cannot be determined (for example, printing a Duration in the
|
||||
* {@code SIMPLE} style), {@code DurationFormat.Unit#MILLIS} is used.
|
||||
*/
|
||||
public DurationFormatter(DurationFormat.Style style) {
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.util.ClassUtils;
|
||||
* follows where <code>spring-instrument-{version}.jar</code> is a JAR file
|
||||
* containing the {@link InstrumentationSavingAgent} class shipped with Spring
|
||||
* and where <code>{version}</code> is the release version of the Spring
|
||||
* Framework (e.g., {@code 5.1.5.RELEASE}).
|
||||
* Framework (for example, {@code 5.1.5.RELEASE}).
|
||||
*
|
||||
* <p><code>-javaagent:path/to/spring-instrument-{version}.jar</code>
|
||||
*
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* web application). There is no direct API dependency between this LoadTimeWeaver
|
||||
* adapter and the underlying ClassLoader, just a 'loose' method contract.
|
||||
*
|
||||
* <p>This is the LoadTimeWeaver to use e.g. with the Resin application server
|
||||
* <p>This is the LoadTimeWeaver to use, for example, with the Resin application server
|
||||
* version 3.1+.
|
||||
*
|
||||
* @author Costin Leau
|
||||
|
||||
@@ -266,7 +266,7 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean
|
||||
|
||||
/**
|
||||
* Set the ParameterNameDiscoverer to use for resolving method parameter
|
||||
* names if needed (e.g. for parameter names of MBean operation methods).
|
||||
* names if needed (for example, for parameter names of MBean operation methods).
|
||||
* <p>Default is a {@link DefaultParameterNameDiscoverer}.
|
||||
*/
|
||||
public void setParameterNameDiscoverer(@Nullable ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
|
||||
@@ -82,7 +82,7 @@ public class KeyNamingStrategy implements ObjectNamingStrategy, InitializingBean
|
||||
|
||||
|
||||
/**
|
||||
* Set local properties, containing object name mappings, e.g. via
|
||||
* Set local properties, containing object name mappings, for example, via
|
||||
* the "props" tag in XML bean definitions. These can be considered
|
||||
* defaults, to be overridden by properties loaded from files.
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ public class JndiLocatorDelegate extends JndiLocatorSupport {
|
||||
/**
|
||||
* System property that instructs Spring to ignore a default JNDI environment, i.e.
|
||||
* to always return {@code false} from {@link #isDefaultJndiEnvironmentAvailable()}.
|
||||
* <p>The default is "false", allowing for regular default JNDI access e.g. in
|
||||
* <p>The default is "false", allowing for regular default JNDI access, for example, in
|
||||
* {@link JndiPropertySource}. Switching this flag to {@code true} is an optimization
|
||||
* for scenarios where nothing is ever to be found for such JNDI fallback searches
|
||||
* to begin with, avoiding the repeated JNDI lookup overhead.
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
||||
* by Jakarta EE applications when accessing a locally mapped (ENC - Environmental
|
||||
* Naming Context) resource. If it doesn't, the "java:comp/env/" prefix will
|
||||
* be prepended if the "resourceRef" property is true (the default is
|
||||
* <strong>false</strong>) and no other scheme (e.g. "java:") is given.
|
||||
* <strong>false</strong>) and no other scheme (for example, "java:") is given.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.1
|
||||
@@ -51,7 +51,7 @@ public abstract class JndiLocatorSupport extends JndiAccessor {
|
||||
* Set whether the lookup occurs in a Jakarta EE container, i.e. if the prefix
|
||||
* "java:comp/env/" needs to be added if the JNDI name doesn't already
|
||||
* contain it. Default is "false".
|
||||
* <p>Note: Will only get applied if no other scheme (e.g. "java:") is given.
|
||||
* <p>Note: Will only get applied if no other scheme (for example, "java:") is given.
|
||||
*/
|
||||
public void setResourceRef(boolean resourceRef) {
|
||||
this.resourceRef = resourceRef;
|
||||
@@ -117,7 +117,7 @@ public abstract class JndiLocatorSupport extends JndiAccessor {
|
||||
/**
|
||||
* Convert the given JNDI name into the actual JNDI name to use.
|
||||
* <p>The default implementation applies the "java:comp/env/" prefix if
|
||||
* "resourceRef" is "true" and no other scheme (e.g. "java:") is given.
|
||||
* "resourceRef" is "true" and no other scheme (for example, "java:") is given.
|
||||
* @param jndiName the original JNDI name
|
||||
* @return the JNDI name to use
|
||||
* @see #CONTAINER_PREFIX
|
||||
|
||||
@@ -41,11 +41,11 @@ import org.springframework.util.ClassUtils;
|
||||
/**
|
||||
* {@link org.springframework.beans.factory.FactoryBean} that looks up a
|
||||
* JNDI object. Exposes the object found in JNDI for bean references,
|
||||
* e.g. for data access object's "dataSource" property in case of a
|
||||
* for example, for data access object's "dataSource" property in case of a
|
||||
* {@link javax.sql.DataSource}.
|
||||
*
|
||||
* <p>The typical usage will be to register this as singleton factory
|
||||
* (e.g. for a certain JNDI-bound DataSource) in an application context,
|
||||
* (for example, for a certain JNDI-bound DataSource) in an application context,
|
||||
* and give bean references to application services that need it.
|
||||
*
|
||||
* <p>The default behavior is to look up the JNDI object on startup and cache it.
|
||||
@@ -54,12 +54,12 @@ import org.springframework.util.ClassUtils;
|
||||
* a "proxyInterface" in such a scenario, since the actual JNDI object type is not
|
||||
* known in advance.
|
||||
*
|
||||
* <p>Of course, bean classes in a Spring environment may look up e.g. a DataSource
|
||||
* <p>Of course, bean classes in a Spring environment may look up, for example, a DataSource
|
||||
* from JNDI themselves. This class simply enables central configuration of the
|
||||
* JNDI name, and easy switching to non-JNDI alternatives. The latter is
|
||||
* particularly convenient for test setups, reuse in standalone clients, etc.
|
||||
*
|
||||
* <p>Note that switching to e.g. DriverManagerDataSource is just a matter of
|
||||
* <p>Note that switching to, for example, DriverManagerDataSource is just a matter of
|
||||
* configuration: Simply replace the definition of this FactoryBean with a
|
||||
* {@link org.springframework.jdbc.datasource.DriverManagerDataSource} definition!
|
||||
*
|
||||
@@ -152,7 +152,7 @@ public class JndiObjectFactoryBean extends JndiObjectLocator
|
||||
* <p>Default is "false", i.e. to only expose the JNDI context for object lookup.
|
||||
* Switch this flag to "true" in order to expose the JNDI environment (including
|
||||
* the authorization context) for each method invocation, as needed by WebLogic
|
||||
* for JNDI-obtained factories (e.g. JDBC DataSource, JMS ConnectionFactory)
|
||||
* for JNDI-obtained factories (for example, JDBC DataSource, JMS ConnectionFactory)
|
||||
* with authorization requirements.
|
||||
*/
|
||||
public void setExposeAccessContext(boolean exposeAccessContext) {
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.StringUtils;
|
||||
* accessing a locally mapped (Environmental Naming Context) resource. If it
|
||||
* doesn't, the "java:comp/env/" prefix will be prepended if the "resourceRef"
|
||||
* property is true (the default is <strong>false</strong>) and no other scheme
|
||||
* (e.g. "java:") is given.
|
||||
* (for example, "java:") is given.
|
||||
*
|
||||
* <p>Subclasses may invoke the {@link #lookup()} method whenever it is appropriate.
|
||||
* Some classes might do this on initialization, while others might do it
|
||||
|
||||
@@ -127,7 +127,7 @@ public class JndiTemplate {
|
||||
/**
|
||||
* Create a new JNDI initial context. Invoked by {@link #getContext}.
|
||||
* <p>The default implementation use this template's environment settings.
|
||||
* Can be subclassed for custom contexts, e.g. for testing.
|
||||
* Can be subclassed for custom contexts, for example, for testing.
|
||||
* @return the initial Context instance
|
||||
* @throws NamingException in case of initialization errors
|
||||
*/
|
||||
|
||||
@@ -66,13 +66,13 @@ public interface TaskScheduler {
|
||||
* {@link ScheduledFuture} gets cancelled.
|
||||
* @param task the Runnable to execute whenever the trigger fires
|
||||
* @param trigger an implementation of the {@link Trigger} interface,
|
||||
* e.g. a {@link org.springframework.scheduling.support.CronTrigger} object
|
||||
* for example, a {@link org.springframework.scheduling.support.CronTrigger} object
|
||||
* wrapping a cron expression
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task,
|
||||
* or {@code null} if the given Trigger object never fires (i.e. returns
|
||||
* {@code null} from {@link Trigger#nextExecution})
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @see org.springframework.scheduling.support.CronTrigger
|
||||
*/
|
||||
@Nullable
|
||||
@@ -87,7 +87,7 @@ public interface TaskScheduler {
|
||||
* (if this is in the past, the task will be executed immediately, i.e. as soon as possible)
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @since 5.0
|
||||
*/
|
||||
ScheduledFuture<?> schedule(Runnable task, Instant startTime);
|
||||
@@ -101,7 +101,7 @@ public interface TaskScheduler {
|
||||
* (if this is in the past, the task will be executed immediately, i.e. as soon as possible)
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @deprecated as of 6.0, in favor of {@link #schedule(Runnable, Instant)}
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@@ -120,7 +120,7 @@ public interface TaskScheduler {
|
||||
* @param period the interval between successive executions of the task
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @since 5.0
|
||||
*/
|
||||
ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Instant startTime, Duration period);
|
||||
@@ -136,7 +136,7 @@ public interface TaskScheduler {
|
||||
* @param period the interval between successive executions of the task (in milliseconds)
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @deprecated as of 6.0, in favor of {@link #scheduleAtFixedRate(Runnable, Instant, Duration)}
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@@ -153,7 +153,7 @@ public interface TaskScheduler {
|
||||
* @param period the interval between successive executions of the task
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @since 5.0
|
||||
*/
|
||||
ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Duration period);
|
||||
@@ -167,7 +167,7 @@ public interface TaskScheduler {
|
||||
* @param period the interval between successive executions of the task (in milliseconds)
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @deprecated as of 6.0, in favor of {@link #scheduleAtFixedRate(Runnable, Duration)}
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@@ -187,7 +187,7 @@ public interface TaskScheduler {
|
||||
* @param delay the delay between the completion of one execution and the start of the next
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @since 5.0
|
||||
*/
|
||||
ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Instant startTime, Duration delay);
|
||||
@@ -205,7 +205,7 @@ public interface TaskScheduler {
|
||||
* (in milliseconds)
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @deprecated as of 6.0, in favor of {@link #scheduleWithFixedDelay(Runnable, Instant, Duration)}
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@@ -222,7 +222,7 @@ public interface TaskScheduler {
|
||||
* @param delay the delay between the completion of one execution and the start of the next
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @since 5.0
|
||||
*/
|
||||
ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Duration delay);
|
||||
@@ -237,7 +237,7 @@ public interface TaskScheduler {
|
||||
* (in milliseconds)
|
||||
* @return a {@link ScheduledFuture} representing pending execution of the task
|
||||
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
|
||||
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
|
||||
* for internal reasons (for example, a pool overload handling policy or a pool shutdown in progress)
|
||||
* @deprecated as of 6.0, in favor of {@link #scheduleWithFixedDelay(Runnable, Duration)}
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
|
||||
@@ -184,7 +184,7 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
*
|
||||
* <p><b>Note: {@code @EnableScheduling} applies to its local application context only,
|
||||
* allowing for selective scheduling of beans at different levels.</b> Please redeclare
|
||||
* {@code @EnableScheduling} in each individual context, e.g. the common root web
|
||||
* {@code @EnableScheduling} in each individual context, for example, the common root web
|
||||
* application context and any separate {@code DispatcherServlet} application contexts,
|
||||
* if you need to apply its behavior at multiple levels.
|
||||
*
|
||||
|
||||
@@ -91,7 +91,7 @@ import org.springframework.util.StringValueResolver;
|
||||
*
|
||||
* <p>Autodetects any {@link SchedulingConfigurer} instances in the container,
|
||||
* allowing for customization of the scheduler to be used or for fine-grained
|
||||
* control over task registration (e.g. registration of {@link Trigger} tasks).
|
||||
* control over task registration (for example, registration of {@link Trigger} tasks).
|
||||
* See the {@link EnableScheduling @EnableScheduling} javadocs for complete usage
|
||||
* details.
|
||||
*
|
||||
@@ -664,7 +664,7 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
if (event instanceof ContextRefreshedEvent) {
|
||||
// Running in an ApplicationContext -> register tasks this late...
|
||||
// giving other ContextRefreshedEvent listeners a chance to perform
|
||||
// their work at the same time (e.g. Spring Batch's job registration).
|
||||
// their work at the same time (for example, Spring Batch's job registration).
|
||||
finishRegistration();
|
||||
}
|
||||
else if (event instanceof ContextClosedEvent) {
|
||||
|
||||
@@ -182,7 +182,7 @@ public abstract class ExecutorConfigurationSupport extends CustomizableThreadFac
|
||||
* <p>Note that Spring's container shutdown continues while ongoing tasks
|
||||
* are being completed. If you want this executor to block and wait for the
|
||||
* termination of tasks before the rest of the container continues to shut
|
||||
* down - e.g. in order to keep up other resources that your tasks may need -,
|
||||
* down - for example, in order to keep up other resources that your tasks may need -,
|
||||
* set the {@link #setAwaitTerminationSeconds "awaitTerminationSeconds"}
|
||||
* property instead of or in addition to this property.
|
||||
* @see java.util.concurrent.ExecutorService#shutdown()
|
||||
|
||||
@@ -70,7 +70,7 @@ import org.springframework.util.concurrent.ListenableFuture;
|
||||
* consider setting {@link #setVirtualThreads} to {@code true}.
|
||||
*
|
||||
* <p>Extends {@link SimpleAsyncTaskExecutor} and can serve as a fully capable
|
||||
* replacement for it, e.g. as a single shared instance serving as a
|
||||
* replacement for it, for example, as a single shared instance serving as a
|
||||
* {@link org.springframework.core.task.TaskExecutor} as well as a {@link TaskScheduler}.
|
||||
* This is generally not the case with other executor/scheduler implementations
|
||||
* which tend to have specific constraints for the scheduler thread pool,
|
||||
@@ -78,13 +78,13 @@ import org.springframework.util.concurrent.ListenableFuture;
|
||||
*
|
||||
* <p><b>NOTE: This scheduler variant does not track the actual completion of tasks
|
||||
* but rather just the hand-off to an execution thread.</b> As a consequence,
|
||||
* a {@link ScheduledFuture} handle (e.g. from {@link #schedule(Runnable, Instant)})
|
||||
* a {@link ScheduledFuture} handle (for example, from {@link #schedule(Runnable, Instant)})
|
||||
* represents that hand-off rather than the actual completion of the provided task
|
||||
* (or series of repeated tasks).
|
||||
*
|
||||
* <p>As an alternative to the built-in thread-per-task capability, this scheduler
|
||||
* can also be configured with a separate target executor for scheduled task
|
||||
* execution through {@link #setTargetTaskExecutor}: e.g. pointing to a shared
|
||||
* execution through {@link #setTargetTaskExecutor}: for example, pointing to a shared
|
||||
* {@link ThreadPoolTaskExecutor} bean. This is still rather different from a
|
||||
* {@link ThreadPoolTaskScheduler} setup since it always uses a single scheduler
|
||||
* thread while dynamically dispatching to the target thread pool which may have
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.springframework.util.concurrent.ListenableFutureTask;
|
||||
* JavaBean that allows for configuring a {@link java.util.concurrent.ThreadPoolExecutor}
|
||||
* in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity"
|
||||
* properties) and exposing it as a Spring {@link org.springframework.core.task.TaskExecutor}.
|
||||
* This class is also well suited for management and monitoring (e.g. through JMX),
|
||||
* This class is also well suited for management and monitoring (for example, through JMX),
|
||||
* providing several useful attributes: "corePoolSize", "maxPoolSize", "keepAliveSeconds"
|
||||
* (all supporting updates at runtime); "poolSize", "activeCount" (for introspection only).
|
||||
*
|
||||
|
||||
@@ -59,7 +59,7 @@ import org.springframework.util.concurrent.ListenableFutureTask;
|
||||
* <p>This is Spring's traditional scheduler variant, staying as close as possible to
|
||||
* {@link java.util.concurrent.ScheduledExecutorService} semantics. Task execution happens
|
||||
* on the scheduler thread(s) rather than on separate execution threads. As a consequence,
|
||||
* a {@link ScheduledFuture} handle (e.g. from {@link #schedule(Runnable, Instant)})
|
||||
* a {@link ScheduledFuture} handle (for example, from {@link #schedule(Runnable, Instant)})
|
||||
* represents the actual completion of the provided task (or series of repeated tasks).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -137,7 +137,7 @@ public class TaskExecutorFactoryBean implements
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
throw new IllegalArgumentException("Invalid pool-size value [" + this.poolSize + "]: only single " +
|
||||
"maximum integer (e.g. \"5\") and minimum-maximum range (e.g. \"3-5\") are supported", ex);
|
||||
"maximum integer (for example, \"5\") and minimum-maximum range (for example, \"3-5\") are supported", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ScheduledMethodRunnable implements SchedulingAwareRunnable {
|
||||
* @param target the target instance to call the method on
|
||||
* @param method the target method to call
|
||||
* @param qualifier a qualifier associated with this Runnable,
|
||||
* e.g. for determining a scheduler to run this scheduled method on
|
||||
* for example, for determining a scheduler to run this scheduled method on
|
||||
* @param observationRegistrySupplier a supplier for the observation registry to use
|
||||
* @since 6.1
|
||||
*/
|
||||
|
||||
@@ -100,7 +100,7 @@ public interface ScriptFactory {
|
||||
throws IOException, ScriptCompilationException;
|
||||
|
||||
/**
|
||||
* Determine whether a refresh is required (e.g. through
|
||||
* Determine whether a refresh is required (for example, through
|
||||
* ScriptSource's {@code isModified()} method).
|
||||
* @param scriptSource the actual ScriptSource to retrieve
|
||||
* the script source text from (never {@code null})
|
||||
|
||||
@@ -80,7 +80,7 @@ public class StandardScriptEvaluator implements ScriptEvaluator, BeanClassLoader
|
||||
|
||||
|
||||
/**
|
||||
* Set the name of the language meant for evaluating the scripts (e.g. "Groovy").
|
||||
* Set the name of the language meant for evaluating the scripts (for example, "Groovy").
|
||||
* <p>This is effectively an alias for {@link #setEngineName "engineName"},
|
||||
* potentially (but not yet) providing common abbreviations for certain languages
|
||||
* beyond what the JSR-223 script engine factory exposes.
|
||||
@@ -91,7 +91,7 @@ public class StandardScriptEvaluator implements ScriptEvaluator, BeanClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the script engine for evaluating the scripts (e.g. "Groovy"),
|
||||
* Set the name of the script engine for evaluating the scripts (for example, "Groovy"),
|
||||
* as exposed by the JSR-223 script engine factory.
|
||||
* @since 4.2.2
|
||||
* @see #setLanguage
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
|
||||
/**
|
||||
* Indicates that an annotated class is a "Controller" (e.g. a web controller).
|
||||
* Indicates that an annotated class is a "Controller" (for example, a web controller).
|
||||
*
|
||||
* <p>This annotation serves as a specialization of {@link Component @Component},
|
||||
* allowing for implementation classes to be autodetected through classpath scanning.
|
||||
|
||||
@@ -34,7 +34,7 @@ public interface ThemeSource {
|
||||
/**
|
||||
* Return the Theme instance for the given theme name.
|
||||
* <p>The returned Theme will resolve theme-specific messages, codes,
|
||||
* file paths, etc (e.g. CSS and image files in a web environment).
|
||||
* file paths, etc (for example, CSS and image files in a web environment).
|
||||
* @param themeName the name of the theme
|
||||
* @return the corresponding Theme, or {@code null} if none defined.
|
||||
* Note that, by convention, a ThemeSource should at least be able to
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ResourceBundleThemeSource implements HierarchicalThemeSource, BeanC
|
||||
/**
|
||||
* Set the prefix that gets applied to the ResourceBundle basenames,
|
||||
* i.e. the theme names.
|
||||
* E.g.: basenamePrefix="test.", themeName="theme" → basename="test.theme".
|
||||
* For example: basenamePrefix="test.", themeName="theme" → basename="test.theme".
|
||||
* <p>Note that ResourceBundle names are effectively classpath locations: As a
|
||||
* consequence, the JDK's standard ResourceBundle treats dots as package separators.
|
||||
* This means that "test.theme" is effectively equivalent to "test/theme",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Classes supporting the org.springframework.ui.context package.
|
||||
* Provides support classes for specialized UI contexts, e.g. for web UIs.
|
||||
* Provides support classes for specialized UI contexts, for example, for web UIs.
|
||||
*/
|
||||
@NonNullApi
|
||||
@NonNullFields
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.springframework.lang.Nullable;
|
||||
* <p>Serves as result holder for a {@link DataBinder}, obtained via
|
||||
* the {@link DataBinder#getBindingResult()} method. BindingResult
|
||||
* implementations can also be used directly, for example to invoke
|
||||
* a {@link Validator} on it (e.g. as part of a unit test).
|
||||
* a {@link Validator} on it (for example, as part of a unit test).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
|
||||
@@ -66,7 +66,7 @@ public class DefaultBindingErrorProcessor implements BindingErrorProcessor {
|
||||
|
||||
@Override
|
||||
public void processPropertyAccessException(PropertyAccessException ex, BindingResult bindingResult) {
|
||||
// Create field error with the code of the exception, e.g. "typeMismatch".
|
||||
// Create field error with the code of the exception, for example, "typeMismatch".
|
||||
String field = ex.getPropertyName();
|
||||
Assert.state(field != null, "No field in exception");
|
||||
String[] codes = bindingResult.resolveMessageCodes(ex.getErrorCode(), field);
|
||||
|
||||
@@ -81,7 +81,7 @@ import org.springframework.util.StringUtils;
|
||||
* {@link MessageCodeFormatter format}.
|
||||
*
|
||||
* <p>In order to group all codes into a specific category within your resource bundles,
|
||||
* e.g. "validation.typeMismatch.name" instead of the default "typeMismatch.name",
|
||||
* for example, "validation.typeMismatch.name" instead of the default "typeMismatch.name",
|
||||
* consider specifying a {@link #setPrefix prefix} to be applied.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
@@ -216,7 +216,7 @@ public class DefaultMessageCodesResolver implements MessageCodesResolver, Serial
|
||||
public enum Format implements MessageCodeFormatter {
|
||||
|
||||
/**
|
||||
* Prefix the error code at the beginning of the generated message code. e.g.:
|
||||
* Prefix the error code at the beginning of the generated message code. for example:
|
||||
* {@code errorCode + "." + object name + "." + field}
|
||||
*/
|
||||
PREFIX_ERROR_CODE {
|
||||
@@ -227,7 +227,7 @@ public class DefaultMessageCodesResolver implements MessageCodesResolver, Serial
|
||||
},
|
||||
|
||||
/**
|
||||
* Postfix the error code at the end of the generated message code. e.g.:
|
||||
* Postfix the error code at the end of the generated message code. for example:
|
||||
* {@code object name + "." + field + "." + errorCode}
|
||||
*/
|
||||
POSTFIX_ERROR_CODE {
|
||||
|
||||
@@ -28,9 +28,9 @@ import org.springframework.lang.Nullable;
|
||||
* Stores and exposes information about data-binding and validation errors
|
||||
* for a specific object.
|
||||
*
|
||||
* <p>Field names are typically properties of the target object (e.g. "name"
|
||||
* <p>Field names are typically properties of the target object (for example, "name"
|
||||
* when binding to a customer object). Implementations may also support nested
|
||||
* fields in case of nested objects (e.g. "address.street"), in conjunction
|
||||
* fields in case of nested objects (for example, "address.street"), in conjunction
|
||||
* with subtree navigation via {@link #setNestedPath}: for example, an
|
||||
* {@code AddressValidator} may validate "address", not being aware that this
|
||||
* is a nested object of a top-level customer object.
|
||||
@@ -69,7 +69,7 @@ public interface Errors {
|
||||
* <p>The default implementation throws {@code UnsupportedOperationException}
|
||||
* since not all {@code Errors} implementations support nested paths.
|
||||
* @param nestedPath nested path within this object,
|
||||
* e.g. "address" (defaults to "", {@code null} is also acceptable).
|
||||
* for example, "address" (defaults to "", {@code null} is also acceptable).
|
||||
* Can end with a dot: both "address" and "address." are valid.
|
||||
* @see #getNestedPath()
|
||||
*/
|
||||
@@ -218,7 +218,7 @@ public interface Errors {
|
||||
/**
|
||||
* Throw the mapped exception with a message summarizing the recorded errors.
|
||||
* @param messageToException a function mapping the message to the exception,
|
||||
* e.g. {@code IllegalArgumentException::new} or {@code IllegalStateException::new}
|
||||
* for example, {@code IllegalArgumentException::new} or {@code IllegalStateException::new}
|
||||
* @param <T> the exception type to be thrown
|
||||
* @since 6.1
|
||||
* @see #toString()
|
||||
@@ -392,7 +392,7 @@ public interface Errors {
|
||||
|
||||
/**
|
||||
* Return a summary of the recorded errors,
|
||||
* e.g. for inclusion in an exception message.
|
||||
* for example, for inclusion in an exception message.
|
||||
* @see #failOnError(Function)
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -32,10 +32,10 @@ public interface MessageCodeFormatter {
|
||||
/**
|
||||
* Build and return a message code consisting of the given fields,
|
||||
* usually delimited by {@link DefaultMessageCodesResolver#CODE_SEPARATOR}.
|
||||
* @param errorCode e.g.: "typeMismatch"
|
||||
* @param objectName e.g.: "user"
|
||||
* @param field e.g. "age"
|
||||
* @return concatenated message code, e.g.: "typeMismatch.user.age"
|
||||
* @param errorCode for example: "typeMismatch"
|
||||
* @param objectName for example: "user"
|
||||
* @param field for example, "age"
|
||||
* @return concatenated message code, for example: "typeMismatch.user.age"
|
||||
* @see DefaultMessageCodesResolver.Format
|
||||
*/
|
||||
String format(String errorCode, @Nullable String objectName, @Nullable String field);
|
||||
|
||||
@@ -94,7 +94,7 @@ public class ObjectError extends DefaultMessageSourceResolvable {
|
||||
* (typically {@link org.springframework.beans.PropertyAccessException})
|
||||
* or a Bean Validation {@link jakarta.validation.ConstraintViolation}.
|
||||
* <p>The cause of the outermost exception will be introspected as well,
|
||||
* e.g. the underlying conversion exception or exception thrown from a setter
|
||||
* for example, the underlying conversion exception or exception thrown from a setter
|
||||
* (instead of having to unwrap the {@code PropertyAccessException} in turn).
|
||||
* @return the source object of the given type
|
||||
* @throws IllegalArgumentException if no such source object is available
|
||||
@@ -119,7 +119,7 @@ public class ObjectError extends DefaultMessageSourceResolvable {
|
||||
* (typically {@link org.springframework.beans.PropertyAccessException})
|
||||
* or a Bean Validation {@link jakarta.validation.ConstraintViolation}.
|
||||
* <p>The cause of the outermost exception will be introspected as well,
|
||||
* e.g. the underlying conversion exception or exception thrown from a setter
|
||||
* for example, the underlying conversion exception or exception thrown from a setter
|
||||
* (instead of having to unwrap the {@code PropertyAccessException} in turn).
|
||||
* @return whether this error has been caused by a source object of the given type
|
||||
* @since 5.0.4
|
||||
|
||||
@@ -96,7 +96,7 @@ public interface Validator {
|
||||
* Validate the given {@code target} object individually.
|
||||
* <p>Delegates to the common {@link #validate(Object, Errors)} method.
|
||||
* The returned {@link Errors errors} instance can be used to report
|
||||
* any resulting validation errors for the specific target object, e.g.
|
||||
* any resulting validation errors for the specific target object, for example,
|
||||
* {@code if (validator.validateObject(target).hasErrors()) ...} or
|
||||
* {@code validator.validateObject(target).failOnError(IllegalStateException::new));}.
|
||||
* <p>Note: This validation call comes with limitations in the {@link Errors}
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.lang.annotation.Target;
|
||||
* specification of validation groups. Designed for convenient use with
|
||||
* Spring's JSR-303 support but not JSR-303 specific.
|
||||
*
|
||||
* <p>Can be used e.g. with Spring MVC handler methods arguments.
|
||||
* <p>Can be used, for example, with Spring MVC handler methods arguments.
|
||||
* Supported through {@link org.springframework.validation.SmartValidator}'s
|
||||
* validation hint concept, with validation group classes acting as hint objects.
|
||||
*
|
||||
|
||||
@@ -195,7 +195,7 @@ public class MethodValidationAdapter implements MethodValidator {
|
||||
* <li>{@link Conventions#getVariableNameForReturnType(Method, Class, Object)}
|
||||
* for a return type
|
||||
* </ul>
|
||||
* If a name cannot be determined, e.g. a return value with insufficient
|
||||
* If a name cannot be determined, for example, a return value with insufficient
|
||||
* type information, then it defaults to one of:
|
||||
* <ul>
|
||||
* <li>{@code "{methodName}.arg{index}"} for input parameters
|
||||
|
||||
@@ -59,7 +59,7 @@ import org.springframework.validation.method.ParameterValidationResult;
|
||||
* their parameters and/or on their return value (in the latter case specified at
|
||||
* the method level, typically as inline annotation).
|
||||
*
|
||||
* <p>E.g.: {@code public @NotNull Object myValidMethod(@NotNull String arg1, @Max(10) int arg2)}
|
||||
* <p>For example: {@code public @NotNull Object myValidMethod(@NotNull String arg1, @Max(10) int arg2)}
|
||||
*
|
||||
* <p>In case of validation errors, the interceptor can raise
|
||||
* {@link ConstraintViolationException}, or adapt the violations to
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.validation.method.MethodValidationResult;
|
||||
*
|
||||
* <p>Applicable methods have JSR-303 constraint annotations on their parameters
|
||||
* and/or on their return value (in the latter case specified at the method level,
|
||||
* typically as inline annotation), e.g.:
|
||||
* typically as inline annotation), for example:
|
||||
*
|
||||
* <pre class="code">
|
||||
* public @NotNull Object myValidMethod(@NotNull String arg1, @Max(10) int arg2)
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
|
||||
* <p>Note that this class is meant for programmatic use, not for declarative use
|
||||
* in a standard {@code validation.xml} file. Consider
|
||||
* {@link org.springframework.web.bind.support.SpringWebConstraintValidatorFactory}
|
||||
* for declarative use in a web application, e.g. with JAX-RS or JAX-WS.
|
||||
* for declarative use in a web application, for example, with JAX-RS or JAX-WS.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
|
||||
@@ -248,7 +248,7 @@ public class SpringValidatorAdapter implements SmartValidator, jakarta.validatio
|
||||
* (see {@link #getResolvableField}). Afterwards, it adds all actual constraint
|
||||
* annotation attributes (i.e. excluding "message", "groups" and "payload") in
|
||||
* alphabetical order of their attribute names.
|
||||
* <p>Can be overridden to e.g. add further attributes from the constraint descriptor.
|
||||
* <p>Can be overridden to, for example, add further attributes from the constraint descriptor.
|
||||
* @param objectName the name of the target object
|
||||
* @param field the field that caused the binding error
|
||||
* @param descriptor the JSR-303 constraint descriptor
|
||||
|
||||
@@ -57,7 +57,7 @@ public interface MethodValidator {
|
||||
/**
|
||||
* Delegate to {@link #validateArguments} and handle the validation result,
|
||||
* by default raising {@link MethodValidationException} in case of errors.
|
||||
* Implementations may provide alternative handling, e.g. injecting
|
||||
* Implementations may provide alternative handling, for example, injecting
|
||||
* {@link org.springframework.validation.Errors} into the method.
|
||||
* @throws MethodValidationException in case of unhandled errors.
|
||||
*/
|
||||
|
||||
@@ -136,9 +136,9 @@ public class ParameterValidationResult {
|
||||
* <ul>
|
||||
* <li>For a constraints directly on a method parameter, error codes are
|
||||
* based on the names of the constraint annotation, the object, the method,
|
||||
* the parameter, and parameter type, e.g.
|
||||
* the parameter, and parameter type, for example,
|
||||
* {@code ["Max.myObject#myMethod.myParameter", "Max.myParameter", "Max.int", "Max"]}.
|
||||
* Arguments include the parameter itself as a {@link MessageSourceResolvable}, e.g.
|
||||
* Arguments include the parameter itself as a {@link MessageSourceResolvable}, for example,
|
||||
* {@code ["myObject#myMethod.myParameter", "myParameter"]}, followed by actual
|
||||
* constraint annotation attributes (i.e. excluding "message", "groups" and
|
||||
* "payload") in alphabetical order of attribute names.
|
||||
|
||||
Reference in New Issue
Block a user