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
@@ -105,7 +105,7 @@ final class AnnotationWriter extends AnnotationVisitor {
|
||||
* the structure except the last one (the element_value_pairs array).
|
||||
* @param previousAnnotation the previously visited annotation of the
|
||||
* Runtime[In]Visible[Type]Annotations attribute to which this annotation belongs, or
|
||||
* {@literal null} in other cases (e.g. nested or array annotations).
|
||||
* {@literal null} in other cases (for example, nested or array annotations).
|
||||
*/
|
||||
AnnotationWriter(
|
||||
final SymbolTable symbolTable,
|
||||
@@ -131,7 +131,7 @@ final class AnnotationWriter extends AnnotationVisitor {
|
||||
* @param descriptor the class descriptor of the annotation class.
|
||||
* @param previousAnnotation the previously visited annotation of the
|
||||
* Runtime[In]Visible[Type]Annotations attribute to which this annotation belongs, or
|
||||
* {@literal null} in other cases (e.g. nested or array annotations).
|
||||
* {@literal null} in other cases (for example, nested or array annotations).
|
||||
* @return a new {@link AnnotationWriter} for the given annotation descriptor.
|
||||
*/
|
||||
static AnnotationWriter create(
|
||||
@@ -161,7 +161,7 @@ final class AnnotationWriter extends AnnotationVisitor {
|
||||
* @param descriptor the class descriptor of the annotation class.
|
||||
* @param previousAnnotation the previously visited annotation of the
|
||||
* Runtime[In]Visible[Type]Annotations attribute to which this annotation belongs, or
|
||||
* {@literal null} in other cases (e.g. nested or array annotations).
|
||||
* {@literal null} in other cases (for example, nested or array annotations).
|
||||
* @return a new {@link AnnotationWriter} for the given type annotation reference and descriptor.
|
||||
*/
|
||||
static AnnotationWriter create(
|
||||
|
||||
@@ -340,7 +340,7 @@ public class ClassReader {
|
||||
private static int computeBufferSize(final InputStream inputStream) throws IOException {
|
||||
int expectedLength = inputStream.available();
|
||||
/*
|
||||
* Some implementations can return 0 while holding available data (e.g. new
|
||||
* Some implementations can return 0 while holding available data (for example, new
|
||||
* FileInputStream("/proc/a_file")). Also in some pathological cases a very small number might
|
||||
* be returned, and in this case we use a default size.
|
||||
*/
|
||||
@@ -2311,7 +2311,7 @@ public class ClassReader {
|
||||
{
|
||||
// A forward jump with an offset > 32767. In this case we automatically replace ASM_GOTO
|
||||
// with GOTO_W, ASM_JSR with JSR_W and ASM_IFxxx <l> with IFNOTxxx <L> GOTO_W <l> L:...,
|
||||
// where IFNOTxxx is the "opposite" opcode of ASMS_IFxxx (e.g. IFNE for ASM_IFEQ) and
|
||||
// where IFNOTxxx is the "opposite" opcode of ASMS_IFxxx (for example, IFNE for ASM_IFEQ) and
|
||||
// where <L> designates the instruction just after the GOTO_W.
|
||||
// First, change the ASM specific opcodes ASM_IFEQ ... ASM_JSR, ASM_IFNULL and
|
||||
// ASM_IFNONNULL to IFEQ ... JSR, IFNULL and IFNONNULL.
|
||||
|
||||
@@ -183,11 +183,11 @@ public abstract class ClassVisitor {
|
||||
* @param owner internal name of the enclosing class of the class (see {@link
|
||||
* Type#getInternalName()}).
|
||||
* @param name the name of the method that contains the class, or {@literal null} if the class is
|
||||
* not enclosed in a method or constructor of its enclosing class (e.g. if it is enclosed in
|
||||
* not enclosed in a method or constructor of its enclosing class (for example, if it is enclosed in
|
||||
* an instance initializer, static initializer, instance variable initializer, or class
|
||||
* variable initializer).
|
||||
* @param descriptor the descriptor of the method that contains the class, or {@literal null} if
|
||||
* the class is not enclosed in a method or constructor of its enclosing class (e.g. if it is
|
||||
* the class is not enclosed in a method or constructor of its enclosing class (for example, if it is
|
||||
* enclosed in an instance initializer, static initializer, instance variable initializer, or
|
||||
* class variable initializer).
|
||||
*/
|
||||
@@ -293,7 +293,7 @@ public abstract class ClassVisitor {
|
||||
* @param name the internal name of C (see {@link Type#getInternalName()}).
|
||||
* @param outerName the internal name of the class or interface C is a member of (see {@link
|
||||
* Type#getInternalName()}). Must be {@literal null} if C is not the member of a class or
|
||||
* interface (e.g. for local or anonymous classes).
|
||||
* interface (for example, for local or anonymous classes).
|
||||
* @param innerName the (simple) name of C. Must be {@literal null} for anonymous inner classes.
|
||||
* @param access the access flags of C originally declared in the source code from which this
|
||||
* class was compiled.
|
||||
|
||||
@@ -1103,7 +1103,7 @@ final class MethodWriter extends MethodVisitor {
|
||||
&& label.bytecodeOffset - code.length < Short.MIN_VALUE) {
|
||||
// Case of a backward jump with an offset < -32768. In this case we automatically replace GOTO
|
||||
// with GOTO_W, JSR with JSR_W and IFxxx <l> with IFNOTxxx <L> GOTO_W <l> L:..., where
|
||||
// IFNOTxxx is the "opposite" opcode of IFxxx (e.g. IFNE for IFEQ) and where <L> designates
|
||||
// IFNOTxxx is the "opposite" opcode of IFxxx (for example, IFNE for IFEQ) and where <L> designates
|
||||
// the instruction just after the GOTO_W.
|
||||
if (baseOpcode == Opcodes.GOTO) {
|
||||
code.putByte(Constants.GOTO_W);
|
||||
|
||||
@@ -30,7 +30,7 @@ package org.springframework.asm;
|
||||
|
||||
/**
|
||||
* A reference to a type appearing in a class, field or method declaration, or on an instruction.
|
||||
* Such a reference designates the part of the class where the referenced type is appearing (e.g. an
|
||||
* Such a reference designates the part of the class where the referenced type is appearing (for example, an
|
||||
* 'extends', 'implements' or 'throws' clause, a 'new' instruction, a 'catch' clause, a type cast, a
|
||||
* local variable declaration, etc).
|
||||
*
|
||||
|
||||
@@ -77,7 +77,7 @@ abstract public class AbstractClassGenerator<T> implements ClassGenerator {
|
||||
private final Set<String> reservedClassNames = new HashSet<>();
|
||||
|
||||
/**
|
||||
* {@link AbstractClassGenerator} here holds "cache key" (e.g. {@link org.springframework.cglib.proxy.Enhancer}
|
||||
* {@link AbstractClassGenerator} here holds "cache key" (for example, {@link org.springframework.cglib.proxy.Enhancer}
|
||||
* configuration), and the value is the generated class plus some additional values
|
||||
* (see {@link #unwrapCachedValue(Object)}.
|
||||
* <p>The generated classes can be reused as long as their classloader is reachable.</p>
|
||||
|
||||
@@ -73,7 +73,7 @@ public class InterfaceMaker extends AbstractClassGenerator
|
||||
/**
|
||||
* Add all the public methods in the specified class.
|
||||
* Methods from superclasses are included, except for methods declared in the base
|
||||
* Object class (e.g. <code>getClass</code>, <code>equals</code>, <code>hashCode</code>).
|
||||
* Object class (for example, <code>getClass</code>, <code>equals</code>, <code>hashCode</code>).
|
||||
* @param clazz the class containing the methods to add to the interface
|
||||
*/
|
||||
public void add(Class clazz) {
|
||||
|
||||
@@ -142,7 +142,7 @@ public final class Conventions {
|
||||
* Determine the conventional variable name for the return type of the given
|
||||
* method, taking the generic collection type, if any, into account, falling
|
||||
* back on the given actual return value if the method declaration is not
|
||||
* specific enough, e.g. {@code Object} return type or untyped collection.
|
||||
* specific enough, for example, {@code Object} return type or untyped collection.
|
||||
* @param method the method to generate a variable name for
|
||||
* @param value the return value (may be {@code null} if not available)
|
||||
* @return the generated variable name
|
||||
@@ -155,7 +155,7 @@ public final class Conventions {
|
||||
* Determine the conventional variable name for the return type of the given
|
||||
* method, taking the generic collection type, if any, into account, falling
|
||||
* back on the given return value if the method declaration is not specific
|
||||
* enough, e.g. {@code Object} return type or untyped collection.
|
||||
* enough, for example, {@code Object} return type or untyped collection.
|
||||
* <p>As of 5.0 this method supports reactive types:<br>
|
||||
* {@code Mono<com.myapp.Product>} becomes {@code "productMono"}<br>
|
||||
* {@code Flux<com.myapp.MyProduct>} becomes {@code "myProductFlux"}<br>
|
||||
@@ -211,7 +211,7 @@ public final class Conventions {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert {@code String}s in attribute name format (e.g. lowercase, hyphens
|
||||
* Convert {@code String}s in attribute name format (for example, lowercase, hyphens
|
||||
* separating words) into property name format (camel-case). For example
|
||||
* {@code transaction-manager} becomes {@code "transactionManager"}.
|
||||
*/
|
||||
@@ -271,7 +271,7 @@ public final class Conventions {
|
||||
}
|
||||
else if (valueClass.getName().lastIndexOf('$') != -1 && valueClass.getDeclaringClass() == null) {
|
||||
// '$' in the class name but no inner class -
|
||||
// assuming it's a special subclass (e.g. by OpenJPA)
|
||||
// assuming it's a special subclass (for example, by OpenJPA)
|
||||
valueClass = valueClass.getSuperclass();
|
||||
}
|
||||
return valueClass;
|
||||
|
||||
@@ -59,7 +59,7 @@ public abstract class DecoratingClassLoader extends ClassLoader {
|
||||
|
||||
|
||||
/**
|
||||
* Add a package name to exclude from decoration (e.g. overriding).
|
||||
* Add a package name to exclude from decoration (for example, overriding).
|
||||
* <p>Any class whose fully-qualified name starts with the name registered
|
||||
* here will be handled by the parent ClassLoader in the usual fashion.
|
||||
* @param packageName the package name to exclude
|
||||
@@ -70,7 +70,7 @@ public abstract class DecoratingClassLoader extends ClassLoader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a class name to exclude from decoration (e.g. overriding).
|
||||
* Add a class name to exclude from decoration (for example, overriding).
|
||||
* <p>Any class name registered here will be handled by the parent
|
||||
* ClassLoader in the usual fashion.
|
||||
* @param className the class name to exclude
|
||||
|
||||
@@ -25,7 +25,7 @@ package org.springframework.core;
|
||||
* <p>Such wrappers will automatically be unwrapped for key comparisons in
|
||||
* {@link org.springframework.transaction.support.TransactionSynchronizationManager}.
|
||||
*
|
||||
* <p>Only fully transparent proxies, e.g. for redirection or service lookups,
|
||||
* <p>Only fully transparent proxies, for example, for redirection or service lookups,
|
||||
* are supposed to implement this interface. Proxies that decorate the target
|
||||
* object with new behavior, such as AOP proxies, do <i>not</i> qualify here!
|
||||
*
|
||||
|
||||
@@ -121,7 +121,7 @@ public class MethodParameter {
|
||||
* return type; 0 for the first method parameter; 1 for the second method
|
||||
* parameter, etc.
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* (typically 1; for example, in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
*/
|
||||
public MethodParameter(Method method, int parameterIndex, int nestingLevel) {
|
||||
@@ -145,7 +145,7 @@ public class MethodParameter {
|
||||
* @param constructor the Constructor to specify a parameter for
|
||||
* @param parameterIndex the index of the parameter
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* (typically 1; for example, in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
*/
|
||||
public MethodParameter(Constructor<?> constructor, int parameterIndex, int nestingLevel) {
|
||||
@@ -296,7 +296,7 @@ public class MethodParameter {
|
||||
|
||||
/**
|
||||
* Return the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* (typically 1; for example, in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List).
|
||||
*/
|
||||
public int getNestingLevel() {
|
||||
@@ -415,7 +415,7 @@ public class MethodParameter {
|
||||
|
||||
/**
|
||||
* Check whether this method parameter 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}.
|
||||
*/
|
||||
private boolean hasNullableAnnotation() {
|
||||
@@ -443,7 +443,7 @@ public class MethodParameter {
|
||||
* Return a variant of this {@code MethodParameter} which refers to the
|
||||
* given containing class.
|
||||
* @param containingClass a specific containing class (potentially a
|
||||
* subclass of the declaring class, e.g. substituting a type variable)
|
||||
* subclass of the declaring class, for example, substituting a type variable)
|
||||
* @since 5.2
|
||||
* @see #getParameterType()
|
||||
*/
|
||||
@@ -862,7 +862,7 @@ public class MethodParameter {
|
||||
|
||||
/**
|
||||
* Create a new MethodParameter for the given field-aware constructor,
|
||||
* e.g. on a data class or record type.
|
||||
* for example, on a data class or record type.
|
||||
* <p>A field-aware method parameter will detect field annotations as well,
|
||||
* as long as the field name matches the parameter name.
|
||||
* @param ctor the Constructor to specify a parameter for
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class ParameterizedTypeReference<T> {
|
||||
/**
|
||||
* Build a {@code ParameterizedTypeReference} wrapping the given type.
|
||||
* @param type a generic type (possibly obtained via reflection,
|
||||
* e.g. from {@link java.lang.reflect.Method#getGenericReturnType()})
|
||||
* for example, from {@link java.lang.reflect.Method#getGenericReturnType()})
|
||||
* @return a corresponding reference which may be passed into
|
||||
* {@code ParameterizedTypeReference}-accepting methods
|
||||
* @since 4.3.12
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* A registry of adapters to adapt Reactive Streams {@link Publisher} to/from various
|
||||
* async/reactive types such as {@code CompletableFuture}, RxJava {@code Flowable}, etc.
|
||||
* This is designed to complement Spring's Reactor {@code Mono}/{@code Flux} support while
|
||||
* also being usable without Reactor, e.g. just for {@code org.reactivestreams} bridging.
|
||||
* also being usable without Reactor, for example, just for {@code org.reactivestreams} bridging.
|
||||
*
|
||||
* <p>By default, depending on classpath availability, adapters are registered for Reactor
|
||||
* (including {@code CompletableFuture} and {@code Flow.Publisher} adapters), RxJava 3,
|
||||
|
||||
@@ -105,7 +105,7 @@ public final class ReactiveTypeDescriptor {
|
||||
|
||||
/**
|
||||
* Whether the underlying operation is deferred and needs to be started
|
||||
* explicitly, e.g. via subscribing (or similar), or whether it is triggered
|
||||
* explicitly, for example, via subscribing (or similar), or whether it is triggered
|
||||
* without the consumer having any control.
|
||||
* @since 5.2.7
|
||||
*/
|
||||
|
||||
@@ -711,7 +711,7 @@ public class ResolvableType implements Serializable {
|
||||
* <p>The {@code typeIndexesPerLevel} map can be used to reference a specific generic
|
||||
* for the given level. For example, an index of 0 would refer to a {@code Map} key;
|
||||
* whereas, 1 would refer to the value. If the map does not contain a value for a
|
||||
* specific level the last generic will be used (e.g. a {@code Map} value).
|
||||
* specific level the last generic will be used (for example, a {@code Map} value).
|
||||
* <p>Nesting levels may also apply to array types; for example given
|
||||
* {@code String[]}, a nesting level of 2 refers to {@code String}.
|
||||
* <p>If a type does not {@link #hasGenerics() contain} generics the
|
||||
@@ -1029,7 +1029,7 @@ public class ResolvableType implements Serializable {
|
||||
/**
|
||||
* Check for type-level equality with another {@code ResolvableType}.
|
||||
* <p>In contrast to {@link #equals(Object)} or {@link #isAssignableFrom(ResolvableType)},
|
||||
* this works between different sources as well, e.g. method parameters and return types.
|
||||
* this works between different sources as well, for example, method parameters and return types.
|
||||
* @param otherType the {@code ResolvableType} to match against
|
||||
* @return whether the declared type and type variables match
|
||||
* @since 6.1
|
||||
|
||||
@@ -105,12 +105,12 @@ final class SerializableTypeWrapper {
|
||||
static Type forTypeProvider(TypeProvider provider) {
|
||||
Type providedType = provider.getType();
|
||||
if (providedType == null || providedType instanceof Serializable) {
|
||||
// No serializable type wrapping necessary (e.g. for java.lang.Class)
|
||||
// No serializable type wrapping necessary (for example, for java.lang.Class)
|
||||
return providedType;
|
||||
}
|
||||
if (NativeDetector.inNativeImage() || !Serializable.class.isAssignableFrom(Class.class)) {
|
||||
// Let's skip any wrapping attempts if types are generally not serializable in
|
||||
// the current runtime environment (even java.lang.Class itself, e.g. on GraalVM native images)
|
||||
// the current runtime environment (even java.lang.Class itself, for example, on GraalVM native images)
|
||||
return providedType;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by a reloading-aware ClassLoader
|
||||
* (e.g. a Groovy-based ClassLoader). Detected for example by
|
||||
* (for example, a Groovy-based ClassLoader). Detected for example by
|
||||
* Spring's CGLIB proxy factory for making a caching decision.
|
||||
*
|
||||
* <p>If a ClassLoader does <i>not</i> implement this interface,
|
||||
@@ -54,7 +54,7 @@ public interface SmartClassLoader {
|
||||
* In case of a reloadable or other selectively overriding ClassLoader which
|
||||
* commonly deals with unaffected classes from a base application class loader,
|
||||
* this should get implemented to return the original ClassLoader that the
|
||||
* present loader got derived from (e.g. through {@code return getParent();}).
|
||||
* present loader got derived from (for example, through {@code return getParent();}).
|
||||
* <p>This gets specifically used in Spring's AOP framework to determine the
|
||||
* class loader for a specific proxy in case the target class has not been
|
||||
* defined in the present class loader. In case of a reloadable class loader,
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
|
||||
*
|
||||
* <p>This is an alternative way to set Spring-related system properties such as
|
||||
* "spring.getenv.ignore" and "spring.beaninfo.ignore", in particular for scenarios
|
||||
* where JVM system properties are locked on the target platform (e.g. WebSphere).
|
||||
* where JVM system properties are locked on the target platform (for example, WebSphere).
|
||||
* See {@link #setFlag} for a convenient way to locally set such flags to "true".
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -48,9 +48,9 @@ import org.springframework.util.StringUtils;
|
||||
* <p>Note that most of the features of this class are not provided by the
|
||||
* JDK's introspection facilities themselves.
|
||||
*
|
||||
* <p>As a general rule for runtime-retained application annotations (e.g. for
|
||||
* <p>As a general rule for runtime-retained application annotations (for example, for
|
||||
* transaction control, authorization, or service exposure), always use the
|
||||
* lookup methods on this class (e.g. {@link #findAnnotation(Method, Class)} or
|
||||
* lookup methods on this class (for example, {@link #findAnnotation(Method, Class)} or
|
||||
* {@link #getAnnotation(Method, Class)}) instead of the plain annotation lookup
|
||||
* methods in the JDK. You can still explicitly choose between a <em>get</em>
|
||||
* lookup on the given class level only ({@link #getAnnotation(Method, Class)})
|
||||
@@ -259,7 +259,7 @@ public abstract class AnnotationUtils {
|
||||
* <p>Meta-annotations will <em>not</em> be searched.
|
||||
* @param annotatedElement the Method, Constructor or Field to retrieve annotations from
|
||||
* @return the annotations found, an empty array, or {@code null} if not
|
||||
* resolvable (e.g. because nested Class values in annotation attributes
|
||||
* resolvable (for example, because nested Class values in annotation attributes
|
||||
* failed to resolve at runtime)
|
||||
* @since 4.0.8
|
||||
* @see AnnotatedElement#getAnnotations()
|
||||
@@ -284,7 +284,7 @@ public abstract class AnnotationUtils {
|
||||
* <p>Meta-annotations will <em>not</em> be searched.
|
||||
* @param method the Method to retrieve annotations from
|
||||
* @return the annotations found, an empty array, or {@code null} if not
|
||||
* resolvable (e.g. because nested Class values in annotation attributes
|
||||
* resolvable (for example, because nested Class values in annotation attributes
|
||||
* failed to resolve at runtime)
|
||||
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod(Method)
|
||||
* @see AnnotatedElement#getAnnotations()
|
||||
@@ -569,7 +569,7 @@ public abstract class AnnotationUtils {
|
||||
return annotation;
|
||||
}
|
||||
// For backwards compatibility, perform a superclass search with plain annotations
|
||||
// even if not marked as @Inherited: e.g. a findAnnotation search for @Deprecated
|
||||
// even if not marked as @Inherited: for example, a findAnnotation search for @Deprecated
|
||||
Class<?> superclass = clazz.getSuperclass();
|
||||
if (superclass == null || superclass == Object.class) {
|
||||
return null;
|
||||
|
||||
@@ -87,7 +87,7 @@ public abstract class OrderUtils {
|
||||
/**
|
||||
* Return the order declared on the specified {@code element}.
|
||||
* <p>Takes care of {@link Order @Order} and {@code @jakarta.annotation.Priority}.
|
||||
* @param element the annotated element (e.g. type or method)
|
||||
* @param element the annotated element (for example, type or method)
|
||||
* @return the order value, or {@code null} if none can be found
|
||||
* @since 5.3
|
||||
*/
|
||||
|
||||
@@ -55,7 +55,7 @@ public class SynthesizingMethodParameter extends MethodParameter {
|
||||
* return type; 0 for the first method parameter; 1 for the second method
|
||||
* parameter, etc.
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* (typically 1; for example, in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
*/
|
||||
public SynthesizingMethodParameter(Method method, int parameterIndex, int nestingLevel) {
|
||||
@@ -77,7 +77,7 @@ public class SynthesizingMethodParameter extends MethodParameter {
|
||||
* @param constructor the Constructor to specify a parameter for
|
||||
* @param parameterIndex the index of the parameter
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* (typically 1; for example, in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
*/
|
||||
public SynthesizingMethodParameter(Constructor<?> constructor, int parameterIndex, int nestingLevel) {
|
||||
|
||||
@@ -38,8 +38,8 @@ import org.springframework.util.MimeType;
|
||||
* {@link #decodeToMono} applies "reduce" and transforms the aggregated buffer.
|
||||
*
|
||||
* <p>Sub-classes can override {@link #decode} in order to split the input stream
|
||||
* along different boundaries (e.g. on new line characters for {@code String})
|
||||
* or always reduce to a single data buffer (e.g. {@code Resource}).
|
||||
* along different boundaries (for example, on new line characters for {@code String})
|
||||
* or always reduce to a single data buffer (for example, {@code Resource}).
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
@@ -61,7 +61,7 @@ public abstract class AbstractDataBufferDecoder<T> extends AbstractDecoder<T> {
|
||||
* decoding to a single {@code DataBuffer},
|
||||
* {@link java.nio.ByteBuffer ByteBuffer}, {@code byte[]},
|
||||
* {@link org.springframework.core.io.Resource Resource}, {@code String}, etc.
|
||||
* It can also occur when splitting the input stream, e.g. delimited text,
|
||||
* It can also occur when splitting the input stream, for example, delimited text,
|
||||
* in which case the limit applies to data buffered between delimiters.
|
||||
* <p>By default this is set to 256K.
|
||||
* @param byteCount the max number of bytes to buffer, or -1 for unlimited
|
||||
|
||||
@@ -74,7 +74,7 @@ public interface Encoder<T> {
|
||||
* in fully aggregated form.
|
||||
* <p>By default this method raises {@link UnsupportedOperationException}
|
||||
* and it is expected that some encoders cannot produce a single buffer or
|
||||
* cannot do so synchronously (e.g. encoding a {@code Resource}).
|
||||
* cannot do so synchronously (for example, encoding a {@code Resource}).
|
||||
* @param value the value to be encoded
|
||||
* @param bufferFactory for creating the output {@code DataBuffer}
|
||||
* @param valueType the type for the value being encoded
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class Hints {
|
||||
/**
|
||||
* Name of boolean hint whether to avoid logging data either because it's
|
||||
* potentially sensitive, or because it has been logged by a composite
|
||||
* encoder, e.g. for multipart requests.
|
||||
* encoder, for example, for multipart requests.
|
||||
*/
|
||||
public static final String SUPPRESS_LOGGING_HINT = Log.class.getName() + ".SUPPRESS_LOGGING";
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.util.MimeTypeUtils;
|
||||
*/
|
||||
public class ResourceDecoder extends AbstractDataBufferDecoder<Resource> {
|
||||
|
||||
/** Name of hint with a filename for the resource(e.g. from "Content-Disposition" HTTP header). */
|
||||
/** Name of hint with a filename for the resource(for example, from "Content-Disposition" HTTP header). */
|
||||
public static final String FILENAME_HINT = ResourceDecoder.class.getName() + ".filename";
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* A description of a JavaBeans Property that allows us to avoid a dependency on
|
||||
* {@code java.beans.PropertyDescriptor}. The {@code java.beans} package
|
||||
* is not available in a number of environments (e.g. Android, Java ME), so this is
|
||||
* is not available in a number of environments (for example, Android, Java ME), so this is
|
||||
* desirable for portability of Spring's core conversion facility.
|
||||
*
|
||||
* <p>Used to build a {@link TypeDescriptor} from a property location. The built
|
||||
@@ -89,21 +89,21 @@ public final class Property {
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the property: e.g. 'foo'
|
||||
* The name of the property: for example, 'foo'.
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The property type: e.g. {@code java.lang.String}
|
||||
* The property type: for example, {@code java.lang.String}.
|
||||
*/
|
||||
public Class<?> getType() {
|
||||
return this.methodParameter.getParameterType();
|
||||
}
|
||||
|
||||
/**
|
||||
* The property getter method: e.g. {@code getFoo()}
|
||||
* The property getter method: for example, {@code getFoo()}.
|
||||
*/
|
||||
@Nullable
|
||||
public Method getReadMethod() {
|
||||
@@ -111,7 +111,7 @@ public final class Property {
|
||||
}
|
||||
|
||||
/**
|
||||
* The property setter method: e.g. {@code setFoo(String)}
|
||||
* The property setter method: for example, {@code setFoo(String)}.
|
||||
*/
|
||||
@Nullable
|
||||
public Method getWriteMethod() {
|
||||
@@ -147,7 +147,7 @@ public final class Property {
|
||||
index += 2;
|
||||
}
|
||||
else {
|
||||
// Record-style plain accessor method, e.g. name()
|
||||
// Record-style plain accessor method, for example, name()
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class DefaultConversionService extends GenericConversionService {
|
||||
/**
|
||||
* Add converters appropriate for most environments.
|
||||
* @param converterRegistry the registry of converters to add to
|
||||
* (must also be castable to ConversionService, e.g. being a {@link ConfigurableConversionService})
|
||||
* (must also be castable to ConversionService, for example, being a {@link ConfigurableConversionService})
|
||||
* @throws ClassCastException if the given ConverterRegistry could not be cast to a ConversionService
|
||||
*/
|
||||
public static void addDefaultConverters(ConverterRegistry converterRegistry) {
|
||||
@@ -104,7 +104,7 @@ public class DefaultConversionService extends GenericConversionService {
|
||||
/**
|
||||
* Add common collection converters.
|
||||
* @param converterRegistry the registry of converters to add to
|
||||
* (must also be castable to ConversionService, e.g. being a {@link ConfigurableConversionService})
|
||||
* (must also be castable to ConversionService, for example, being a {@link ConfigurableConversionService})
|
||||
* @throws ClassCastException if the given ConverterRegistry could not be cast to a ConversionService
|
||||
* @since 4.2.3
|
||||
*/
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
* System property that instructs Spring to ignore system environment variables,
|
||||
* i.e. to never attempt to retrieve such a variable via {@link System#getenv()}.
|
||||
* <p>The default is "false", falling back to system environment variable checks if a
|
||||
* Spring environment property (e.g. a placeholder in a configuration String) isn't
|
||||
* Spring environment property (for example, a placeholder in a configuration String) isn't
|
||||
* resolvable otherwise. Consider switching this flag to "true" if you experience
|
||||
* log warnings from {@code getenv} calls coming from Spring.
|
||||
* @see #suppressGetenvAccess()
|
||||
|
||||
@@ -296,12 +296,12 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou
|
||||
* Return the collection of values associated with the command line option having the
|
||||
* given name.
|
||||
* <ul>
|
||||
* <li>if the option is present and has no argument (e.g.: "--foo"), return an empty
|
||||
* <li>if the option is present and has no argument (for example: "--foo"), return an empty
|
||||
* collection ({@code []})</li>
|
||||
* <li>if the option is present and has a single value (e.g. "--foo=bar"), return a
|
||||
* <li>if the option is present and has a single value (for example, "--foo=bar"), return a
|
||||
* collection having one element ({@code ["bar"]})</li>
|
||||
* <li>if the option is present and the underlying command line parsing library
|
||||
* supports multiple arguments (e.g. "--foo=bar --foo=baz"), return a collection
|
||||
* supports multiple arguments (for example, "--foo=bar --foo=baz"), return a collection
|
||||
* having elements for each value ({@code ["bar", "baz"]})</li>
|
||||
* <li>if the option is not present, return {@code null}</li>
|
||||
* </ul>
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* Composite {@link PropertySource} implementation that iterates over a set of
|
||||
* {@link PropertySource} instances. Necessary in cases where multiple property sources
|
||||
* share the same name, e.g. when multiple values are supplied to {@code @PropertySource}.
|
||||
* share the same name, for example, when multiple values are supplied to {@code @PropertySource}.
|
||||
*
|
||||
* <p>As of Spring 4.1.2, this class extends {@link EnumerablePropertySource} instead
|
||||
* of plain {@link PropertySource}, exposing {@link #getPropertyNames()} based on the
|
||||
|
||||
@@ -143,7 +143,7 @@ public interface ConfigurableEnvironment extends Environment, ConfigurableProper
|
||||
* parent and child, the child instance is to be preserved and the parent instance
|
||||
* discarded. This has the effect of allowing overriding of property sources by the
|
||||
* child as well as avoiding redundant searches through common property source types,
|
||||
* e.g. system environment and system properties.
|
||||
* for example, system environment and system properties.
|
||||
* <p>Active and default profile names are also filtered for duplicates, to avoid
|
||||
* confusion and redundant storage.
|
||||
* <p>The parent environment remains unmodified in any case. Note that any changes to
|
||||
|
||||
@@ -42,7 +42,7 @@ package org.springframework.core.env;
|
||||
* {@link ConfigurableEnvironment} Javadoc for usage examples.
|
||||
*
|
||||
* <p>See {@link SystemEnvironmentPropertySource} javadoc for details on special handling
|
||||
* of property names in shell environments (e.g. Bash) that disallow period characters in
|
||||
* of property names in shell environments (for example, Bash) that disallow period characters in
|
||||
* variable names.
|
||||
*
|
||||
* @author Chris Beams
|
||||
|
||||
@@ -146,7 +146,7 @@ public abstract class AbstractResource implements Resource {
|
||||
/**
|
||||
* This method reads the entire InputStream to determine the content length.
|
||||
* <p>For a custom subclass of {@code InputStreamResource}, we strongly
|
||||
* recommend overriding this method with a more optimal implementation, e.g.
|
||||
* recommend overriding this method with a more optimal implementation, for example,
|
||||
* checking File length, or possibly simply returning -1 if the stream can
|
||||
* only be read once.
|
||||
* @see #getInputStream()
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.core.io;
|
||||
|
||||
/**
|
||||
* Extended interface for a resource that is loaded from an enclosing
|
||||
* 'context', e.g. from a {@link jakarta.servlet.ServletContext} but also
|
||||
* 'context', for example, from a {@link jakarta.servlet.ServletContext} but also
|
||||
* from plain classpath paths or relative file system paths (specified
|
||||
* without an explicit prefix, hence applying relative to the local
|
||||
* {@link ResourceLoader}'s context).
|
||||
@@ -32,7 +32,7 @@ public interface ContextResource extends Resource {
|
||||
/**
|
||||
* Return the path within the enclosing 'context'.
|
||||
* <p>This is typically path relative to a context-specific root directory,
|
||||
* e.g. a ServletContext root or a PortletContext root.
|
||||
* for example, a ServletContext root or a PortletContext root.
|
||||
*/
|
||||
String getPathWithinContext();
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public class DefaultResourceLoader implements ResourceLoader {
|
||||
|
||||
/**
|
||||
* Obtain a cache for the given value type, keyed by {@link Resource}.
|
||||
* @param valueType the value type, e.g. an ASM {@code MetadataReader}
|
||||
* @param valueType the value type, for example, an ASM {@code MetadataReader}
|
||||
* @return the cache {@link Map}, shared at the {@code ResourceLoader} level
|
||||
* @since 5.0
|
||||
*/
|
||||
@@ -176,7 +176,7 @@ public class DefaultResourceLoader implements ResourceLoader {
|
||||
* Return a Resource handle for the resource at the given path.
|
||||
* <p>The default implementation supports class path locations. This should
|
||||
* be appropriate for standalone implementations but can be overridden,
|
||||
* e.g. for implementations targeted at a Servlet container.
|
||||
* for example, for implementations targeted at a Servlet container.
|
||||
* @param path the path to the resource
|
||||
* @return the corresponding Resource handle
|
||||
* @see ClassPathResource
|
||||
|
||||
@@ -74,7 +74,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
|
||||
* <p>Note: When building relative resources via {@link #createRelative},
|
||||
* it makes a difference whether the specified resource base path here
|
||||
* ends with a slash or not. In the case of "C:/dir1/", relative paths
|
||||
* will be built underneath that root: e.g. relative path "dir2" →
|
||||
* will be built underneath that root: for example, relative path "dir2" →
|
||||
* "C:/dir1/dir2". In the case of "C:/dir1", relative paths will apply
|
||||
* at the same directory level: relative path "dir2" → "C:/dir2".
|
||||
* @param path a file path
|
||||
@@ -91,7 +91,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
|
||||
* Create a new {@code FileSystemResource} from a {@link File} handle.
|
||||
* <p>Note: When building relative resources via {@link #createRelative},
|
||||
* the relative path will apply <i>at the same directory level</i>:
|
||||
* e.g. new File("C:/dir1"), relative path "dir2" → "C:/dir2"!
|
||||
* for example, new File("C:/dir1"), relative path "dir2" → "C:/dir2"!
|
||||
* If you prefer to have relative paths built underneath the given root directory,
|
||||
* use the {@link #FileSystemResource(String) constructor with a file path}
|
||||
* to append a trailing slash to the root path: "C:/dir1/", which indicates
|
||||
@@ -115,7 +115,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
|
||||
* path cleaning and {@link #createRelative(String)} handling.
|
||||
* <p>Note: When building relative resources via {@link #createRelative},
|
||||
* the relative path will apply <i>at the same directory level</i>:
|
||||
* e.g. Paths.get("C:/dir1"), relative path "dir2" → "C:/dir2"!
|
||||
* for example, Paths.get("C:/dir1"), relative path "dir2" → "C:/dir2"!
|
||||
* If you prefer to have relative paths built underneath the given root directory,
|
||||
* use the {@link #FileSystemResource(String) constructor with a file path}
|
||||
* to append a trailing slash to the root path: "C:/dir1/", which indicates
|
||||
|
||||
@@ -65,7 +65,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
||||
* Create a new {@code PathResource} from a {@link Path} handle.
|
||||
* <p>Note: Unlike {@link FileSystemResource}, when building relative resources
|
||||
* via {@link #createRelative}, the relative path will be built <i>underneath</i>
|
||||
* the given root: e.g. Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"!
|
||||
* the given root: for example, Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"!
|
||||
* @param path a Path handle
|
||||
*/
|
||||
public PathResource(Path path) {
|
||||
@@ -77,7 +77,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
||||
* Create a new {@code PathResource} from a path string.
|
||||
* <p>Note: Unlike {@link FileSystemResource}, when building relative resources
|
||||
* via {@link #createRelative}, the relative path will be built <i>underneath</i>
|
||||
* the given root: e.g. Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"!
|
||||
* the given root: for example, Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"!
|
||||
* @param path a path
|
||||
* @see java.nio.file.Paths#get(String, String...)
|
||||
*/
|
||||
@@ -90,7 +90,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
||||
* Create a new {@code PathResource} from a {@link URI}.
|
||||
* <p>Note: Unlike {@link FileSystemResource}, when building relative resources
|
||||
* via {@link #createRelative}, the relative path will be built <i>underneath</i>
|
||||
* the given root: e.g. Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"!
|
||||
* the given root: for example, Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"!
|
||||
* @param uri a path URI
|
||||
* @see java.nio.file.Paths#get(URI)
|
||||
*/
|
||||
|
||||
@@ -28,12 +28,12 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* {@link java.beans.PropertyEditor Editor} for {@link Resource}
|
||||
* descriptors, to automatically convert {@code String} locations
|
||||
* e.g. {@code file:C:/myfile.txt} or {@code classpath:myfile.txt} to
|
||||
* for example, {@code file:C:/myfile.txt} or {@code classpath:myfile.txt} to
|
||||
* {@code Resource} properties instead of using a {@code String} location property.
|
||||
*
|
||||
* <p>The path may contain {@code ${...}} placeholders, to be
|
||||
* resolved as {@link org.springframework.core.env.Environment} properties:
|
||||
* e.g. {@code ${user.dir}}. Unresolvable placeholders are ignored by default.
|
||||
* for example, {@code ${user.dir}}. Unresolvable placeholders are ignored by default.
|
||||
*
|
||||
* <p>Delegates to a {@link ResourceLoader} to do the heavy lifting,
|
||||
* by default using a {@link DefaultResourceLoader}.
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
|
||||
/**
|
||||
* Strategy interface for loading resources (e.g., class path or file system
|
||||
* Strategy interface for loading resources (for example, class path or file system
|
||||
* resources). An {@link org.springframework.context.ApplicationContext}
|
||||
* is required to provide this functionality plus extended
|
||||
* {@link org.springframework.core.io.support.ResourcePatternResolver} support.
|
||||
@@ -50,9 +50,9 @@ public interface ResourceLoader {
|
||||
* <p>The handle should always be a reusable resource descriptor,
|
||||
* allowing for multiple {@link Resource#getInputStream()} calls.
|
||||
* <p><ul>
|
||||
* <li>Must support fully qualified URLs, e.g. "file:C:/test.dat".
|
||||
* <li>Must support classpath pseudo-URLs, e.g. "classpath:test.dat".
|
||||
* <li>Should support relative file paths, e.g. "WEB-INF/test.dat".
|
||||
* <li>Must support fully qualified URLs, for example, "file:C:/test.dat".
|
||||
* <li>Must support classpath pseudo-URLs, for example, "classpath:test.dat".
|
||||
* <li>Should support relative file paths, for example, "WEB-INF/test.dat".
|
||||
* (This will be implementation-specific, typically provided by an
|
||||
* ApplicationContext implementation.)
|
||||
* </ul>
|
||||
|
||||
@@ -123,9 +123,9 @@ public class UrlResource extends AbstractFileResolvingResource {
|
||||
/**
|
||||
* Create a new {@code UrlResource} based on a URI specification.
|
||||
* <p>The given parts will automatically get encoded if necessary.
|
||||
* @param protocol the URL protocol to use (e.g. "jar" or "file" - without colon);
|
||||
* @param protocol the URL protocol to use (for example, "jar" or "file" - without colon);
|
||||
* also known as "scheme"
|
||||
* @param location the location (e.g. the file path within that protocol);
|
||||
* @param location the location (for example, the file path within that protocol);
|
||||
* also known as "scheme-specific part"
|
||||
* @throws MalformedURLException if the given URL specification is not valid
|
||||
* @see java.net.URI#URI(String, String, String)
|
||||
@@ -137,11 +137,11 @@ public class UrlResource extends AbstractFileResolvingResource {
|
||||
/**
|
||||
* Create a new {@code UrlResource} based on a URI specification.
|
||||
* <p>The given parts will automatically get encoded if necessary.
|
||||
* @param protocol the URL protocol to use (e.g. "jar" or "file" - without colon);
|
||||
* @param protocol the URL protocol to use (for example, "jar" or "file" - without colon);
|
||||
* also known as "scheme"
|
||||
* @param location the location (e.g. the file path within that protocol);
|
||||
* @param location the location (for example, the file path within that protocol);
|
||||
* also known as "scheme-specific part"
|
||||
* @param fragment the fragment within that location (e.g. anchor on an HTML page,
|
||||
* @param fragment the fragment within that location (for example, anchor on an HTML page,
|
||||
* as following after a "#" separator)
|
||||
* @throws MalformedURLException if the given URL specification is not valid
|
||||
* @see java.net.URI#URI(String, String, String)
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.springframework.core.io.buffer;
|
||||
/**
|
||||
* Exception that indicates the cumulative number of bytes consumed from a
|
||||
* stream of {@link DataBuffer DataBuffer}'s exceeded some pre-configured limit.
|
||||
* This can be raised when data buffers are cached and aggregated, e.g.
|
||||
* This can be raised when data buffers are cached and aggregated, for example,
|
||||
* {@link DataBufferUtils#join}. Or it could also be raised when data buffers
|
||||
* have been released but a parsed representation is being aggregated, e.g. async
|
||||
* have been released but a parsed representation is being aggregated, for example, async
|
||||
* parsing with Jackson, SSE parsing and aggregating lines per event.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
||||
@@ -26,7 +26,7 @@ import reactor.core.publisher.Flux;
|
||||
/**
|
||||
* Custom {@link List} to collect data buffers with and enforce a
|
||||
* limit on the total number of bytes buffered. For use with "collect" or
|
||||
* other buffering operators in declarative APIs, e.g. {@link Flux}.
|
||||
* other buffering operators in declarative APIs, for example, {@link Flux}.
|
||||
*
|
||||
* <p>Adding elements increases the byte count and if the limit is exceeded,
|
||||
* {@link DataBufferLimitException} is raised. {@link #clear()} resets the
|
||||
|
||||
@@ -82,7 +82,7 @@ public class LocalizedResourceHelper {
|
||||
* <p>If none of the specific files can be found, a resource
|
||||
* descriptor for the default location will be returned.
|
||||
* @param name the name of the file, without localization part nor extension
|
||||
* @param extension the file extension (e.g. ".xls")
|
||||
* @param extension the file extension (for example, ".xls")
|
||||
* @param locale the current locale (may be {@code null})
|
||||
* @return the most specific localized resource found
|
||||
* @see java.util.ResourceBundle
|
||||
|
||||
@@ -91,7 +91,7 @@ import org.springframework.util.StringUtils;
|
||||
* Examples are real URLs such as "{@code file:C:/context.xml}", pseudo-URLs
|
||||
* such as "{@code classpath:/context.xml}", and simple unprefixed paths
|
||||
* such as "{@code /WEB-INF/context.xml}". The latter will resolve in a
|
||||
* fashion specific to the underlying {@code ResourceLoader} (e.g.
|
||||
* fashion specific to the underlying {@code ResourceLoader} (for example,
|
||||
* {@code ServletContextResource} for a {@code WebApplicationContext}).
|
||||
*
|
||||
* <h3>Ant-style Patterns</h3>
|
||||
@@ -105,7 +105,7 @@ import org.springframework.util.StringUtils;
|
||||
* the resolver follows a more complex but defined procedure to try to resolve
|
||||
* the wildcard. It produces a {@code Resource} for the path up to the last
|
||||
* non-wildcard segment and obtains a {@code URL} from it. If this URL is not a
|
||||
* "{@code jar:}" URL or container-specific variant (e.g. "{@code zip:}" in WebLogic,
|
||||
* "{@code jar:}" URL or container-specific variant (for example, "{@code zip:}" in WebLogic,
|
||||
* "{@code wsjar}" in WebSphere", etc.), then the root directory of the filesystem
|
||||
* associated with the URL is obtained and used to resolve the wildcards by walking
|
||||
* the filesystem. In the case of a jar URL, the resolver either gets a
|
||||
@@ -235,7 +235,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
|
||||
static {
|
||||
try {
|
||||
// Detect Equinox OSGi (e.g. on WebSphere 6.1)
|
||||
// Detect Equinox OSGi (for example, on WebSphere 6.1)
|
||||
Class<?> fileLocatorClass = ClassUtils.forName("org.eclipse.core.runtime.FileLocator",
|
||||
PathMatchingResourcePatternResolver.class.getClassLoader());
|
||||
equinoxResolveMethod = fileLocatorClass.getMethod("resolve", URL.class);
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class PropertiesLoaderSupport {
|
||||
|
||||
|
||||
/**
|
||||
* Set local properties, e.g. via the "props" tag in XML bean definitions.
|
||||
* Set local properties, for example, via the "props" tag in XML bean definitions.
|
||||
* These can be considered defaults, to be overridden by properties
|
||||
* loaded from files.
|
||||
*/
|
||||
@@ -70,7 +70,7 @@ public abstract class PropertiesLoaderSupport {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set local properties, e.g. via the "props" tag in XML bean definitions,
|
||||
* Set local properties, for example, via the "props" tag in XML bean definitions,
|
||||
* allowing for merging multiple properties sets into one.
|
||||
*/
|
||||
public void setPropertiesArray(Properties... propertiesArray) {
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface PropertySourceFactory {
|
||||
* <p>Implementations will typically create {@link ResourcePropertySource}
|
||||
* instances, with {@link PropertySourceProcessor} automatically adapting
|
||||
* property source names via {@link ResourcePropertySource#withResourceName()}
|
||||
* if necessary, e.g. when combining multiple sources for the same name
|
||||
* if necessary, for example, when combining multiple sources for the same name
|
||||
* into a {@link org.springframework.core.env.CompositePropertySource}.
|
||||
* Custom implementations with custom {@link PropertySource} types need
|
||||
* to make sure to expose distinct enough names, possibly deriving from
|
||||
|
||||
@@ -38,13 +38,13 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* Editor for {@link org.springframework.core.io.Resource} arrays, to
|
||||
* automatically convert {@code String} location patterns
|
||||
* (e.g. {@code "file:C:/my*.txt"} or {@code "classpath*:myfile.txt"})
|
||||
* (for example, {@code "file:C:/my*.txt"} or {@code "classpath*:myfile.txt"})
|
||||
* to {@code Resource} array properties. Can also translate a collection
|
||||
* or array of location patterns into a merged Resource array.
|
||||
*
|
||||
* <p>A path may contain {@code ${...}} placeholders, to be
|
||||
* resolved as {@link org.springframework.core.env.Environment} properties:
|
||||
* e.g. {@code ${user.dir}}. Unresolvable placeholders are ignored by default.
|
||||
* for example, {@code ${user.dir}}. Unresolvable placeholders are ignored by default.
|
||||
*
|
||||
* <p>Delegates to a {@link ResourcePatternResolver},
|
||||
* by default using a {@link PathMatchingResourcePatternResolver}.
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class LogDelegateFactory {
|
||||
* secondary logger if logging for the primary logger is not enabled.
|
||||
* <p>This may be used for fallback logging from lower-level packages that
|
||||
* logically should log together with some higher-level package but the two
|
||||
* don't happen to share a suitable parent package (e.g. logging for the web
|
||||
* don't happen to share a suitable parent package (for example, logging for the web
|
||||
* and lower-level http and codec packages). For such cases the primary
|
||||
* (class-based) logger can be wrapped with a shared fallback logger.
|
||||
* @param primaryLogger primary logger to try first
|
||||
|
||||
@@ -43,8 +43,8 @@ public class VirtualThreadTaskExecutor implements AsyncTaskExecutor {
|
||||
|
||||
/**
|
||||
* Create a new {@code VirtualThreadTaskExecutor} with thread names based
|
||||
* on the given thread name prefix followed by a counter (e.g. "test-0").
|
||||
* @param threadNamePrefix the prefix for thread names (e.g. "test-")
|
||||
* on the given thread name prefix followed by a counter (for example, "test-0").
|
||||
* @param threadNamePrefix the prefix for thread names (for example, "test-")
|
||||
*/
|
||||
public VirtualThreadTaskExecutor(String threadNamePrefix) {
|
||||
this.virtualThreadFactory = new VirtualThreadDelegate().virtualThreadFactory(threadNamePrefix);
|
||||
|
||||
@@ -83,7 +83,7 @@ public interface AnnotatedTypeMetadata {
|
||||
* @param annotationName the fully-qualified class name of the annotation
|
||||
* type to look for
|
||||
* @return a {@link Map} of attributes, with each annotation attribute name
|
||||
* as map key (e.g. "location") and the attribute's value as map value; or
|
||||
* as map key (for example, "location") and the attribute's value as map value; or
|
||||
* {@code null} if no matching annotation is found
|
||||
*/
|
||||
@Nullable
|
||||
@@ -103,7 +103,7 @@ public interface AnnotatedTypeMetadata {
|
||||
* class names for exposure as values in the returned Map, instead of Class
|
||||
* references which might potentially have to be loaded first
|
||||
* @return a {@link Map} of attributes, with each annotation attribute name
|
||||
* as map key (e.g. "location") and the attribute's value as map value; or
|
||||
* as map key (for example, "location") and the attribute's value as map value; or
|
||||
* {@code null} if no matching annotation is found
|
||||
*/
|
||||
@Nullable
|
||||
@@ -126,7 +126,7 @@ public interface AnnotatedTypeMetadata {
|
||||
* @param annotationName the fully-qualified class name of the annotation
|
||||
* type to look for
|
||||
* @return a {@link MultiValueMap} of attributes, with each annotation attribute
|
||||
* name as map key (e.g. "location") and a list of the attribute's values as
|
||||
* name as map key (for example, "location") and a list of the attribute's values as
|
||||
* map value; or {@code null} if no matching annotation is found
|
||||
* @see #getAllAnnotationAttributes(String, boolean)
|
||||
*/
|
||||
@@ -146,7 +146,7 @@ public interface AnnotatedTypeMetadata {
|
||||
* class names for exposure as values in the returned Map, instead of Class
|
||||
* references which might potentially have to be loaded first
|
||||
* @return a {@link MultiValueMap} of attributes, with each annotation attribute
|
||||
* name as map key (e.g. "location") and a list of the attribute's values as
|
||||
* name as map key (for example, "location") and a list of the attribute's values as
|
||||
* map value; or {@code null} if no matching annotation is found
|
||||
* @see #getAllAnnotationAttributes(String)
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* lower than {@code org.springframework.util}, with no Spring-specific concepts implied.
|
||||
*
|
||||
* <p>Used descriptively within the framework codebase. Can be validated by build-time tools
|
||||
* (e.g. FindBugs or Animal Sniffer), alternative JVM languages (e.g. Kotlin), as well as IDEs
|
||||
* (e.g. IntelliJ IDEA or Eclipse with corresponding project setup).
|
||||
* (for example, FindBugs or Animal Sniffer), alternative JVM languages (for example, Kotlin), as well as IDEs
|
||||
* (for example, IntelliJ IDEA or Eclipse with corresponding project setup).
|
||||
*/
|
||||
package org.springframework.lang;
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SpringObjenesis implements Objenesis {
|
||||
* @param clazz the class to create an instance of
|
||||
* @param useCache whether to use the instantiator cache
|
||||
* (typically {@code true} but can be set to {@code false}
|
||||
* e.g. for reloadable classes)
|
||||
* for example, for reloadable classes)
|
||||
* @return the new instance (never {@code null})
|
||||
* @throws ObjenesisException if instance creation failed
|
||||
*/
|
||||
|
||||
@@ -526,7 +526,7 @@ public class AntPathMatcher implements PathMatcher {
|
||||
/**
|
||||
* Combine two patterns into a new pattern.
|
||||
* <p>This implementation simply concatenates the two patterns, unless
|
||||
* the first pattern contains a file extension match (e.g., {@code *.html}).
|
||||
* the first pattern contains a file extension match (for example, {@code *.html}).
|
||||
* In that case, the second pattern will be merged into the first. Otherwise,
|
||||
* an {@code IllegalArgumentException} will be thrown.
|
||||
* <h4>Examples</h4>
|
||||
@@ -851,7 +851,7 @@ public class AntPathMatcher implements PathMatcher {
|
||||
|
||||
|
||||
/**
|
||||
* Value class that holds information about the pattern, e.g. number of
|
||||
* Value class that holds information about the pattern, for example, number of
|
||||
* occurrences of "*", "**", and "{" pattern elements.
|
||||
*/
|
||||
private static class PatternInfo {
|
||||
|
||||
@@ -267,9 +267,9 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Replacement for {@code Class.forName()} that also returns Class instances
|
||||
* for primitives (e.g. "int") and array class names (e.g. "String[]").
|
||||
* for primitives (for example, "int") and array class names (for example, "String[]").
|
||||
* Furthermore, it is also capable of resolving nested class names in Java source
|
||||
* style (e.g. "java.lang.Thread.State" instead of "java.lang.Thread$State").
|
||||
* style (for example, "java.lang.Thread.State" instead of "java.lang.Thread$State").
|
||||
* @param name the name of the Class
|
||||
* @param classLoader the class loader to use
|
||||
* (can be {@code null}, which indicates the default class loader)
|
||||
@@ -1101,7 +1101,7 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine the name of the class file, relative to the containing
|
||||
* package: e.g. "String.class"
|
||||
* package: for example, "String.class".
|
||||
* @param clazz the class
|
||||
* @return the file name of the ".class" file
|
||||
*/
|
||||
@@ -1114,7 +1114,7 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine the name of the package of the given class,
|
||||
* e.g. "java.lang" for the {@code java.lang.String} class.
|
||||
* for example, "java.lang" for the {@code java.lang.String} class.
|
||||
* @param clazz the class
|
||||
* @return the package name, or the empty String if the class
|
||||
* is defined in the default package
|
||||
@@ -1126,7 +1126,7 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine the name of the package of the given fully-qualified class name,
|
||||
* e.g. "java.lang" for the {@code java.lang.String} class name.
|
||||
* for example, "java.lang" for the {@code java.lang.String} class name.
|
||||
* @param fqClassName the fully-qualified class name
|
||||
* @return the package name, or the empty String if the class
|
||||
* is defined in the default package
|
||||
@@ -1452,7 +1452,7 @@ public abstract class ClassUtils {
|
||||
if (result == null && targetClass != null) {
|
||||
// No interface method found yet -> try given target class (possibly a subclass of the
|
||||
// declaring class, late-binding a base class method to a subclass-declared interface:
|
||||
// see e.g. HashMap.HashIterator.hasNext)
|
||||
// see, for example, HashMap.HashIterator.hasNext)
|
||||
result = findInterfaceMethodIfPossible(
|
||||
methodName, parameterTypes, targetClass, declaringClass, requirePublicInterface);
|
||||
}
|
||||
|
||||
@@ -701,7 +701,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
|
||||
|
||||
/**
|
||||
* A reference to an {@link Entry} contained in the map. Implementations are usually
|
||||
* wrappers around specific Java reference implementations (e.g., {@link SoftReference}).
|
||||
* wrappers around specific Java reference implementations (for example, {@link SoftReference}).
|
||||
* @param <K> the key type
|
||||
* @param <V> the value type
|
||||
*/
|
||||
|
||||
@@ -159,7 +159,7 @@ public class CustomizableThreadCreator implements Serializable {
|
||||
/**
|
||||
* Return the thread name to use for a newly created {@link Thread}.
|
||||
* <p>The default implementation returns the specified thread name prefix
|
||||
* with an increasing thread count appended: e.g. "SimpleAsyncTaskExecutor-0".
|
||||
* with an increasing thread count appended: for example, "SimpleAsyncTaskExecutor-0".
|
||||
* @see #getThreadNamePrefix()
|
||||
*/
|
||||
protected String nextThreadName() {
|
||||
|
||||
@@ -123,7 +123,7 @@ public class MethodInvoker {
|
||||
|
||||
/**
|
||||
* Set a fully qualified static method name to invoke,
|
||||
* e.g. "example.MyExampleClass.myExampleMethod". This is a
|
||||
* for example, "example.MyExampleClass.myExampleMethod". This is a
|
||||
* convenient alternative to specifying targetClass and targetMethod.
|
||||
* @see #setTargetClass
|
||||
* @see #setTargetMethod
|
||||
@@ -160,7 +160,7 @@ public class MethodInvoker {
|
||||
if (lastDotIndex == -1 || lastDotIndex == this.staticMethod.length() - 1) {
|
||||
throw new IllegalArgumentException(
|
||||
"staticMethod must be a fully qualified class plus method name: " +
|
||||
"e.g. 'example.MyExampleClass.myExampleMethod'");
|
||||
"for example, 'example.MyExampleClass.myExampleMethod'");
|
||||
}
|
||||
String className = this.staticMethod.substring(0, lastDotIndex);
|
||||
String methodName = this.staticMethod.substring(lastDotIndex + 1);
|
||||
|
||||
@@ -263,7 +263,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
|
||||
/**
|
||||
* Indicates whether the {@linkplain #getSubtype() subtype} is the wildcard
|
||||
* character <code>*</code> or the wildcard character followed by a suffix
|
||||
* (e.g. <code>*+xml</code>).
|
||||
* (for example, <code>*+xml</code>).
|
||||
* @return whether the subtype is a wildcard
|
||||
*/
|
||||
public boolean isWildcardSubtype() {
|
||||
@@ -357,7 +357,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
|
||||
return true;
|
||||
}
|
||||
if (isWildcardSubtype()) {
|
||||
// Wildcard with suffix, e.g. application/*+xml
|
||||
// Wildcard with suffix, for example, application/*+xml
|
||||
int thisPlusIdx = getSubtype().lastIndexOf('+');
|
||||
if (thisPlusIdx == -1) {
|
||||
return true;
|
||||
|
||||
@@ -97,7 +97,7 @@ public abstract class StringUtils {
|
||||
* will never return {@code true} for a non-null non-String object.
|
||||
* <p>The Object signature is useful for general attribute handling code
|
||||
* that commonly deals with Strings but generally has to iterate over
|
||||
* Objects since attributes may e.g. be primitive value objects as well.
|
||||
* Objects since attributes may, for example, be primitive value objects as well.
|
||||
* <p><b>Note: If the object is typed to {@code String} upfront, prefer
|
||||
* {@link #hasLength(String)} or {@link #hasText(String)} instead.</b>
|
||||
* @param str the candidate object (possibly a {@code String})
|
||||
@@ -481,7 +481,7 @@ public abstract class StringUtils {
|
||||
* Delete any character in a given {@code String}.
|
||||
* @param inString the original {@code String}
|
||||
* @param charsToDelete a set of characters to delete.
|
||||
* E.g. "az\n" will delete 'a's, 'z's and new lines.
|
||||
* For example, "az\n" will delete 'a's, 'z's and new lines.
|
||||
* @return the resulting {@code String}
|
||||
*/
|
||||
public static String deleteAny(String inString, @Nullable String charsToDelete) {
|
||||
@@ -509,8 +509,8 @@ public abstract class StringUtils {
|
||||
|
||||
/**
|
||||
* Quote the given {@code String} with single quotes.
|
||||
* @param str the input {@code String} (e.g. "myString")
|
||||
* @return the quoted {@code String} (e.g. "'myString'"),
|
||||
* @param str the input {@code String} (for example, "myString")
|
||||
* @return the quoted {@code String} (for example, "'myString'"),
|
||||
* or {@code null} if the input was {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
@@ -521,8 +521,8 @@ public abstract class StringUtils {
|
||||
/**
|
||||
* Turn the given Object into a {@code String} with single quotes
|
||||
* if it is a {@code String}; keeping the Object as-is else.
|
||||
* @param obj the input Object (e.g. "myString")
|
||||
* @return the quoted {@code String} (e.g. "'myString'"),
|
||||
* @param obj the input Object (for example, "myString")
|
||||
* @return the quoted {@code String} (for example, "'myString'"),
|
||||
* or the input object as-is if not a {@code String}
|
||||
*/
|
||||
@Nullable
|
||||
@@ -613,7 +613,7 @@ public abstract class StringUtils {
|
||||
|
||||
/**
|
||||
* Extract the filename from the given Java resource path,
|
||||
* e.g. {@code "mypath/myfile.txt" → "myfile.txt"}.
|
||||
* for example, {@code "mypath/myfile.txt" → "myfile.txt"}.
|
||||
* @param path the file path (may be {@code null})
|
||||
* @return the extracted filename, or {@code null} if none
|
||||
*/
|
||||
@@ -629,7 +629,7 @@ public abstract class StringUtils {
|
||||
|
||||
/**
|
||||
* Extract the filename extension from the given Java resource path,
|
||||
* e.g. "mypath/myfile.txt" → "txt".
|
||||
* for example, "mypath/myfile.txt" → "txt".
|
||||
* @param path the file path (may be {@code null})
|
||||
* @return the extracted filename extension, or {@code null} if none
|
||||
*/
|
||||
@@ -654,7 +654,7 @@ public abstract class StringUtils {
|
||||
|
||||
/**
|
||||
* Strip the filename extension from the given Java resource path,
|
||||
* e.g. "mypath/myfile.txt" → "mypath/myfile".
|
||||
* for example, "mypath/myfile.txt" → "mypath/myfile".
|
||||
* @param path the file path
|
||||
* @return the path with stripped filename extension
|
||||
*/
|
||||
@@ -857,7 +857,7 @@ public abstract class StringUtils {
|
||||
* specified by {@link Locale#forLanguageTag}.
|
||||
* @param localeValue the locale value: following either {@code Locale's}
|
||||
* {@code toString()} format ("en", "en_UK", etc.), also accepting spaces as
|
||||
* separators (as an alternative to underscores), or BCP 47 (e.g. "en-UK")
|
||||
* separators (as an alternative to underscores), or BCP 47 (for example, "en-UK")
|
||||
* @return a corresponding {@code Locale} instance, or {@code null} if none
|
||||
* @throws IllegalArgumentException in case of an invalid locale specification
|
||||
* @since 5.0.4
|
||||
@@ -1233,7 +1233,7 @@ public abstract class StringUtils {
|
||||
* @param delimiter the delimiter between elements (this is a single delimiter,
|
||||
* rather than a bunch individual delimiter characters)
|
||||
* @param charsToDelete a set of characters to delete; useful for deleting unwanted
|
||||
* line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a {@code String}
|
||||
* line breaks: for example, "\r\n\f" will delete all new lines and line feeds in a {@code String}
|
||||
* @return an array of the tokens in the list
|
||||
* @see #tokenizeToStringArray
|
||||
*/
|
||||
@@ -1269,7 +1269,7 @@ public abstract class StringUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a comma delimited list (e.g., a row from a CSV file) into an
|
||||
* Convert a comma delimited list (for example, a row from a CSV file) into an
|
||||
* array of strings.
|
||||
* @param str the input {@code String} (potentially {@code null} or empty)
|
||||
* @return an array of strings, or the empty array in case of empty input
|
||||
@@ -1279,7 +1279,7 @@ public abstract class StringUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a comma delimited list (e.g., a row from a CSV file) into a set.
|
||||
* Convert a comma delimited list (for example, a row from a CSV file) into a set.
|
||||
* <p>Note that this will suppress duplicates, and as of 4.2, the elements in
|
||||
* the returned set will preserve the original order in a {@link LinkedHashSet}.
|
||||
* @param str the input {@code String} (potentially {@code null} or empty)
|
||||
@@ -1292,7 +1292,7 @@ public abstract class StringUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a {@link Collection} to a delimited {@code String} (e.g. CSV).
|
||||
* Convert a {@link Collection} to a delimited {@code String} (for example, CSV).
|
||||
* <p>Useful for {@code toString()} implementations.
|
||||
* @param coll the {@code Collection} to convert (potentially {@code null} or empty)
|
||||
* @param delim the delimiter to use (typically a ",")
|
||||
@@ -1324,7 +1324,7 @@ public abstract class StringUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a {@code Collection} into a delimited {@code String} (e.g. CSV).
|
||||
* Convert a {@code Collection} into a delimited {@code String} (for example, CSV).
|
||||
* <p>Useful for {@code toString()} implementations.
|
||||
* @param coll the {@code Collection} to convert (potentially {@code null} or empty)
|
||||
* @param delim the delimiter to use (typically a ",")
|
||||
@@ -1335,7 +1335,7 @@ public abstract class StringUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a {@code Collection} into a delimited {@code String} (e.g., CSV).
|
||||
* Convert a {@code Collection} into a delimited {@code String} (for example, CSV).
|
||||
* <p>Useful for {@code toString()} implementations.
|
||||
* @param coll the {@code Collection} to convert (potentially {@code null} or empty)
|
||||
* @return the delimited {@code String}
|
||||
@@ -1345,7 +1345,7 @@ public abstract class StringUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a {@code String} array into a delimited {@code String} (e.g. CSV).
|
||||
* Convert a {@code String} array into a delimited {@code String} (for example, CSV).
|
||||
* <p>Useful for {@code toString()} implementations.
|
||||
* @param arr the array to display (potentially {@code null} or empty)
|
||||
* @param delim the delimiter to use (typically a ",")
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.lang.Nullable;
|
||||
* Helper class for resolving placeholders in texts. Usually applied to file paths.
|
||||
*
|
||||
* <p>A text may contain {@code ${...}} placeholders, to be resolved as system properties:
|
||||
* e.g. {@code ${user.dir}}. Default values can be supplied using the ":" separator
|
||||
* for example, {@code ${user.dir}}. Default values can be supplied using the ":" separator
|
||||
* between key and value.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -31,7 +31,7 @@ package org.springframework.util.backoff;
|
||||
* // do not retry operation
|
||||
* }
|
||||
* else {
|
||||
* // sleep, e.g. Thread.sleep(waitInterval)
|
||||
* // sleep, for example, Thread.sleep(waitInterval)
|
||||
* // retry operation
|
||||
* }</pre>
|
||||
*
|
||||
|
||||
@@ -2100,7 +2100,7 @@ class MergedAnnotationsTests {
|
||||
/**
|
||||
* Fully reflection-based test that verifies support for synthesizing
|
||||
* annotations across packages with non-public visibility of user types
|
||||
* (e.g., a non-public annotation that uses {@code @AliasFor}).
|
||||
* (for example, a non-public annotation that uses {@code @AliasFor}).
|
||||
*/
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user