parent
46db372951
commit
bc15f839cd
|
|
@ -59,7 +59,7 @@ public interface AttributeAccessor {
|
|||
* in this {@code AttributeAccessor}, the existing value will be returned
|
||||
* without applying the supplied compute function.
|
||||
* <p>The default implementation of this method is not thread safe but can
|
||||
* overridden by concrete implementations of this interface.
|
||||
* be overridden by concrete implementations of this interface.
|
||||
* @param <T> the type of the attribute value
|
||||
* @param name the unique attribute key
|
||||
* @param computeFunction a function that computes a new value for the attribute
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -93,9 +93,9 @@ public final class BridgeMethodResolver {
|
|||
|
||||
/**
|
||||
* Returns {@code true} if the supplied '{@code candidateMethod}' can be
|
||||
* consider a validate candidate for the {@link Method} that is {@link Method#isBridge() bridged}
|
||||
* considered a valid candidate for the {@link Method} that is {@link Method#isBridge() bridged}
|
||||
* by the supplied {@link Method bridge Method}. This method performs inexpensive
|
||||
* checks and can be used quickly filter for a set of possible matches.
|
||||
* checks and can be used quickly to filter for a set of possible matches.
|
||||
*/
|
||||
private static boolean isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod) {
|
||||
return (!candidateMethod.isBridge() && !candidateMethod.equals(bridgeMethod) &&
|
||||
|
|
@ -130,7 +130,7 @@ public final class BridgeMethodResolver {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not the bridge {@link Method} is the bridge for the
|
||||
* Determines whether the bridge {@link Method} is the bridge for the
|
||||
* supplied candidate {@link Method}.
|
||||
*/
|
||||
static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Class<?> declaringClass) {
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ public final class GenericTypeResolver {
|
|||
/**
|
||||
* Build a mapping of {@link TypeVariable#getName TypeVariable names} to
|
||||
* {@link Class concrete classes} for the specified {@link Class}.
|
||||
* Searches all super types, enclosing types and interfaces.
|
||||
* Searches all supertypes, enclosing types and interfaces.
|
||||
* @see #resolveType(Type, Map)
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import org.springframework.lang.Nullable;
|
|||
/**
|
||||
* {@link ParameterNameDiscoverer} implementation that tries several discoverer
|
||||
* delegates in succession. Those added first in the {@code addDiscoverer} method
|
||||
* have highest priority. If one returns {@code null}, the next will be tried.
|
||||
* have the highest priority. If one returns {@code null}, the next will be tried.
|
||||
*
|
||||
* <p>The default behavior is to return {@code null} if no discoverer matches.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public final class ReactiveTypeDescriptor {
|
|||
|
||||
/**
|
||||
* Return an empty-value instance for the underlying reactive or async type.
|
||||
* Use of this type implies {@link #supportsEmpty()} is true.
|
||||
* Use of this type implies {@link #supportsEmpty()} is {@code true}.
|
||||
*/
|
||||
public Object getEmptyValue() {
|
||||
Assert.state(this.emptyValueSupplier != null, "Empty values not supported");
|
||||
|
|
|
|||
|
|
@ -1012,7 +1012,7 @@ public class ResolvableType implements Serializable {
|
|||
/**
|
||||
* Return a {@link ResolvableType} for the specified {@link Class},
|
||||
* doing assignability checks against the raw class only (analogous to
|
||||
* {@link Class#isAssignableFrom}, which this serves as a wrapper for.
|
||||
* {@link Class#isAssignableFrom}), which this serves as a wrapper for.
|
||||
* <p>For example: {@code ResolvableType.forRawClass(List.class)}.
|
||||
* @param clazz the class to introspect ({@code null} is semantically
|
||||
* equivalent to {@code Object.class} for typical use cases here)
|
||||
|
|
@ -1343,7 +1343,7 @@ public class ResolvableType implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a {@link ResolvableType} as a array of the specified {@code componentType}.
|
||||
* Return a {@link ResolvableType} as an array of the specified {@code componentType}.
|
||||
* @param componentType the component type
|
||||
* @return a {@link ResolvableType} as an array of the specified component type
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.springframework.lang.Nullable;
|
|||
* signature as Java does not convey the signature at runtime.
|
||||
*
|
||||
* <p>Users of this interface should be careful in complex hierarchy scenarios, especially
|
||||
* when the generic type signature of the class changes in sub-classes. It is always
|
||||
* when the generic type signature of the class changes in subclasses. It is always
|
||||
* possible to return {@code null} to fallback on a default behavior.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import org.springframework.lang.Nullable;
|
|||
* Spring's CGLIB proxy factory for making a caching decision.
|
||||
*
|
||||
* <p>If a ClassLoader does <i>not</i> implement this interface,
|
||||
* then all of the classes obtained from it should be considered
|
||||
* then all the classes obtained from it should be considered
|
||||
* as not reloadable (i.e. cacheable).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
|||
|
|
@ -754,7 +754,7 @@ public abstract class AnnotationUtils {
|
|||
/**
|
||||
* Check the declared attributes of the given annotation, in particular covering
|
||||
* Google App Engine's late arrival of {@code TypeNotPresentExceptionProxy} for
|
||||
* {@code Class} values (instead of early {@code Class.getAnnotations() failure}.
|
||||
* {@code Class} values (instead of early {@code Class.getAnnotations() failure}).
|
||||
* <p>This method not failing indicates that {@link #getAnnotationAttributes(Annotation)}
|
||||
* won't failure either (when attempted later on).
|
||||
* @param annotation the annotation to validate
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ final class AttributeMethods {
|
|||
* any {@link TypeNotPresentException TypeNotPresentExceptions}. In particular,
|
||||
* this method is designed to cover Google App Engine's late arrival of such
|
||||
* exceptions for {@code Class} values (instead of the more typical early
|
||||
* {@code Class.getAnnotations() failure}.
|
||||
* {@code Class.getAnnotations() failure}).
|
||||
* @param annotation the annotation to validate
|
||||
* @throws IllegalStateException if a declared {@code Class} attribute could not be read
|
||||
* @see #isValid(Annotation)
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ public interface MergedAnnotation<A extends Annotation> {
|
|||
* Get a required enum attribute value from the annotation.
|
||||
* @param attributeName the attribute name
|
||||
* @param type the enum type
|
||||
* @return the value as a enum
|
||||
* @return the value as an enum
|
||||
* @throws NoSuchElementException if there is no matching attribute
|
||||
*/
|
||||
<E extends Enum<E>> E getEnum(String attributeName, Class<E> type) throws NoSuchElementException;
|
||||
|
|
@ -358,7 +358,7 @@ public interface MergedAnnotation<A extends Annotation> {
|
|||
* Get a required enum array attribute value from the annotation.
|
||||
* @param attributeName the attribute name
|
||||
* @param type the enum type
|
||||
* @return the value as a enum array
|
||||
* @return the value as an enum array
|
||||
* @throws NoSuchElementException if there is no matching attribute
|
||||
*/
|
||||
<E extends Enum<E>> E[] getEnumArray(String attributeName, Class<E> type) throws NoSuchElementException;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ import org.springframework.core.Ordered;
|
|||
*
|
||||
* <p>The {@link #value} is optional and represents an order value as defined in the
|
||||
* {@link Ordered} interface. Lower values have higher priority. The default value is
|
||||
* {@code Ordered.LOWEST_PRECEDENCE}, indicating lowest priority (losing to any other
|
||||
* specified order value).
|
||||
* {@code Ordered.LOWEST_PRECEDENCE}, indicating the lowest priority (losing to any
|
||||
* other specified order value).
|
||||
*
|
||||
* <p><b>NOTE:</b> Since Spring 4.0, annotation-based ordering is supported for many
|
||||
* kinds of components in Spring, even for collection injection where the order values
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public abstract class Hints {
|
|||
* Merge a single hint into a map of hints, possibly creating and copying
|
||||
* all hints into a new map, or otherwise if the map of hints is empty,
|
||||
* creating a new single entry map.
|
||||
* @param hints a map of hints to be merge
|
||||
* @param hints a map of hints to be merged
|
||||
* @param hintName the hint name to merge
|
||||
* @param hintValue the hint value to merge
|
||||
* @return a single map with all hints
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ public class TypeDescriptor implements Serializable {
|
|||
/**
|
||||
* Cast this {@link TypeDescriptor} to a superclass or implemented interface
|
||||
* preserving annotations and nested type context.
|
||||
* @param superType the super type to cast to (can be {@code null})
|
||||
* @param superType the supertype to cast to (can be {@code null})
|
||||
* @return a new TypeDescriptor for the up-cast type
|
||||
* @throws IllegalArgumentException if this type is not assignable to the super-type
|
||||
* @since 3.2
|
||||
|
|
@ -341,7 +341,7 @@ public class TypeDescriptor implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* If this type is a {@link Collection} or an array, creates a element TypeDescriptor
|
||||
* If this type is a {@link Collection} or an array, creates an element TypeDescriptor
|
||||
* from the provided collection or array element.
|
||||
* <p>Narrows the {@link #getElementTypeDescriptor() elementType} property to the class
|
||||
* of the provided collection or array element. For example, if this describes a
|
||||
|
|
@ -353,7 +353,7 @@ public class TypeDescriptor implements Serializable {
|
|||
* <p>Annotation and nested type context will be preserved in the narrowed
|
||||
* TypeDescriptor that is returned.
|
||||
* @param element the collection or array element
|
||||
* @return a element type descriptor, narrowed to the type of the provided element
|
||||
* @return an element type descriptor, narrowed to the type of the provided element
|
||||
* @see #getElementTypeDescriptor()
|
||||
* @see #narrow(Object)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.util.Assert;
|
|||
*
|
||||
* <p>This is the most flexible of the Converter SPI interfaces, but also the most complex.
|
||||
* It is flexible in that a GenericConverter may support converting between multiple source/target
|
||||
* type pairs (see {@link #getConvertibleTypes()}. In addition, GenericConverter implementations
|
||||
* type pairs (see {@link #getConvertibleTypes()}). In addition, GenericConverter implementations
|
||||
* have access to source/target {@link TypeDescriptor field context} during the type conversion
|
||||
* process. This allows for resolving source and target field metadata such as annotations and
|
||||
* generics information, which can be used to influence the conversion logic.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import org.springframework.core.convert.ConversionService;
|
|||
import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
/**
|
||||
* Calls {@link Enum#ordinal()} to convert a source Enum to a Integer.
|
||||
* Calls {@link Enum#ordinal()} to convert a source Enum to an Integer.
|
||||
* This converter will not match enums with interfaces that can be converted.
|
||||
*
|
||||
* @author Yanming Zhou
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ public class GenericConversionService implements ConfigurableConversionService {
|
|||
}
|
||||
|
||||
/**
|
||||
* Hook method to lookup the converter for a given sourceType/targetType pair.
|
||||
* Hook method to look up the converter for a given sourceType/targetType pair.
|
||||
* First queries this ConversionService's converter cache.
|
||||
* On a cache miss, then performs an exhaustive search for a matching converter.
|
||||
* If no converter matches, returns the default converter.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import org.springframework.util.ClassUtils;
|
|||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* Converts an entity identifier to a entity reference by calling a static finder method
|
||||
* Converts an entity identifier to an entity reference by calling a static finder method
|
||||
* on the target entity type.
|
||||
*
|
||||
* <p>For this converter to match, the finder method must be static, have the signature
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import org.springframework.core.convert.converter.Converter;
|
|||
import org.springframework.core.convert.converter.ConverterFactory;
|
||||
|
||||
/**
|
||||
* Converts from a Integer to a {@link java.lang.Enum} by calling {@link Class#getEnumConstants()}.
|
||||
* Converts from an Integer to a {@link java.lang.Enum} by calling {@link Class#getEnumConstants()}.
|
||||
*
|
||||
* @author Yanming Zhou
|
||||
* @author Stephane Nicoll
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ import org.springframework.util.StringUtils;
|
|||
*
|
||||
* Because the {@code CommandLinePropertySource} was added to the {@code Environment}'s
|
||||
* set of {@link MutablePropertySources} using the {@code #addFirst} method, it has
|
||||
* highest search precedence, meaning that while "db.hostname" and other properties may
|
||||
* exist in other property sources such as the system environment variables, it will be
|
||||
* chosen from the command line property source first. This is a reasonable approach
|
||||
* the highest search precedence, meaning that while "db.hostname" and other properties
|
||||
* may exist in other property sources such as the system environment variables, it will
|
||||
* be chosen from the command line property source first. This is a reasonable approach
|
||||
* given that arguments specified on the command line are naturally more specific than
|
||||
* those specified as environment variables.
|
||||
*
|
||||
|
|
@ -136,7 +136,7 @@ import org.springframework.util.StringUtils;
|
|||
* arguments" and available through the special {@linkplain
|
||||
* #DEFAULT_NON_OPTION_ARGS_PROPERTY_NAME "nonOptionArgs"} property. If multiple
|
||||
* non-option arguments are specified, the value of this property will be a
|
||||
* comma-delimited string containing all of the arguments. This approach ensures a simple
|
||||
* comma-delimited string containing all the arguments. This approach ensures a simple
|
||||
* and consistent return type (String) for all properties from a {@code
|
||||
* CommandLinePropertySource} and at the same time lends itself to conversion when used
|
||||
* in conjunction with the Spring {@link Environment} and its built-in {@code
|
||||
|
|
@ -189,7 +189,7 @@ import org.springframework.util.StringUtils;
|
|||
* <h3>Limitations</h3>
|
||||
*
|
||||
* This abstraction is not intended to expose the full power of underlying command line
|
||||
* parsing APIs such as JOpt or Commons CLI. It's intent is rather just the opposite: to
|
||||
* parsing APIs such as JOpt or Commons CLI. Its intent is rather just the opposite: to
|
||||
* provide the simplest possible abstraction for accessing command line arguments
|
||||
* <em>after</em> they have been parsed. So the typical case will involve fully configuring
|
||||
* the underlying command line parsing API, parsing the {@code String[]} of arguments
|
||||
|
|
@ -246,7 +246,7 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou
|
|||
* This implementation first checks to see if the name specified is the special
|
||||
* {@linkplain #setNonOptionArgsPropertyName(String) "non-option arguments" property},
|
||||
* and if so delegates to the abstract {@link #getNonOptionArgs()} method
|
||||
* checking to see whether it returns an empty collection. Otherwise delegates to and
|
||||
* checking to see whether it returns an empty collection. Otherwise, delegates to and
|
||||
* returns the value of the abstract {@link #containsOption(String)} method.
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -263,7 +263,7 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou
|
|||
* and if so delegates to the abstract {@link #getNonOptionArgs()} method. If so
|
||||
* and the collection of non-option arguments is empty, this method returns {@code
|
||||
* null}. If not empty, it returns a comma-separated String of all non-option
|
||||
* arguments. Otherwise delegates to and returns the result of the abstract {@link
|
||||
* arguments. Otherwise, delegates to and returns the result of the abstract {@link
|
||||
* #getOptionValues(String)} method.
|
||||
*/
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public class MutablePropertySources implements PropertySources {
|
|||
|
||||
|
||||
/**
|
||||
* Add the given property source object with highest precedence.
|
||||
* Add the given property source object with the highest precedence.
|
||||
*/
|
||||
public void addFirst(PropertySource<?> propertySource) {
|
||||
synchronized (this.propertySourceList) {
|
||||
|
|
@ -110,7 +110,7 @@ public class MutablePropertySources implements PropertySources {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add the given property source object with lowest precedence.
|
||||
* Add the given property source object with the lowest precedence.
|
||||
*/
|
||||
public void addLast(PropertySource<?> propertySource) {
|
||||
synchronized (this.propertySourceList) {
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ public abstract class PropertySource<T> {
|
|||
* PropertySource instance and every name/value property pair.
|
||||
* <p>This variable verbosity is useful as a property source such as system properties
|
||||
* or environment variables may contain an arbitrary number of property pairs,
|
||||
* potentially leading to difficult to read exception and log messages.
|
||||
* potentially leading to difficulties to read exception and log messages.
|
||||
* @see Log#isDebugEnabled()
|
||||
*/
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ public abstract class AbstractResource implements Resource {
|
|||
|
||||
/**
|
||||
* This method reads the entire InputStream to determine the content length.
|
||||
* <p>For a custom sub-class of {@code InputStreamResource}, we strongly
|
||||
* <p>For a custom subclass of {@code InputStreamResource}, we strongly
|
||||
* recommend overriding this method with a more optimal implementation, e.g.
|
||||
* checking File length, or possibly simply returning -1 if the stream can
|
||||
* only be read once.
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public interface DataBufferFactory {
|
|||
* <p>Note that the given data buffers do <strong>not</strong> have to be released, as they are
|
||||
* released as part of the returned composite.
|
||||
* @param dataBuffers the data buffers to be composed
|
||||
* @return a buffer that is composed from the {@code dataBuffers} argument
|
||||
* @return a buffer that is composed of the {@code dataBuffers} argument
|
||||
* @since 5.0.3
|
||||
*/
|
||||
DataBuffer join(List<? extends DataBuffer> dataBuffers);
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ public abstract class DataBufferUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a new {@code DataBuffer} composed from joining together the given
|
||||
* Return a new {@code DataBuffer} composed of joining together the given
|
||||
* {@code dataBuffers} elements. Depending on the {@link DataBuffer} type,
|
||||
* the returned buffer may be a single buffer containing all data of the
|
||||
* provided buffers, or it may be a zero-copy, composite with references to
|
||||
|
|
@ -551,7 +551,7 @@ public abstract class DataBufferUtils {
|
|||
* <p>Note that the given data buffers do <strong>not</strong> have to be
|
||||
* released. They will be released as part of the returned composite.
|
||||
* @param dataBuffers the data buffers that are to be composed
|
||||
* @return a buffer that is composed from the {@code dataBuffers} argument
|
||||
* @return a buffer that is composed of the {@code dataBuffers} argument
|
||||
* @since 5.0.3
|
||||
*/
|
||||
public static Mono<DataBuffer> join(Publisher<? extends DataBuffer> dataBuffers) {
|
||||
|
|
|
|||
|
|
@ -99,14 +99,14 @@ import org.springframework.util.StringUtils;
|
|||
* <p><b>Implications on portability:</b>
|
||||
*
|
||||
* <p>If the specified path is already a file URL (either explicitly, or
|
||||
* implicitly because the base {@code ResourceLoader} is a filesystem one,
|
||||
* implicitly because the base {@code ResourceLoader} is a filesystem one),
|
||||
* then wildcarding is guaranteed to work in a completely portable fashion.
|
||||
*
|
||||
* <p>If the specified path is a classpath location, then the resolver must
|
||||
* obtain the last non-wildcard path segment URL via a
|
||||
* {@code Classloader.getResource()} call. Since this is just a
|
||||
* node of the path (not the file at the end) it is actually undefined
|
||||
* (in the ClassLoader Javadocs) exactly what sort of a URL is returned in
|
||||
* (in the ClassLoader Javadocs) exactly what sort of URL is returned in
|
||||
* this case. In practice, it is usually a {@code java.io.File} representing
|
||||
* the directory, where the classpath resource resolves to a filesystem
|
||||
* location, or a jar URL of some sort, where the classpath resource resolves
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class ResourcePropertySource extends PropertiesPropertySource {
|
|||
* Create a PropertySource having the given name based on Properties loaded from
|
||||
* the given resource location. The default thread context class loader will be
|
||||
* used to load the resource (assuming the location string is prefixed with
|
||||
* {@code classpath:}.
|
||||
* {@code classpath:}).
|
||||
*/
|
||||
public ResourcePropertySource(String name, String location) throws IOException {
|
||||
this(name, new DefaultResourceLoader().getResource(location));
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public interface ToStringStyler {
|
|||
/**
|
||||
* Style a field value as a string.
|
||||
* @param buffer the buffer to print to
|
||||
* @param fieldName the he name of the field
|
||||
* @param fieldName the name of the field
|
||||
* @param value the field value
|
||||
*/
|
||||
void styleField(StringBuilder buffer, String fieldName, @Nullable Object value);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.util.Assert;
|
|||
* <p>Mainly intended for testing scenarios.
|
||||
*
|
||||
* <p>Execution in the calling thread does have the advantage of participating
|
||||
* in it's thread context, for example the thread context class loader or the
|
||||
* in its thread context, for example the thread context class loader or the
|
||||
* thread's current transaction association. That said, in many cases,
|
||||
* asynchronous execution will be preferable: choose an asynchronous
|
||||
* {@code TaskExecutor} instead for such scenarios.
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public interface ClassMetadata {
|
|||
/**
|
||||
* Determine whether the underlying class is independent, i.e. whether
|
||||
* it is a top-level class or a nested class (static inner class) that
|
||||
* can be constructed independently from an enclosing class.
|
||||
* can be constructed independently of an enclosing class.
|
||||
*/
|
||||
boolean isIndependent();
|
||||
|
||||
|
|
@ -90,15 +90,15 @@ public interface ClassMetadata {
|
|||
String getEnclosingClassName();
|
||||
|
||||
/**
|
||||
* Return whether the underlying class has a super class.
|
||||
* Return whether the underlying class has a superclass.
|
||||
*/
|
||||
default boolean hasSuperClass() {
|
||||
return (getSuperClassName() != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the super class of the underlying class,
|
||||
* or {@code null} if there is no super class defined.
|
||||
* Return the name of the superclass of the underlying class,
|
||||
* or {@code null} if there is no superclass defined.
|
||||
*/
|
||||
@Nullable
|
||||
String getSuperClassName();
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilte
|
|||
if (this.considerInherited) {
|
||||
String superClassName = metadata.getSuperClassName();
|
||||
if (superClassName != null) {
|
||||
// Optimization to avoid creating ClassReader for super class.
|
||||
// Optimization to avoid creating ClassReader for superclass.
|
||||
Boolean superClassMatch = matchSuperClass(superClassName);
|
||||
if (superClassMatch != null) {
|
||||
if (superClassMatch.booleanValue()) {
|
||||
|
|
@ -78,7 +78,7 @@ public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilte
|
|||
}
|
||||
}
|
||||
else {
|
||||
// Need to read super class to determine a match...
|
||||
// Need to read superclass to determine a match...
|
||||
try {
|
||||
if (match(metadata.getSuperClassName(), metadataReaderFactory)) {
|
||||
return true;
|
||||
|
|
@ -96,7 +96,7 @@ public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilte
|
|||
|
||||
if (this.considerInterfaces) {
|
||||
for (String ifc : metadata.getInterfaceNames()) {
|
||||
// Optimization to avoid creating ClassReader for super class
|
||||
// Optimization to avoid creating ClassReader for superclass
|
||||
Boolean interfaceMatch = matchInterface(ifc);
|
||||
if (interfaceMatch != null) {
|
||||
if (interfaceMatch.booleanValue()) {
|
||||
|
|
@ -144,7 +144,7 @@ public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilte
|
|||
}
|
||||
|
||||
/**
|
||||
* Override this to match on super type name.
|
||||
* Override this to match on supertype name.
|
||||
*/
|
||||
@Nullable
|
||||
protected Boolean matchSuperClass(String superClassName) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import org.springframework.util.ClassUtils;
|
|||
* <p>By default, the matching logic mirrors that of
|
||||
* {@link AnnotationUtils#getAnnotation(java.lang.reflect.AnnotatedElement, Class)},
|
||||
* supporting annotations that are <em>present</em> or <em>meta-present</em> for a
|
||||
* single level of meta-annotations. The search for meta-annotations my be disabled.
|
||||
* single level of meta-annotations. The search for meta-annotations may be disabled.
|
||||
* Similarly, the search for annotations on interfaces may optionally be enabled.
|
||||
* Consult the various constructors in this class for details.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ import org.springframework.lang.Nullable;
|
|||
* </ul>
|
||||
*
|
||||
* <p><strong>Note:</strong> a pattern and a path must both be absolute or must
|
||||
* both be relative in order for the two to match. Therefore it is recommended
|
||||
* both be relative in order for the two to match. Therefore, it is recommended
|
||||
* that users of this implementation to sanitize patterns in order to prefix
|
||||
* them with "/" as it makes sense in the context in which they're used.
|
||||
*
|
||||
|
|
@ -427,7 +427,7 @@ public class AntPathMatcher implements PathMatcher {
|
|||
}
|
||||
|
||||
/**
|
||||
* Test whether or not a string matches against a pattern.
|
||||
* Test whether a string matches against a pattern.
|
||||
* @param pattern the pattern to match against (never {@code null})
|
||||
* @param str the String which must be matched against the pattern (never {@code null})
|
||||
* @return {@code true} if the string matches against the pattern, or {@code false} otherwise
|
||||
|
|
@ -636,7 +636,7 @@ public class AntPathMatcher implements PathMatcher {
|
|||
|
||||
|
||||
/**
|
||||
* Tests whether or not a string matches against a pattern via a {@link Pattern}.
|
||||
* Tests whether a string matches against a pattern via a {@link Pattern}.
|
||||
* <p>The pattern may contain special characters: '*' means zero or more characters; '?' means one and
|
||||
* only one character; '{' and '}' indicate a URI template pattern. For example <tt>/users/{user}</tt>.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -636,17 +636,17 @@ public abstract class Assert {
|
|||
/**
|
||||
* Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
|
||||
* <pre class="code">Assert.isAssignable(Number.class, myClass, "Number expected");</pre>
|
||||
* @param superType the super type to check against
|
||||
* @param subType the sub type to check
|
||||
* @param superType the supertype to check against
|
||||
* @param subType the subtype to check
|
||||
* @param message a message which will be prepended to provide further context.
|
||||
* If it is empty or ends in ":" or ";" or "," or ".", a full exception message
|
||||
* will be appended. If it ends in a space, the name of the offending sub type
|
||||
* will be appended. If it ends in a space, the name of the offending subtype
|
||||
* will be appended. In any other case, a ":" with a space and the name of the
|
||||
* offending sub type will be appended.
|
||||
* offending subtype will be appended.
|
||||
* @throws IllegalArgumentException if the classes are not assignable
|
||||
*/
|
||||
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, String message) {
|
||||
notNull(superType, "Super type to check against must not be null");
|
||||
notNull(superType, "Supertype to check against must not be null");
|
||||
if (subType == null || !superType.isAssignableFrom(subType)) {
|
||||
assignableCheckFailed(superType, subType, message);
|
||||
}
|
||||
|
|
@ -657,15 +657,15 @@ public abstract class Assert {
|
|||
* <pre class="code">
|
||||
* Assert.isAssignable(Number.class, myClass, () -> "Processing " + myAttributeName + ":");
|
||||
* </pre>
|
||||
* @param superType the super type to check against
|
||||
* @param subType the sub type to check
|
||||
* @param superType the supertype to check against
|
||||
* @param subType the subtype to check
|
||||
* @param messageSupplier a supplier for the exception message to use if the
|
||||
* assertion fails. See {@link #isAssignable(Class, Class, String)} for details.
|
||||
* @throws IllegalArgumentException if the classes are not assignable
|
||||
* @since 5.0
|
||||
*/
|
||||
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, Supplier<String> messageSupplier) {
|
||||
notNull(superType, "Super type to check against must not be null");
|
||||
notNull(superType, "Supertype to check against must not be null");
|
||||
if (subType == null || !superType.isAssignableFrom(subType)) {
|
||||
assignableCheckFailed(superType, subType, nullSafeGet(messageSupplier));
|
||||
}
|
||||
|
|
@ -674,8 +674,8 @@ public abstract class Assert {
|
|||
/**
|
||||
* Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
|
||||
* <pre class="code">Assert.isAssignable(Number.class, myClass);</pre>
|
||||
* @param superType the super type to check
|
||||
* @param subType the sub type to check
|
||||
* @param superType the supertype to check
|
||||
* @param subType the subtype to check
|
||||
* @throws IllegalArgumentException if the classes are not assignable
|
||||
*/
|
||||
public static void isAssignable(Class<?> superType, Class<?> subType) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
* <p>Designed for use as a base class, with the subclass invoking
|
||||
* the {@link #beforeAccess()} and {@link #afterAccess()} methods at
|
||||
* appropriate points of its workflow. Note that {@code afterAccess}
|
||||
* should usually be called in a finally block!
|
||||
* should usually be called in a {@code finally} block!
|
||||
*
|
||||
* <p>The default concurrency limit of this support class is -1
|
||||
* ("unbounded concurrency"). Subclasses may override this default;
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ public class FastByteArrayOutputStream extends OutputStream {
|
|||
/**
|
||||
* Convert the stream's data to a byte array and return the byte array.
|
||||
* <p>Also replaces the internal structures with the byte array to conserve memory:
|
||||
* if the byte array is being made anyways, mind as well as use it. This approach
|
||||
* if the byte array is being made anyway, mind as well as use it. This approach
|
||||
* also means that if this method is called twice without any writes in between,
|
||||
* the second call is a no-op.
|
||||
* <p>This method is "unsafe" as it returns the internal buffer.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
|||
|
|
@ -1221,7 +1221,7 @@ public abstract class StringUtils {
|
|||
* {@code String} array.
|
||||
* <p>A single {@code delimiter} may consist of more than one character,
|
||||
* but it will still be considered as a single delimiter string, rather
|
||||
* than as bunch of potential delimiter characters, in contrast to
|
||||
* than as a bunch of potential delimiter characters, in contrast to
|
||||
* {@link #tokenizeToStringArray}.
|
||||
* @param str the input {@code String} (potentially {@code null} or empty)
|
||||
* @param delimiter the delimiter between elements (this is a single delimiter,
|
||||
|
|
@ -1238,7 +1238,7 @@ public abstract class StringUtils {
|
|||
* a {@code String} array.
|
||||
* <p>A single {@code delimiter} may consist of more than one character,
|
||||
* but it will still be considered as a single delimiter string, rather
|
||||
* than as bunch of potential delimiter characters, in contrast to
|
||||
* than as a bunch of potential delimiter characters, in contrast to
|
||||
* {@link #tokenizeToStringArray}.
|
||||
* @param str the input {@code String} (potentially {@code null} or empty)
|
||||
* @param delimiter the delimiter between elements (this is a single delimiter,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.springframework.lang.Nullable;
|
|||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Helper class for {@link ListenableFuture} implementations that maintains a
|
||||
* Helper class for {@link ListenableFuture} implementations that maintains a queue
|
||||
* of success and failure callbacks and helps to notify them.
|
||||
*
|
||||
* <p>Inspired by {@code com.google.common.util.concurrent.ExecutionList}.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import org.springframework.lang.Nullable;
|
|||
/**
|
||||
* Abstract base class for SAX {@code ContentHandler} and {@code LexicalHandler}
|
||||
* implementations that use StAX as a basis. All methods delegate to internal template
|
||||
* methods, capable of throwing a {@code XMLStreamException}. Additionally, an namespace
|
||||
* methods, capable of throwing a {@code XMLStreamException}. Additionally, a namespace
|
||||
* context stack is used to keep track of declared namespaces.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ abstract class AbstractXMLReader implements XMLReader {
|
|||
|
||||
/**
|
||||
* This implementation throws a {@code SAXNotRecognizedException} exception
|
||||
* for any feature outside of the "http://xml.org/sax/features/" namespace
|
||||
* for any feature outside the "http://xml.org/sax/features/" namespace
|
||||
* and returns {@code false} for any feature within.
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -124,7 +124,7 @@ abstract class AbstractXMLReader implements XMLReader {
|
|||
|
||||
/**
|
||||
* This implementation throws a {@code SAXNotRecognizedException} exception
|
||||
* for any feature outside of the "http://xml.org/sax/features/" namespace
|
||||
* for any feature outside the "http://xml.org/sax/features/" namespace
|
||||
* and accepts a {@code false} value for any feature within.
|
||||
*/
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import org.springframework.lang.Nullable;
|
|||
/**
|
||||
* Implementation of the {@link javax.xml.stream.XMLStreamReader} interface that wraps a
|
||||
* {@link XMLEventReader}. Useful because the StAX {@link javax.xml.stream.XMLInputFactory}
|
||||
* allows one to create a event reader from a stream reader, but not vice-versa.
|
||||
* allows one to create an event reader from a stream reader, but not vice-versa.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 3.0
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class XmlValidationModeDetector {
|
|||
|
||||
|
||||
/**
|
||||
* Indicates whether or not the current parse position is inside an XML comment.
|
||||
* Indicates whether the current parse position is inside an XML comment.
|
||||
*/
|
||||
private boolean inComment;
|
||||
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ class AnnotationUtilsTests {
|
|||
// inherited class-level annotation; note: @Transactional is inherited
|
||||
assertThat(isAnnotationInherited(Transactional.class, InheritedAnnotationInterface.class)).isFalse();
|
||||
// isAnnotationInherited() does not currently traverse interface hierarchies.
|
||||
// Thus the following, though perhaps counter intuitive, must be false:
|
||||
// Thus the following, though perhaps counterintuitive, must be false:
|
||||
assertThat(isAnnotationInherited(Transactional.class, SubInheritedAnnotationInterface.class)).isFalse();
|
||||
assertThat(isAnnotationInherited(Transactional.class, InheritedAnnotationClass.class)).isFalse();
|
||||
assertThat(isAnnotationInherited(Transactional.class, SubInheritedAnnotationClass.class)).isTrue();
|
||||
|
|
|
|||
|
|
@ -1157,7 +1157,7 @@ class MergedAnnotationsTests {
|
|||
SearchStrategy.INHERITED_ANNOTATIONS).get(
|
||||
Transactional.class).getAggregateIndex()).isEqualTo(0);
|
||||
// Since we're not traversing interface hierarchies the following,
|
||||
// though perhaps counter intuitive, must be false:
|
||||
// though perhaps counterintuitive, must be false:
|
||||
assertThat(MergedAnnotations.from(SubInheritedAnnotationInterface.class,
|
||||
SearchStrategy.INHERITED_ANNOTATIONS).get(
|
||||
Transactional.class).getAggregateIndex()).isEqualTo(-1);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||
* Unit tests for {@link DefaultConversionService}.
|
||||
*
|
||||
* <p>In this package for enforcing accessibility checks to non-public classes outside
|
||||
* of the {@code org.springframework.core.convert.support} implementation package.
|
||||
* the {@code org.springframework.core.convert.support} implementation package.
|
||||
* Only in such a scenario, {@code setAccessible(true)} is actually necessary.
|
||||
*
|
||||
* @author Keith Donald
|
||||
|
|
|
|||
|
|
@ -645,7 +645,7 @@ class AssertTests {
|
|||
void isAssignableWithNullSupertype() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() ->
|
||||
Assert.isAssignable(null, Integer.class, "enigma"))
|
||||
.withMessageContaining("Super type to check against must not be null");
|
||||
.withMessageContaining("Supertype to check against must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -692,7 +692,7 @@ class AssertTests {
|
|||
void isAssignableWithNullSupertypeAndMessageSupplier() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() ->
|
||||
Assert.isAssignable(null, Integer.class, () -> "enigma"))
|
||||
.withMessageContaining("Super type to check against must not be null");
|
||||
.withMessageContaining("Supertype to check against must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public abstract class AbstractDecoderTests<D extends Decoder<?>> extends Abstrac
|
|||
// Flux
|
||||
|
||||
/**
|
||||
* Helper methods that tests for a variety of {@link Flux} decoding scenarios. This methods
|
||||
* Helper method that tests for a variety of {@link Flux} decoding scenarios. This method
|
||||
* invokes:
|
||||
* <ul>
|
||||
* <li>{@link #testDecode(Publisher, ResolvableType, Consumer, MimeType, Map)}</li>
|
||||
|
|
@ -106,7 +106,7 @@ public abstract class AbstractDecoderTests<D extends Decoder<?>> extends Abstrac
|
|||
}
|
||||
|
||||
/**
|
||||
* Helper methods that tests for a variety of {@link Flux} decoding scenarios. This methods
|
||||
* Helper method that tests for a variety of {@link Flux} decoding scenarios. This method
|
||||
* invokes:
|
||||
* <ul>
|
||||
* <li>{@link #testDecode(Publisher, ResolvableType, Consumer, MimeType, Map)}</li>
|
||||
|
|
@ -249,7 +249,7 @@ public abstract class AbstractDecoderTests<D extends Decoder<?>> extends Abstrac
|
|||
// Mono
|
||||
|
||||
/**
|
||||
* Helper methods that tests for a variety of {@link Mono} decoding scenarios. This methods
|
||||
* Helper method that tests for a variety of {@link Mono} decoding scenarios. This method
|
||||
* invokes:
|
||||
* <ul>
|
||||
* <li>{@link #testDecodeToMono(Publisher, ResolvableType, Consumer, MimeType, Map)}</li>
|
||||
|
|
@ -270,7 +270,7 @@ public abstract class AbstractDecoderTests<D extends Decoder<?>> extends Abstrac
|
|||
}
|
||||
|
||||
/**
|
||||
* Helper methods that tests for a variety of {@link Mono} decoding scenarios. This methods
|
||||
* Helper method that tests for a variety of {@link Mono} decoding scenarios. This method
|
||||
* invokes:
|
||||
* <ul>
|
||||
* <li>{@link #testDecodeToMono(Publisher, ResolvableType, Consumer, MimeType, Map)}</li>
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public abstract class AbstractEncoderTests<E extends Encoder<?>> extends Abstrac
|
|||
|
||||
|
||||
/**
|
||||
* Helper methods that tests for a variety of encoding scenarios. This methods
|
||||
* Helper method that tests for a variety of encoding scenarios. This method
|
||||
* invokes:
|
||||
* <ul>
|
||||
* <li>{@link #testEncode(Publisher, ResolvableType, MimeType, Map, Consumer)}</li>
|
||||
|
|
@ -99,7 +99,7 @@ public abstract class AbstractEncoderTests<E extends Encoder<?>> extends Abstrac
|
|||
}
|
||||
|
||||
/**
|
||||
* Helper methods that tests for a variety of decoding scenarios. This methods
|
||||
* Helper method that tests for a variety of decoding scenarios. This method
|
||||
* invokes:
|
||||
* <ul>
|
||||
* <li>{@link #testEncode(Publisher, ResolvableType, MimeType, Map, Consumer)}</li>
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class LeakAwareDataBufferFactory implements DataBufferFactory {
|
|||
|
||||
|
||||
/**
|
||||
* Checks whether all of the data buffers allocated by this factory have also been released.
|
||||
* Checks whether all the data buffers allocated by this factory have also been released.
|
||||
* If not, then an {@link AssertionError} is thrown. Typically used from a JUnit <em>after</em>
|
||||
* method.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue