Replace <code> with {@code} throughout Javadoc
Issue: SPR-10128
This commit is contained in:
@@ -26,8 +26,8 @@ package org.springframework.core;
|
||||
public interface AttributeAccessor {
|
||||
|
||||
/**
|
||||
* Set the attribute defined by <code>name</code> to the supplied <code>value</code>.
|
||||
* If <code>value</code> is <code>null</code>, the attribute is {@link #removeAttribute removed}.
|
||||
* Set the attribute defined by {@code name} to the supplied {@code value}.
|
||||
* If {@code value} is {@code null}, the attribute is {@link #removeAttribute removed}.
|
||||
* <p>In general, users should take care to prevent overlaps with other
|
||||
* metadata attributes by using fully-qualified names, perhaps using
|
||||
* class or package names as prefix.
|
||||
@@ -37,24 +37,24 @@ public interface AttributeAccessor {
|
||||
void setAttribute(String name, Object value);
|
||||
|
||||
/**
|
||||
* Get the value of the attribute identified by <code>name</code>.
|
||||
* Return <code>null</code> if the attribute doesn't exist.
|
||||
* Get the value of the attribute identified by {@code name}.
|
||||
* Return {@code null} if the attribute doesn't exist.
|
||||
* @param name the unique attribute key
|
||||
* @return the current value of the attribute, if any
|
||||
*/
|
||||
Object getAttribute(String name);
|
||||
|
||||
/**
|
||||
* Remove the attribute identified by <code>name</code> and return its value.
|
||||
* Return <code>null</code> if no attribute under <code>name</code> is found.
|
||||
* Remove the attribute identified by {@code name} and return its value.
|
||||
* Return {@code null} if no attribute under {@code name} is found.
|
||||
* @param name the unique attribute key
|
||||
* @return the last value of the attribute, if any
|
||||
*/
|
||||
Object removeAttribute(String name);
|
||||
|
||||
/**
|
||||
* Return <code>true</code> if the attribute identified by <code>name</code> exists.
|
||||
* Otherwise return <code>false</code>.
|
||||
* Return {@code true} if the attribute identified by {@code name} exists.
|
||||
* Otherwise return {@code false}.
|
||||
* @param name the unique attribute key
|
||||
*/
|
||||
boolean hasAttribute(String name);
|
||||
|
||||
@@ -91,7 +91,7 @@ public abstract class BridgeMethodResolver {
|
||||
* Searches for the bridged method in the given candidates.
|
||||
* @param candidateMethods the List of candidate Methods
|
||||
* @param bridgeMethod the bridge method
|
||||
* @return the bridged method, or <code>null</code> if none found
|
||||
* @return the bridged method, or {@code null} if none found
|
||||
*/
|
||||
private static Method searchCandidates(List<Method> candidateMethods, Method bridgeMethod) {
|
||||
if (candidateMethods.isEmpty()) {
|
||||
@@ -114,7 +114,7 @@ public abstract class BridgeMethodResolver {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the supplied '<code>candidateMethod</code>' can be
|
||||
* Returns {@code true} if the supplied '{@code candidateMethod}' can be
|
||||
* consider a validate 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.
|
||||
@@ -166,10 +166,10 @@ public abstract class BridgeMethodResolver {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the {@link Type} signature of both the supplied
|
||||
* Returns {@code true} if the {@link Type} signature of both the supplied
|
||||
* {@link Method#getGenericParameterTypes() generic Method} and concrete {@link Method}
|
||||
* are equal after resolving all {@link TypeVariable TypeVariables} using the supplied
|
||||
* TypeVariable Map, otherwise returns <code>false</code>.
|
||||
* TypeVariable Map, otherwise returns {@code false}.
|
||||
*/
|
||||
private static boolean isResolvedTypeMatch(
|
||||
Method genericMethod, Method candidateMethod, Map<TypeVariable, Type> typeVariableMap) {
|
||||
@@ -205,7 +205,7 @@ public abstract class BridgeMethodResolver {
|
||||
/**
|
||||
* If the supplied {@link Class} has a declared {@link Method} whose signature matches
|
||||
* that of the supplied {@link Method}, then this matching {@link Method} is returned,
|
||||
* otherwise <code>null</code> is returned.
|
||||
* otherwise {@code null} is returned.
|
||||
*/
|
||||
private static Method searchForMatch(Class type, Method bridgeMethod) {
|
||||
return ReflectionUtils.findMethod(type, bridgeMethod.getName(), bridgeMethod.getParameterTypes());
|
||||
|
||||
@@ -187,8 +187,8 @@ public abstract class CollectionFactory {
|
||||
* Determine whether the given collection type is an approximable type,
|
||||
* i.e. a type that {@link #createApproximateCollection} can approximate.
|
||||
* @param collectionType the collection type to check
|
||||
* @return <code>true</code> if the type is approximable,
|
||||
* <code>false</code> if it is not
|
||||
* @return {@code true} if the type is approximable,
|
||||
* {@code false} if it is not
|
||||
*/
|
||||
public static boolean isApproximableCollectionType(Class<?> collectionType) {
|
||||
return (collectionType != null && approximableCollectionTypes.contains(collectionType));
|
||||
@@ -265,8 +265,8 @@ public abstract class CollectionFactory {
|
||||
* Determine whether the given map type is an approximable type,
|
||||
* i.e. a type that {@link #createApproximateMap} can approximate.
|
||||
* @param mapType the map type to check
|
||||
* @return <code>true</code> if the type is approximable,
|
||||
* <code>false</code> if it is not
|
||||
* @return {@code true} if the type is approximable,
|
||||
* {@code false} if it is not
|
||||
*/
|
||||
public static boolean isApproximableMapType(Class<?> mapType) {
|
||||
return (mapType != null && approximableMapTypes.contains(mapType));
|
||||
|
||||
@@ -129,7 +129,7 @@ public class ConfigurableObjectInputStream extends ObjectInputStream {
|
||||
* since there is no fallback available.
|
||||
* @param className the class name to resolve
|
||||
* @param ex the original exception thrown when attempting to load the class
|
||||
* @return the newly resolved class (never <code>null</code>)
|
||||
* @return the newly resolved class (never {@code null})
|
||||
*/
|
||||
protected Class resolveFallbackIfPossible(String className, ClassNotFoundException ex)
|
||||
throws IOException, ClassNotFoundException{
|
||||
@@ -140,7 +140,7 @@ public class ConfigurableObjectInputStream extends ObjectInputStream {
|
||||
/**
|
||||
* Return the fallback ClassLoader to use when no ClassLoader was specified
|
||||
* and ObjectInputStream's own default ClassLoader failed.
|
||||
* <p>The default implementation simply returns <code>null</code>.
|
||||
* <p>The default implementation simply returns {@code null}.
|
||||
*/
|
||||
protected ClassLoader getFallbackClassLoader() throws IOException {
|
||||
return null;
|
||||
|
||||
@@ -28,12 +28,12 @@ import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* This class can be used to parse other classes containing constant definitions
|
||||
* in public static final members. The <code>asXXXX</code> methods of this class
|
||||
* in public static final members. The {@code asXXXX} methods of this class
|
||||
* allow these constant values to be accessed via their string names.
|
||||
*
|
||||
* <p>Consider class Foo containing <code>public final static int CONSTANT1 = 66;</code>
|
||||
* An instance of this class wrapping <code>Foo.class</code> will return the constant value
|
||||
* of 66 from its <code>asNumber</code> method given the argument <code>"CONSTANT1"</code>.
|
||||
* <p>Consider class Foo containing {@code public final static int CONSTANT1 = 66;}
|
||||
* An instance of this class wrapping {@code Foo.class} will return the constant value
|
||||
* of 66 from its {@code asNumber} method given the argument {@code "CONSTANT1"}.
|
||||
*
|
||||
* <p>This class is ideal for use in PropertyEditors, enabling them to
|
||||
* recognize the same names as the constants themselves, and freeing them
|
||||
@@ -56,7 +56,7 @@ public class Constants {
|
||||
* Create a new Constants converter class wrapping the given class.
|
||||
* <p>All <b>public</b> static final variables will be exposed, whatever their type.
|
||||
* @param clazz the class to analyze
|
||||
* @throws IllegalArgumentException if the supplied <code>clazz</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if the supplied {@code clazz} is {@code null}
|
||||
*/
|
||||
public Constants(Class<?> clazz) {
|
||||
Assert.notNull(clazz);
|
||||
@@ -102,7 +102,7 @@ public class Constants {
|
||||
|
||||
/**
|
||||
* Return a constant value cast to a Number.
|
||||
* @param code the name of the field (never <code>null</code>)
|
||||
* @param code the name of the field (never {@code null})
|
||||
* @return the Number value
|
||||
* @see #asObject
|
||||
* @throws ConstantException if the field name wasn't found
|
||||
@@ -118,9 +118,9 @@ public class Constants {
|
||||
|
||||
/**
|
||||
* Return a constant value as a String.
|
||||
* @param code the name of the field (never <code>null</code>)
|
||||
* @param code the name of the field (never {@code null})
|
||||
* @return the String value
|
||||
* Works even if it's not a string (invokes <code>toString()</code>).
|
||||
* Works even if it's not a string (invokes {@code toString()}).
|
||||
* @see #asObject
|
||||
* @throws ConstantException if the field name wasn't found
|
||||
*/
|
||||
@@ -132,7 +132,7 @@ public class Constants {
|
||||
* Parse the given String (upper or lower case accepted) and return
|
||||
* the appropriate value if it's the name of a constant field in the
|
||||
* class that we're analysing.
|
||||
* @param code the name of the field (never <code>null</code>)
|
||||
* @param code the name of the field (never {@code null})
|
||||
* @return the Object value
|
||||
* @throws ConstantException if there's no such field
|
||||
*/
|
||||
@@ -151,10 +151,10 @@ public class Constants {
|
||||
* Return all names of the given group of constants.
|
||||
* <p>Note that this method assumes that constants are named
|
||||
* in accordance with the standard Java convention for constant
|
||||
* values (i.e. all uppercase). The supplied <code>namePrefix</code>
|
||||
* values (i.e. all uppercase). The supplied {@code namePrefix}
|
||||
* will be uppercased (in a locale-insensitive fashion) prior to
|
||||
* the main logic of this method kicking in.
|
||||
* @param namePrefix prefix of the constant names to search (may be <code>null</code>)
|
||||
* @param namePrefix prefix of the constant names to search (may be {@code null})
|
||||
* @return the set of constant names
|
||||
*/
|
||||
public Set<String> getNames(String namePrefix) {
|
||||
@@ -183,10 +183,10 @@ public class Constants {
|
||||
* Return all names of the given group of constants.
|
||||
* <p>Note that this method assumes that constants are named
|
||||
* in accordance with the standard Java convention for constant
|
||||
* values (i.e. all uppercase). The supplied <code>nameSuffix</code>
|
||||
* values (i.e. all uppercase). The supplied {@code nameSuffix}
|
||||
* will be uppercased (in a locale-insensitive fashion) prior to
|
||||
* the main logic of this method kicking in.
|
||||
* @param nameSuffix suffix of the constant names to search (may be <code>null</code>)
|
||||
* @param nameSuffix suffix of the constant names to search (may be {@code null})
|
||||
* @return the set of constant names
|
||||
*/
|
||||
public Set<String> getNamesForSuffix(String nameSuffix) {
|
||||
@@ -205,10 +205,10 @@ public class Constants {
|
||||
* Return all values of the given group of constants.
|
||||
* <p>Note that this method assumes that constants are named
|
||||
* in accordance with the standard Java convention for constant
|
||||
* values (i.e. all uppercase). The supplied <code>namePrefix</code>
|
||||
* values (i.e. all uppercase). The supplied {@code namePrefix}
|
||||
* will be uppercased (in a locale-insensitive fashion) prior to
|
||||
* the main logic of this method kicking in.
|
||||
* @param namePrefix prefix of the constant names to search (may be <code>null</code>)
|
||||
* @param namePrefix prefix of the constant names to search (may be {@code null})
|
||||
* @return the set of values
|
||||
*/
|
||||
public Set<Object> getValues(String namePrefix) {
|
||||
@@ -237,10 +237,10 @@ public class Constants {
|
||||
* Return all values of the given group of constants.
|
||||
* <p>Note that this method assumes that constants are named
|
||||
* in accordance with the standard Java convention for constant
|
||||
* values (i.e. all uppercase). The supplied <code>nameSuffix</code>
|
||||
* values (i.e. all uppercase). The supplied {@code nameSuffix}
|
||||
* will be uppercased (in a locale-insensitive fashion) prior to
|
||||
* the main logic of this method kicking in.
|
||||
* @param nameSuffix suffix of the constant names to search (may be <code>null</code>)
|
||||
* @param nameSuffix suffix of the constant names to search (may be {@code null})
|
||||
* @return the set of values
|
||||
*/
|
||||
public Set<Object> getValuesForSuffix(String nameSuffix) {
|
||||
@@ -259,7 +259,7 @@ public class Constants {
|
||||
* Look up the given value within the given group of constants.
|
||||
* <p>Will return the first match.
|
||||
* @param value constant value to look up
|
||||
* @param namePrefix prefix of the constant names to search (may be <code>null</code>)
|
||||
* @param namePrefix prefix of the constant names to search (may be {@code null})
|
||||
* @return the name of the constant field
|
||||
* @throws ConstantException if the value wasn't found
|
||||
*/
|
||||
@@ -290,7 +290,7 @@ public class Constants {
|
||||
* Look up the given value within the given group of constants.
|
||||
* <p>Will return the first match.
|
||||
* @param value constant value to look up
|
||||
* @param nameSuffix suffix of the constant names to search (may be <code>null</code>)
|
||||
* @param nameSuffix suffix of the constant names to search (may be {@code null})
|
||||
* @return the name of the constant field
|
||||
* @throws ConstantException if the value wasn't found
|
||||
*/
|
||||
|
||||
@@ -60,15 +60,15 @@ public abstract class Conventions {
|
||||
|
||||
/**
|
||||
* Determine the conventional variable name for the supplied
|
||||
* <code>Object</code> based on its concrete type. The convention
|
||||
* used is to return the uncapitalized short name of the <code>Class</code>,
|
||||
* {@code Object} based on its concrete type. The convention
|
||||
* used is to return the uncapitalized short name of the {@code Class},
|
||||
* according to JavaBeans property naming rules: So,
|
||||
* <code>com.myapp.Product</code> becomes <code>product</code>;
|
||||
* <code>com.myapp.MyProduct</code> becomes <code>myProduct</code>;
|
||||
* <code>com.myapp.UKProduct</code> becomes <code>UKProduct</code>.
|
||||
* {@code com.myapp.Product} becomes {@code product};
|
||||
* {@code com.myapp.MyProduct} becomes {@code myProduct};
|
||||
* {@code com.myapp.UKProduct} becomes {@code UKProduct}.
|
||||
* <p>For arrays, we use the pluralized version of the array component type.
|
||||
* For <code>Collection</code>s we attempt to 'peek ahead' in the
|
||||
* <code>Collection</code> to determine the component type and
|
||||
* For {@code Collection}s we attempt to 'peek ahead' in the
|
||||
* {@code Collection} to determine the component type and
|
||||
* return the pluralized version of that component type.
|
||||
* @param value the value to generate a variable name for
|
||||
* @return the generated variable name
|
||||
@@ -144,9 +144,9 @@ public abstract class Conventions {
|
||||
* Determine the conventional variable name for the return type of the supplied method,
|
||||
* taking the generic collection type (if any) into account, falling back to the
|
||||
* given return value if the method declaration is not specific enough (i.e. in case of
|
||||
* the return type being declared as <code>Object</code> or as untyped collection).
|
||||
* the return type being declared as {@code Object} or as untyped collection).
|
||||
* @param method the method to generate a variable name for
|
||||
* @param value the return value (may be <code>null</code> if not available)
|
||||
* @param value the return value (may be {@code null} if not available)
|
||||
* @return the generated variable name
|
||||
*/
|
||||
public static String getVariableNameForReturnType(Method method, Object value) {
|
||||
@@ -157,10 +157,10 @@ public abstract class Conventions {
|
||||
* Determine the conventional variable name for the return type of the supplied method,
|
||||
* taking the generic collection type (if any) into account, falling back to the
|
||||
* given return value if the method declaration is not specific enough (i.e. in case of
|
||||
* the return type being declared as <code>Object</code> or as untyped collection).
|
||||
* the return type being declared as {@code Object} or as untyped collection).
|
||||
* @param method the method to generate a variable name for
|
||||
* @param resolvedType the resolved return type of the method
|
||||
* @param value the return value (may be <code>null</code> if not available)
|
||||
* @param value the return value (may be {@code null} if not available)
|
||||
* @return the generated variable name
|
||||
*/
|
||||
public static String getVariableNameForReturnType(Method method, Class resolvedType, Object value) {
|
||||
@@ -206,9 +206,9 @@ public abstract class Conventions {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert <code>String</code>s in attribute name format (lowercase, hyphens separating words)
|
||||
* into property name format (camel-cased). For example, <code>transaction-manager</code> is
|
||||
* converted into <code>transactionManager</code>.
|
||||
* Convert {@code String}s in attribute name format (lowercase, hyphens separating words)
|
||||
* into property name format (camel-cased). For example, {@code transaction-manager} is
|
||||
* converted into {@code transactionManager}.
|
||||
*/
|
||||
public static String attributeNameToPropertyName(String attributeName) {
|
||||
Assert.notNull(attributeName, "'attributeName' must not be null");
|
||||
@@ -236,8 +236,8 @@ public abstract class Conventions {
|
||||
|
||||
/**
|
||||
* Return an attribute name qualified by the supplied enclosing {@link Class}. For example,
|
||||
* the attribute name '<code>foo</code>' qualified by {@link Class} '<code>com.myapp.SomeClass</code>'
|
||||
* would be '<code>com.myapp.SomeClass.foo</code>'
|
||||
* the attribute name '{@code foo}' qualified by {@link Class} '{@code com.myapp.SomeClass}'
|
||||
* would be '{@code com.myapp.SomeClass.foo}'
|
||||
*/
|
||||
public static String getQualifiedAttributeName(Class enclosingClass, String attributeName) {
|
||||
Assert.notNull(enclosingClass, "'enclosingClass' must not be null");
|
||||
@@ -281,9 +281,9 @@ public abstract class Conventions {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the <code>Class</code> of an element in the <code>Collection</code>.
|
||||
* The exact element for which the <code>Class</code> is retreived will depend
|
||||
* on the concrete <code>Collection</code> implementation.
|
||||
* Retrieves the {@code Class} of an element in the {@code Collection}.
|
||||
* The exact element for which the {@code Class} is retreived will depend
|
||||
* on the concrete {@code Collection} implementation.
|
||||
*/
|
||||
private static Object peekAhead(Collection collection) {
|
||||
Iterator it = collection.iterator();
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface ErrorCoded {
|
||||
* Return the error code associated with this failure.
|
||||
* The GUI can render this any way it pleases, allowing for localization etc.
|
||||
* @return a String error code associated with this failure,
|
||||
* or <code>null</code> if not error-coded
|
||||
* or {@code null} if not error-coded
|
||||
*/
|
||||
String getErrorCode();
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* Determine the generic element type of the given Collection class
|
||||
* (if it declares one through a generic superclass or generic interface).
|
||||
* @param collectionClass the collection class to introspect
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getCollectionType(Class<? extends Collection> collectionClass) {
|
||||
return extractTypeFromClass(collectionClass, Collection.class, 0);
|
||||
@@ -53,7 +53,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* Determine the generic key type of the given Map class
|
||||
* (if it declares one through a generic superclass or generic interface).
|
||||
* @param mapClass the map class to introspect
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapKeyType(Class<? extends Map> mapClass) {
|
||||
return extractTypeFromClass(mapClass, Map.class, 0);
|
||||
@@ -63,7 +63,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* Determine the generic value type of the given Map class
|
||||
* (if it declares one through a generic superclass or generic interface).
|
||||
* @param mapClass the map class to introspect
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapValueType(Class<? extends Map> mapClass) {
|
||||
return extractTypeFromClass(mapClass, Map.class, 1);
|
||||
@@ -72,7 +72,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic element type of the given Collection field.
|
||||
* @param collectionField the collection field to introspect
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getCollectionFieldType(Field collectionField) {
|
||||
return getGenericFieldType(collectionField, Collection.class, 0, null, 1);
|
||||
@@ -84,7 +84,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getCollectionFieldType(Field collectionField, int nestingLevel) {
|
||||
return getGenericFieldType(collectionField, Collection.class, 0, null, nestingLevel);
|
||||
@@ -98,7 +98,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @param typeIndexesPerLevel Map keyed by nesting level, with each value
|
||||
* expressing the type index for traversal at that level
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getCollectionFieldType(Field collectionField, int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
|
||||
return getGenericFieldType(collectionField, Collection.class, 0, typeIndexesPerLevel, nestingLevel);
|
||||
@@ -107,7 +107,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic key type of the given Map field.
|
||||
* @param mapField the map field to introspect
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapKeyFieldType(Field mapField) {
|
||||
return getGenericFieldType(mapField, Map.class, 0, null, 1);
|
||||
@@ -119,7 +119,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel) {
|
||||
return getGenericFieldType(mapField, Map.class, 0, null, nestingLevel);
|
||||
@@ -133,7 +133,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @param typeIndexesPerLevel Map keyed by nesting level, with each value
|
||||
* expressing the type index for traversal at that level
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
|
||||
return getGenericFieldType(mapField, Map.class, 0, typeIndexesPerLevel, nestingLevel);
|
||||
@@ -142,7 +142,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic value type of the given Map field.
|
||||
* @param mapField the map field to introspect
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapValueFieldType(Field mapField) {
|
||||
return getGenericFieldType(mapField, Map.class, 1, null, 1);
|
||||
@@ -154,7 +154,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapValueFieldType(Field mapField, int nestingLevel) {
|
||||
return getGenericFieldType(mapField, Map.class, 1, null, nestingLevel);
|
||||
@@ -168,7 +168,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @param typeIndexesPerLevel Map keyed by nesting level, with each value
|
||||
* expressing the type index for traversal at that level
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapValueFieldType(Field mapField, int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
|
||||
return getGenericFieldType(mapField, Map.class, 1, typeIndexesPerLevel, nestingLevel);
|
||||
@@ -177,7 +177,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic element type of the given Collection parameter.
|
||||
* @param methodParam the method parameter specification
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getCollectionParameterType(MethodParameter methodParam) {
|
||||
return getGenericParameterType(methodParam, Collection.class, 0);
|
||||
@@ -186,7 +186,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic key type of the given Map parameter.
|
||||
* @param methodParam the method parameter specification
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapKeyParameterType(MethodParameter methodParam) {
|
||||
return getGenericParameterType(methodParam, Map.class, 0);
|
||||
@@ -195,7 +195,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic value type of the given Map parameter.
|
||||
* @param methodParam the method parameter specification
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapValueParameterType(MethodParameter methodParam) {
|
||||
return getGenericParameterType(methodParam, Map.class, 1);
|
||||
@@ -204,7 +204,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic element type of the given Collection return type.
|
||||
* @param method the method to check the return type for
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getCollectionReturnType(Method method) {
|
||||
return getGenericReturnType(method, Collection.class, 0, 1);
|
||||
@@ -218,7 +218,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getCollectionReturnType(Method method, int nestingLevel) {
|
||||
return getGenericReturnType(method, Collection.class, 0, nestingLevel);
|
||||
@@ -227,7 +227,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic key type of the given Map return type.
|
||||
* @param method the method to check the return type for
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapKeyReturnType(Method method) {
|
||||
return getGenericReturnType(method, Map.class, 0, 1);
|
||||
@@ -239,7 +239,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapKeyReturnType(Method method, int nestingLevel) {
|
||||
return getGenericReturnType(method, Map.class, 0, nestingLevel);
|
||||
@@ -248,7 +248,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Determine the generic value type of the given Map return type.
|
||||
* @param method the method to check the return type for
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapValueReturnType(Method method) {
|
||||
return getGenericReturnType(method, Map.class, 1, 1);
|
||||
@@ -260,7 +260,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* (typically 1; e.g. in case of a List of Lists, 1 would indicate the
|
||||
* nested List, whereas 2 would indicate the element of the nested List)
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
public static Class<?> getMapValueReturnType(Method method, int nestingLevel) {
|
||||
return getGenericReturnType(method, Map.class, 1, nestingLevel);
|
||||
@@ -273,7 +273,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param source the source class/interface defining the generic parameter types
|
||||
* @param typeIndex the index of the type (e.g. 0 for Collections,
|
||||
* 0 for Map keys, 1 for Map values)
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
private static Class<?> getGenericParameterType(MethodParameter methodParam, Class<?> source, int typeIndex) {
|
||||
return extractType(GenericTypeResolver.getTargetType(methodParam), source, typeIndex,
|
||||
@@ -287,7 +287,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param typeIndex the index of the type (e.g. 0 for Collections,
|
||||
* 0 for Map keys, 1 for Map values)
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
private static Class<?> getGenericFieldType(Field field, Class<?> source, int typeIndex,
|
||||
Map<Integer, Integer> typeIndexesPerLevel, int nestingLevel) {
|
||||
@@ -301,7 +301,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param typeIndex the index of the type (e.g. 0 for Collections,
|
||||
* 0 for Map keys, 1 for Map values)
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* @return the generic type, or <code>null</code> if none
|
||||
* @return the generic type, or {@code null} if none
|
||||
*/
|
||||
private static Class<?> getGenericReturnType(Method method, Class<?> source, int typeIndex, int nestingLevel) {
|
||||
return extractType(method.getGenericReturnType(), source, typeIndex, null, null, nestingLevel, 1);
|
||||
@@ -314,7 +314,7 @@ public abstract class GenericCollectionTypeResolver {
|
||||
* @param typeIndex the index of the actual type argument
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* @param currentLevel the current nested level
|
||||
* @return the generic type as Class, or <code>null</code> if none
|
||||
* @return the generic type as Class, or {@code null} if none
|
||||
*/
|
||||
private static Class<?> extractType(Type type, Class<?> source, int typeIndex,
|
||||
Map<TypeVariable, Type> typeVariableMap, Map<Integer, Integer> typeIndexesPerLevel,
|
||||
@@ -347,11 +347,11 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Extract the generic type from the given ParameterizedType object.
|
||||
* @param ptype the ParameterizedType to check
|
||||
* @param source the expected raw source type (can be <code>null</code>)
|
||||
* @param source the expected raw source type (can be {@code null})
|
||||
* @param typeIndex the index of the actual type argument
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* @param currentLevel the current nested level
|
||||
* @return the generic type as Class, or <code>null</code> if none
|
||||
* @return the generic type as Class, or {@code null} if none
|
||||
*/
|
||||
private static Class<?> extractTypeFromParameterizedType(ParameterizedType ptype, Class<?> source, int typeIndex,
|
||||
Map<TypeVariable, Type> typeVariableMap, Map<Integer, Integer> typeIndexesPerLevel,
|
||||
@@ -421,9 +421,9 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Extract the generic type from the given Class object.
|
||||
* @param clazz the Class to check
|
||||
* @param source the expected raw source type (can be <code>null</code>)
|
||||
* @param source the expected raw source type (can be {@code null})
|
||||
* @param typeIndex the index of the actual type argument
|
||||
* @return the generic type as Class, or <code>null</code> if none
|
||||
* @return the generic type as Class, or {@code null} if none
|
||||
*/
|
||||
private static Class<?> extractTypeFromClass(Class<?> clazz, Class<?> source, int typeIndex) {
|
||||
return extractTypeFromClass(clazz, source, typeIndex, null, null, 1, 1);
|
||||
@@ -432,11 +432,11 @@ public abstract class GenericCollectionTypeResolver {
|
||||
/**
|
||||
* Extract the generic type from the given Class object.
|
||||
* @param clazz the Class to check
|
||||
* @param source the expected raw source type (can be <code>null</code>)
|
||||
* @param source the expected raw source type (can be {@code null})
|
||||
* @param typeIndex the index of the actual type argument
|
||||
* @param nestingLevel the nesting level of the target type
|
||||
* @param currentLevel the current nested level
|
||||
* @return the generic type as Class, or <code>null</code> if none
|
||||
* @return the generic type as Class, or {@code null} if none
|
||||
*/
|
||||
private static Class<?> extractTypeFromClass(Class<?> clazz, Class<?> source, int typeIndex,
|
||||
Map<TypeVariable, Type> typeVariableMap, Map<Integer, Integer> typeIndexesPerLevel,
|
||||
|
||||
@@ -236,7 +236,7 @@ public abstract class GenericTypeResolver {
|
||||
* of it.
|
||||
* @param method the target method to check the return type of
|
||||
* @param genericIfc the generic interface or superclass to resolve the type argument from
|
||||
* @return the resolved parameter type of the method return type, or <code>null</code>
|
||||
* @return the resolved parameter type of the method return type, or {@code null}
|
||||
* if not resolvable or if the single argument is of type {@link WildcardType}.
|
||||
*/
|
||||
public static Class<?> resolveReturnTypeArgument(Method method, Class<?> genericIfc) {
|
||||
@@ -265,7 +265,7 @@ public abstract class GenericTypeResolver {
|
||||
* and possibly declare a concrete type for its type variable.
|
||||
* @param clazz the target class to check against
|
||||
* @param genericIfc the generic interface or superclass to resolve the type argument from
|
||||
* @return the resolved type of the argument, or <code>null</code> if not resolvable
|
||||
* @return the resolved type of the argument, or {@code null} if not resolvable
|
||||
*/
|
||||
public static Class<?> resolveTypeArgument(Class clazz, Class genericIfc) {
|
||||
Class[] typeArgs = resolveTypeArguments(clazz, genericIfc);
|
||||
@@ -286,7 +286,7 @@ public abstract class GenericTypeResolver {
|
||||
* @param clazz the target class to check against
|
||||
* @param genericIfc the generic interface or superclass to resolve the type argument from
|
||||
* @return the resolved type of each argument, with the array size matching the
|
||||
* number of actual type arguments, or <code>null</code> if not resolvable
|
||||
* number of actual type arguments, or {@code null} if not resolvable
|
||||
*/
|
||||
public static Class[] resolveTypeArguments(Class clazz, Class genericIfc) {
|
||||
return doResolveTypeArguments(clazz, clazz, genericIfc);
|
||||
@@ -368,7 +368,7 @@ public abstract class GenericTypeResolver {
|
||||
* Resolve the specified generic type against the given TypeVariable map.
|
||||
* @param genericType the generic type to resolve
|
||||
* @param typeVariableMap the TypeVariable Map to resolved against
|
||||
* @return the type if it resolves to a Class, or <code>Object.class</code> otherwise
|
||||
* @return the type if it resolves to a Class, or {@code Object.class} otherwise
|
||||
*/
|
||||
public static Class<?> resolveType(Type genericType, Map<TypeVariable, Type> typeVariableMap) {
|
||||
Type resolvedType = getRawType(genericType, typeVariableMap);
|
||||
@@ -449,7 +449,7 @@ public abstract class GenericTypeResolver {
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the bound <code>Type</code> for a given {@link TypeVariable}.
|
||||
* Extracts the bound {@code Type} for a given {@link TypeVariable}.
|
||||
*/
|
||||
static Type extractBoundForTypeVariable(TypeVariable typeVariable) {
|
||||
Type[] bounds = typeVariable.getBounds();
|
||||
@@ -493,7 +493,7 @@ public abstract class GenericTypeResolver {
|
||||
* public class FooImpl implements Foo<String, Integer> {
|
||||
* ..
|
||||
* }</pre>
|
||||
* For '<code>FooImpl</code>' the following mappings would be added to the {@link Map}:
|
||||
* For '{@code FooImpl}' the following mappings would be added to the {@link Map}:
|
||||
* {S=java.lang.String, T=java.lang.Integer}.
|
||||
*/
|
||||
private static void populateTypeMapFromParameterizedType(ParameterizedType type, Map<TypeVariable, Type> typeVariableMap) {
|
||||
|
||||
@@ -36,7 +36,7 @@ package org.springframework.core;
|
||||
public interface InfrastructureProxy {
|
||||
|
||||
/**
|
||||
* Return the underlying resource (never <code>null</code>).
|
||||
* Return the underlying resource (never {@code null}).
|
||||
*/
|
||||
Object getWrappedObject();
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class JdkVersion {
|
||||
|
||||
/**
|
||||
* Return the full Java version string, as returned by
|
||||
* <code>System.getProperty("java.version")</code>.
|
||||
* {@code System.getProperty("java.version")}.
|
||||
* @return the full Java version string
|
||||
* @see System#getProperty(String)
|
||||
*/
|
||||
@@ -87,7 +87,7 @@ public abstract class JdkVersion {
|
||||
|
||||
/**
|
||||
* Get the major version code. This means we can do things like
|
||||
* <code>if (getMajorJavaVersion() < JAVA_14)</code>.
|
||||
* {@code if (getMajorJavaVersion() < JAVA_14)}.
|
||||
* @return a code comparable to the JAVA_XX codes in this class
|
||||
* @see #JAVA_13
|
||||
* @see #JAVA_14
|
||||
@@ -102,7 +102,7 @@ public abstract class JdkVersion {
|
||||
|
||||
/**
|
||||
* Convenience method to determine if the current JVM is at least Java 1.4.
|
||||
* @return <code>true</code> if the current JVM is at least Java 1.4
|
||||
* @return {@code true} if the current JVM is at least Java 1.4
|
||||
* @deprecated as of Spring 3.0 which requires Java 1.5+
|
||||
* @see #getMajorJavaVersion()
|
||||
* @see #JAVA_14
|
||||
@@ -118,7 +118,7 @@ public abstract class JdkVersion {
|
||||
/**
|
||||
* Convenience method to determine if the current JVM is at least
|
||||
* Java 1.5 (Java 5).
|
||||
* @return <code>true</code> if the current JVM is at least Java 1.5
|
||||
* @return {@code true} if the current JVM is at least Java 1.5
|
||||
* @deprecated as of Spring 3.0 which requires Java 1.5+
|
||||
* @see #getMajorJavaVersion()
|
||||
* @see #JAVA_15
|
||||
@@ -133,7 +133,7 @@ public abstract class JdkVersion {
|
||||
/**
|
||||
* Convenience method to determine if the current JVM is at least
|
||||
* Java 1.6 (Java 6).
|
||||
* @return <code>true</code> if the current JVM is at least Java 1.6
|
||||
* @return {@code true} if the current JVM is at least Java 1.6
|
||||
* @deprecated as of Spring 3.0, in favor of reflective checks for
|
||||
* the specific Java 1.6 classes of interest
|
||||
* @see #getMajorJavaVersion()
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.springframework.util.ClassUtils;
|
||||
/**
|
||||
* Implementation of {@link ParameterNameDiscoverer} that uses the LocalVariableTable
|
||||
* information in the method attributes to discover parameter names. Returns
|
||||
* <code>null</code> if the class file was compiled without debug information.
|
||||
* {@code null} if the class file was compiled without debug information.
|
||||
*
|
||||
* <p>Uses ObjectWeb's ASM library for analyzing class files. Each discoverer instance
|
||||
* caches the ASM discovered information for each introspected Class, in a thread-safe
|
||||
|
||||
@@ -145,7 +145,7 @@ public class MethodParameter {
|
||||
/**
|
||||
* Return the wrapped Method, if any.
|
||||
* <p>Note: Either Method or Constructor is available.
|
||||
* @return the Method, or <code>null</code> if none
|
||||
* @return the Method, or {@code null} if none
|
||||
*/
|
||||
public Method getMethod() {
|
||||
return this.method;
|
||||
@@ -154,7 +154,7 @@ public class MethodParameter {
|
||||
/**
|
||||
* Return the wrapped Constructor, if any.
|
||||
* <p>Note: Either Method or Constructor is available.
|
||||
* @return the Constructor, or <code>null</code> if none
|
||||
* @return the Constructor, or {@code null} if none
|
||||
*/
|
||||
public Constructor getConstructor() {
|
||||
return this.constructor;
|
||||
@@ -200,7 +200,7 @@ public class MethodParameter {
|
||||
|
||||
/**
|
||||
* Return the type of the method/constructor parameter.
|
||||
* @return the parameter type (never <code>null</code>)
|
||||
* @return the parameter type (never {@code null})
|
||||
*/
|
||||
public Class<?> getParameterType() {
|
||||
if (this.parameterType == null) {
|
||||
@@ -218,7 +218,7 @@ public class MethodParameter {
|
||||
|
||||
/**
|
||||
* Return the generic type of the method/constructor parameter.
|
||||
* @return the parameter type (never <code>null</code>)
|
||||
* @return the parameter type (never {@code null})
|
||||
*/
|
||||
public Type getGenericParameterType() {
|
||||
if (this.genericParameterType == null) {
|
||||
@@ -267,7 +267,7 @@ public class MethodParameter {
|
||||
/**
|
||||
* Return the method/constructor annotation of the given type, if available.
|
||||
* @param annotationType the annotation type to look for
|
||||
* @return the annotation object, or <code>null</code> if not found
|
||||
* @return the annotation object, or {@code null} if not found
|
||||
*/
|
||||
public <T extends Annotation> T getMethodAnnotation(Class<T> annotationType) {
|
||||
return getAnnotatedElement().getAnnotation(annotationType);
|
||||
@@ -293,7 +293,7 @@ public class MethodParameter {
|
||||
/**
|
||||
* Return the parameter annotation of the given type, if available.
|
||||
* @param annotationType the annotation type to look for
|
||||
* @return the annotation object, or <code>null</code> if not found
|
||||
* @return the annotation object, or {@code null} if not found
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Annotation> T getParameterAnnotation(Class<T> annotationType) {
|
||||
@@ -332,7 +332,7 @@ public class MethodParameter {
|
||||
|
||||
/**
|
||||
* Return the name of the method/constructor parameter.
|
||||
* @return the parameter name (may be <code>null</code> if no
|
||||
* @return the parameter name (may be {@code null} if no
|
||||
* parameter name metadata is contained in the class file or no
|
||||
* {@link #initParameterNameDiscovery ParameterNameDiscoverer}
|
||||
* has been set to begin with)
|
||||
@@ -379,7 +379,7 @@ public class MethodParameter {
|
||||
/**
|
||||
* Set the type index for the current nesting level.
|
||||
* @param typeIndex the corresponding type index
|
||||
* (or <code>null</code> for the default type index)
|
||||
* (or {@code null} for the default type index)
|
||||
* @see #getNestingLevel()
|
||||
*/
|
||||
public void setTypeIndexForCurrentLevel(int typeIndex) {
|
||||
@@ -388,7 +388,7 @@ public class MethodParameter {
|
||||
|
||||
/**
|
||||
* Return the type index for the current nesting level.
|
||||
* @return the corresponding type index, or <code>null</code>
|
||||
* @return the corresponding type index, or {@code null}
|
||||
* if none specified (indicating the default type index)
|
||||
* @see #getNestingLevel()
|
||||
*/
|
||||
@@ -399,7 +399,7 @@ public class MethodParameter {
|
||||
/**
|
||||
* Return the type index for the specified nesting level.
|
||||
* @param nestingLevel the nesting level to check
|
||||
* @return the corresponding type index, or <code>null</code>
|
||||
* @return the corresponding type index, or {@code null}
|
||||
* if none specified (indicating the default type index)
|
||||
*/
|
||||
public Integer getTypeIndexForLevel(int nestingLevel) {
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
package org.springframework.core;
|
||||
|
||||
/**
|
||||
* Handy class for wrapping checked <code>Exceptions</code> with a root cause.
|
||||
* Handy class for wrapping checked {@code Exceptions} with a root cause.
|
||||
*
|
||||
* <p>This class is <code>abstract</code> to force the programmer to extend
|
||||
* the class. <code>getMessage</code> will include nested exception
|
||||
* information; <code>printStackTrace</code> and other like methods will
|
||||
* <p>This class is {@code abstract} to force the programmer to extend
|
||||
* the class. {@code getMessage} will include nested exception
|
||||
* information; {@code printStackTrace} and other like methods will
|
||||
* delegate to the wrapped exception, if any.
|
||||
*
|
||||
* <p>The similarity between this class and the {@link NestedRuntimeException}
|
||||
@@ -47,7 +47,7 @@ public abstract class NestedCheckedException extends Exception {
|
||||
|
||||
|
||||
/**
|
||||
* Construct a <code>NestedCheckedException</code> with the specified detail message.
|
||||
* Construct a {@code NestedCheckedException} with the specified detail message.
|
||||
* @param msg the detail message
|
||||
*/
|
||||
public NestedCheckedException(String msg) {
|
||||
@@ -55,7 +55,7 @@ public abstract class NestedCheckedException extends Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a <code>NestedCheckedException</code> with the specified detail message
|
||||
* Construct a {@code NestedCheckedException} with the specified detail message
|
||||
* and nested exception.
|
||||
* @param msg the detail message
|
||||
* @param cause the nested exception
|
||||
@@ -77,7 +77,7 @@ public abstract class NestedCheckedException extends Exception {
|
||||
|
||||
/**
|
||||
* Retrieve the innermost cause of this exception, if any.
|
||||
* @return the innermost exception, or <code>null</code> if none
|
||||
* @return the innermost exception, or {@code null} if none
|
||||
*/
|
||||
public Throwable getRootCause() {
|
||||
Throwable rootCause = null;
|
||||
@@ -94,7 +94,7 @@ public abstract class NestedCheckedException extends Exception {
|
||||
* either the innermost cause (root cause) or this exception itself.
|
||||
* <p>Differs from {@link #getRootCause()} in that it falls back
|
||||
* to the present exception if there is no root cause.
|
||||
* @return the most specific cause (never <code>null</code>)
|
||||
* @return the most specific cause (never {@code null})
|
||||
* @since 2.0.3
|
||||
*/
|
||||
public Throwable getMostSpecificCause() {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class NestedIOException extends IOException {
|
||||
|
||||
|
||||
/**
|
||||
* Construct a <code>NestedIOException</code> with the specified detail message.
|
||||
* Construct a {@code NestedIOException} with the specified detail message.
|
||||
* @param msg the detail message
|
||||
*/
|
||||
public NestedIOException(String msg) {
|
||||
@@ -53,7 +53,7 @@ public class NestedIOException extends IOException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a <code>NestedIOException</code> with the specified detail message
|
||||
* Construct a {@code NestedIOException} with the specified detail message
|
||||
* and nested exception.
|
||||
* @param msg the detail message
|
||||
* @param cause the nested exception
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
package org.springframework.core;
|
||||
|
||||
/**
|
||||
* Handy class for wrapping runtime <code>Exceptions</code> with a root cause.
|
||||
* Handy class for wrapping runtime {@code Exceptions} with a root cause.
|
||||
*
|
||||
* <p>This class is <code>abstract</code> to force the programmer to extend
|
||||
* the class. <code>getMessage</code> will include nested exception
|
||||
* information; <code>printStackTrace</code> and other like methods will
|
||||
* <p>This class is {@code abstract} to force the programmer to extend
|
||||
* the class. {@code getMessage} will include nested exception
|
||||
* information; {@code printStackTrace} and other like methods will
|
||||
* delegate to the wrapped exception, if any.
|
||||
*
|
||||
* <p>The similarity between this class and the {@link NestedCheckedException}
|
||||
@@ -47,7 +47,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
|
||||
|
||||
|
||||
/**
|
||||
* Construct a <code>NestedRuntimeException</code> with the specified detail message.
|
||||
* Construct a {@code NestedRuntimeException} with the specified detail message.
|
||||
* @param msg the detail message
|
||||
*/
|
||||
public NestedRuntimeException(String msg) {
|
||||
@@ -55,7 +55,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a <code>NestedRuntimeException</code> with the specified detail message
|
||||
* Construct a {@code NestedRuntimeException} with the specified detail message
|
||||
* and nested exception.
|
||||
* @param msg the detail message
|
||||
* @param cause the nested exception
|
||||
@@ -77,7 +77,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
|
||||
|
||||
/**
|
||||
* Retrieve the innermost cause of this exception, if any.
|
||||
* @return the innermost exception, or <code>null</code> if none
|
||||
* @return the innermost exception, or {@code null} if none
|
||||
* @since 2.0
|
||||
*/
|
||||
public Throwable getRootCause() {
|
||||
@@ -95,7 +95,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
|
||||
* either the innermost cause (root cause) or this exception itself.
|
||||
* <p>Differs from {@link #getRootCause()} in that it falls back
|
||||
* to the present exception if there is no root cause.
|
||||
* @return the most specific cause (never <code>null</code>)
|
||||
* @return the most specific cause (never {@code null})
|
||||
* @since 2.0.3
|
||||
*/
|
||||
public Throwable getMostSpecificCause() {
|
||||
|
||||
@@ -25,9 +25,9 @@ import java.util.List;
|
||||
* {@link Comparator} implementation for {@link Ordered} objects,
|
||||
* sorting by order value ascending (resp. by priority descending).
|
||||
*
|
||||
* <p>Non-<code>Ordered</code> objects are treated as greatest order
|
||||
* <p>Non-{@code Ordered} objects are treated as greatest order
|
||||
* values, thus ending up at the end of the list, in arbitrary order
|
||||
* (just like same order values of <code>Ordered</code> objects).
|
||||
* (just like same order values of {@code Ordered} objects).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 07.04.2003
|
||||
@@ -64,7 +64,7 @@ public class OrderComparator implements Comparator<Object> {
|
||||
* <p>The default implementation checks against the {@link Ordered}
|
||||
* interface. Can be overridden in subclasses.
|
||||
* @param obj the object to check
|
||||
* @return the order value, or <code>Ordered.LOWEST_PRECEDENCE</code> as fallback
|
||||
* @return the order value, or {@code Ordered.LOWEST_PRECEDENCE} as fallback
|
||||
*/
|
||||
protected int getOrder(Object obj) {
|
||||
return (obj instanceof Ordered ? ((Ordered) obj).getOrder() : Ordered.LOWEST_PRECEDENCE);
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface Ordered {
|
||||
/**
|
||||
* Return the order value of this object, with a
|
||||
* higher value meaning greater in terms of sorting.
|
||||
* <p>Normally starting with 0, with <code>Integer.MAX_VALUE</code>
|
||||
* <p>Normally starting with 0, with {@code Integer.MAX_VALUE}
|
||||
* indicating the greatest value. Same order values will result
|
||||
* in arbitrary positions for the affected objects.
|
||||
* <p>Higher values can be interpreted as lower priority. As a
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.io.InputStream;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
* <code>ClassLoader</code> that does <i>not</i> always delegate to the
|
||||
* {@code ClassLoader} that does <i>not</i> always delegate to the
|
||||
* parent loader, as normal class loaders do. This enables, for example,
|
||||
* instrumentation to be forced in the overriding ClassLoader, or a
|
||||
* "throwaway" class loading behavior, where selected classes are
|
||||
@@ -87,7 +87,7 @@ public class OverridingClassLoader extends DecoratingClassLoader {
|
||||
* <p>The default implementation delegates to {@link #findLoadedClass},
|
||||
* {@link #loadBytesForClass} and {@link #defineClass}.
|
||||
* @param name the name of the class
|
||||
* @return the Class object, or <code>null</code> if no class defined for that name
|
||||
* @return the Class object, or {@code null} if no class defined for that name
|
||||
* @throws ClassNotFoundException if the class for the given name couldn't be loaded
|
||||
*/
|
||||
protected Class loadClassForOverriding(String name) throws ClassNotFoundException {
|
||||
@@ -108,7 +108,7 @@ public class OverridingClassLoader extends DecoratingClassLoader {
|
||||
* and {@link #transformIfNecessary}.
|
||||
* @param name the name of the class
|
||||
* @return the byte content (with transformers already applied),
|
||||
* or <code>null</code> if no class defined for that name
|
||||
* or {@code null} if no class defined for that name
|
||||
* @throws ClassNotFoundException if the class for the given name couldn't be loaded
|
||||
*/
|
||||
protected byte[] loadBytesForClass(String name) throws ClassNotFoundException {
|
||||
@@ -130,7 +130,7 @@ public class OverridingClassLoader extends DecoratingClassLoader {
|
||||
/**
|
||||
* Open an InputStream for the specified class.
|
||||
* <p>The default implementation loads a standard class file through
|
||||
* the parent ClassLoader's <code>getResourceAsStream</code> method.
|
||||
* the parent ClassLoader's {@code getResourceAsStream} method.
|
||||
* @param name the name of the class
|
||||
* @return the InputStream containing the byte code for the specified class
|
||||
*/
|
||||
@@ -145,7 +145,7 @@ public class OverridingClassLoader extends DecoratingClassLoader {
|
||||
* <p>The default implementation simply returns the given bytes as-is.
|
||||
* @param name the fully-qualified name of the class being transformed
|
||||
* @param bytes the raw bytes of the class
|
||||
* @return the transformed bytes (never <code>null</code>;
|
||||
* @return the transformed bytes (never {@code null};
|
||||
* same as the input bytes if the transformation produced no changes)
|
||||
*/
|
||||
protected byte[] transformIfNecessary(String name, byte[] bytes) {
|
||||
|
||||
@@ -35,19 +35,19 @@ public interface ParameterNameDiscoverer {
|
||||
|
||||
/**
|
||||
* Return parameter names for this method,
|
||||
* or <code>null</code> if they cannot be determined.
|
||||
* or {@code null} if they cannot be determined.
|
||||
* @param method method to find parameter names for
|
||||
* @return an array of parameter names if the names can be resolved,
|
||||
* or <code>null</code> if they cannot
|
||||
* or {@code null} if they cannot
|
||||
*/
|
||||
String[] getParameterNames(Method method);
|
||||
|
||||
/**
|
||||
* Return parameter names for this constructor,
|
||||
* or <code>null</code> if they cannot be determined.
|
||||
* or {@code null} if they cannot be determined.
|
||||
* @param ctor constructor to find parameter names for
|
||||
* @return an array of parameter names if the names can be resolved,
|
||||
* or <code>null</code> if they cannot
|
||||
* or {@code null} if they cannot
|
||||
*/
|
||||
String[] getParameterNames(Constructor<?> ctor);
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* ParameterNameDiscoverer implementation that tries several ParameterNameDiscoverers
|
||||
* in succession. Those added first in the <code>addDiscoverer</code> method have
|
||||
* highest priority. If one returns <code>null</code>, the next will be tried.
|
||||
* in succession. Those added first in the {@code addDiscoverer} method have
|
||||
* highest priority. If one returns {@code null}, the next will be tried.
|
||||
*
|
||||
* <p>The default behavior is always to return <code>null</code>
|
||||
* <p>The default behavior is always to return {@code null}
|
||||
* if no discoverer matches.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SimpleAliasRegistry implements AliasRegistry {
|
||||
|
||||
/**
|
||||
* Return whether alias overriding is allowed.
|
||||
* Default is <code>true</code>.
|
||||
* Default is {@code true}.
|
||||
*/
|
||||
protected boolean allowAliasOverriding() {
|
||||
return true;
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface SmartClassLoader {
|
||||
* ClassLoader) or whether it should be reobtained every time.
|
||||
* @param clazz the class to check (usually loaded from this ClassLoader)
|
||||
* @return whether the class should be expected to appear in a reloaded
|
||||
* version (with a different <code>Class</code> object) later on
|
||||
* version (with a different {@code Class} object) later on
|
||||
*/
|
||||
boolean isClassReloadable(Class clazz);
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ public class SpringVersion {
|
||||
|
||||
/**
|
||||
* Return the full version string of the present Spring codebase,
|
||||
* or <code>null</code> if it cannot be determined.
|
||||
* @see java.lang.Package#getImplementationVersion()
|
||||
* or {@code null} if it cannot be determined.
|
||||
* @see Package#getImplementationVersion()
|
||||
*/
|
||||
public static String getVersion() {
|
||||
Package pkg = SpringVersion.class.getPackage();
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.core.Ordered;
|
||||
* {@link java.util.Comparator} implementation that checks
|
||||
* {@link org.springframework.core.Ordered} as well as the
|
||||
* {@link Order} annotation, with an order value provided by an
|
||||
* <code>Ordered</code> instance overriding a statically defined
|
||||
* {@code Ordered} instance overriding a statically defined
|
||||
* annotation value (if any).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -89,7 +89,7 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single {@link Annotation} of <code>annotationType</code> from the supplied {@link Method}.
|
||||
* Get a single {@link Annotation} of {@code annotationType} from the supplied {@link Method}.
|
||||
* <p>Correctly handles bridge {@link Method Methods} generated by the compiler.
|
||||
* @param method the method to look for annotations on
|
||||
* @param annotationType the annotation class to look for
|
||||
@@ -111,12 +111,12 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single {@link Annotation} of <code>annotationType</code> from the supplied {@link Method},
|
||||
* Get a single {@link Annotation} of {@code annotationType} from the supplied {@link Method},
|
||||
* traversing its super methods if no annotation can be found on the given method itself.
|
||||
* <p>Annotations on methods are not inherited by default, so we need to handle this explicitly.
|
||||
* @param method the method to look for annotations on
|
||||
* @param annotationType the annotation class to look for
|
||||
* @return the annotation found, or <code>null</code> if none found
|
||||
* @return the annotation found, or {@code null} if none found
|
||||
*/
|
||||
public static <A extends Annotation> A findAnnotation(Method method, Class<A> annotationType) {
|
||||
A annotation = getAnnotation(method, annotationType);
|
||||
@@ -181,7 +181,7 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a single {@link Annotation} of <code>annotationType</code> from the supplied {@link Class},
|
||||
* Find a single {@link Annotation} of {@code annotationType} from the supplied {@link Class},
|
||||
* traversing its interfaces and superclasses if no annotation can be found on the given class itself.
|
||||
* <p>This method explicitly handles class-level annotations which are not declared as
|
||||
* {@link java.lang.annotation.Inherited inherited} <i>as well as annotations on interfaces</i>.
|
||||
@@ -193,7 +193,7 @@ public abstract class AnnotationUtils {
|
||||
* hierarchy if no match is found.
|
||||
* @param clazz the class to look for annotations on
|
||||
* @param annotationType the annotation class to look for
|
||||
* @return the annotation found, or <code>null</code> if none found
|
||||
* @return the annotation found, or {@code null} if none found
|
||||
*/
|
||||
public static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A> annotationType) {
|
||||
Assert.notNull(clazz, "Class must not be null");
|
||||
@@ -223,20 +223,20 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the first {@link Class} in the inheritance hierarchy of the specified <code>clazz</code>
|
||||
* (including the specified <code>clazz</code> itself) which declares an annotation for the
|
||||
* specified <code>annotationType</code>, or <code>null</code> if not found. If the supplied
|
||||
* <code>clazz</code> is <code>null</code>, <code>null</code> will be returned.
|
||||
* <p>If the supplied <code>clazz</code> is an interface, only the interface itself will be checked;
|
||||
* Find the first {@link Class} in the inheritance hierarchy of the specified {@code clazz}
|
||||
* (including the specified {@code clazz} itself) which declares an annotation for the
|
||||
* specified {@code annotationType}, or {@code null} if not found. If the supplied
|
||||
* {@code clazz} is {@code null}, {@code null} will be returned.
|
||||
* <p>If the supplied {@code clazz} is an interface, only the interface itself will be checked;
|
||||
* the inheritance hierarchy for interfaces will not be traversed.
|
||||
* <p>The standard {@link Class} API does not provide a mechanism for determining which class
|
||||
* in an inheritance hierarchy actually declares an {@link Annotation}, so we need to handle
|
||||
* this explicitly.
|
||||
* @param annotationType the Class object corresponding to the annotation type
|
||||
* @param clazz the Class object corresponding to the class on which to check for the annotation,
|
||||
* or <code>null</code>
|
||||
* @return the first {@link Class} in the inheritance hierarchy of the specified <code>clazz</code>
|
||||
* which declares an annotation for the specified <code>annotationType</code>, or <code>null</code>
|
||||
* or {@code null}
|
||||
* @return the first {@link Class} in the inheritance hierarchy of the specified {@code clazz}
|
||||
* which declares an annotation for the specified {@code annotationType}, or {@code null}
|
||||
* if not found
|
||||
* @see Class#isAnnotationPresent(Class)
|
||||
* @see Class#getDeclaredAnnotations()
|
||||
@@ -251,16 +251,16 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether an annotation for the specified <code>annotationType</code> is
|
||||
* declared locally on the supplied <code>clazz</code>. The supplied {@link Class}
|
||||
* Determine whether an annotation for the specified {@code annotationType} is
|
||||
* declared locally on the supplied {@code clazz}. The supplied {@link Class}
|
||||
* may represent any type.
|
||||
* <p>Note: This method does <strong>not</strong> determine if the annotation is
|
||||
* {@link java.lang.annotation.Inherited inherited}. For greater clarity regarding inherited
|
||||
* annotations, consider using {@link #isAnnotationInherited(Class, Class)} instead.
|
||||
* @param annotationType the Class object corresponding to the annotation type
|
||||
* @param clazz the Class object corresponding to the class on which to check for the annotation
|
||||
* @return <code>true</code> if an annotation for the specified <code>annotationType</code>
|
||||
* is declared locally on the supplied <code>clazz</code>
|
||||
* @return {@code true} if an annotation for the specified {@code annotationType}
|
||||
* is declared locally on the supplied {@code clazz}
|
||||
* @see Class#getDeclaredAnnotations()
|
||||
* @see #isAnnotationInherited(Class, Class)
|
||||
*/
|
||||
@@ -278,17 +278,17 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether an annotation for the specified <code>annotationType</code> is present
|
||||
* on the supplied <code>clazz</code> and is {@link java.lang.annotation.Inherited inherited}
|
||||
* Determine whether an annotation for the specified {@code annotationType} is present
|
||||
* on the supplied {@code clazz} and is {@link java.lang.annotation.Inherited inherited}
|
||||
* i.e., not declared locally for the class).
|
||||
* <p>If the supplied <code>clazz</code> is an interface, only the interface itself will be checked.
|
||||
* <p>If the supplied {@code clazz} is an interface, only the interface itself will be checked.
|
||||
* In accordance with standard meta-annotation semantics, the inheritance hierarchy for interfaces
|
||||
* will not be traversed. See the {@link java.lang.annotation.Inherited JavaDoc} for the
|
||||
* @Inherited meta-annotation for further details regarding annotation inheritance.
|
||||
* @param annotationType the Class object corresponding to the annotation type
|
||||
* @param clazz the Class object corresponding to the class on which to check for the annotation
|
||||
* @return <code>true</code> if an annotation for the specified <code>annotationType</code> is present
|
||||
* on the supplied <code>clazz</code> and is {@link java.lang.annotation.Inherited inherited}
|
||||
* @return {@code true} if an annotation for the specified {@code annotationType} is present
|
||||
* on the supplied {@code clazz} and is {@link java.lang.annotation.Inherited inherited}
|
||||
* @see Class#isAnnotationPresent(Class)
|
||||
* @see #isAnnotationDeclaredLocally(Class, Class)
|
||||
*/
|
||||
@@ -395,10 +395,10 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the <em>value</em> of the <code>"value"</code> attribute of a
|
||||
* Retrieve the <em>value</em> of the {@code "value"} attribute of a
|
||||
* single-element Annotation, given an annotation instance.
|
||||
* @param annotation the annotation instance from which to retrieve the value
|
||||
* @return the attribute value, or <code>null</code> if not found
|
||||
* @return the attribute value, or {@code null} if not found
|
||||
* @see #getValue(Annotation, String)
|
||||
*/
|
||||
public static Object getValue(Annotation annotation) {
|
||||
@@ -409,7 +409,7 @@ public abstract class AnnotationUtils {
|
||||
* Retrieve the <em>value</em> of a named Annotation attribute, given an annotation instance.
|
||||
* @param annotation the annotation instance from which to retrieve the value
|
||||
* @param attributeName the name of the attribute value to retrieve
|
||||
* @return the attribute value, or <code>null</code> if not found
|
||||
* @return the attribute value, or {@code null} if not found
|
||||
* @see #getValue(Annotation)
|
||||
*/
|
||||
public static Object getValue(Annotation annotation, String attributeName) {
|
||||
@@ -423,10 +423,10 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the <em>default value</em> of the <code>"value"</code> attribute
|
||||
* Retrieve the <em>default value</em> of the {@code "value"} attribute
|
||||
* of a single-element Annotation, given an annotation instance.
|
||||
* @param annotation the annotation instance from which to retrieve the default value
|
||||
* @return the default value, or <code>null</code> if not found
|
||||
* @return the default value, or {@code null} if not found
|
||||
* @see #getDefaultValue(Annotation, String)
|
||||
*/
|
||||
public static Object getDefaultValue(Annotation annotation) {
|
||||
@@ -437,7 +437,7 @@ public abstract class AnnotationUtils {
|
||||
* Retrieve the <em>default value</em> of a named Annotation attribute, given an annotation instance.
|
||||
* @param annotation the annotation instance from which to retrieve the default value
|
||||
* @param attributeName the name of the attribute value to retrieve
|
||||
* @return the default value of the named attribute, or <code>null</code> if not found
|
||||
* @return the default value of the named attribute, or {@code null} if not found
|
||||
* @see #getDefaultValue(Class, String)
|
||||
*/
|
||||
public static Object getDefaultValue(Annotation annotation, String attributeName) {
|
||||
@@ -445,10 +445,10 @@ public abstract class AnnotationUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the <em>default value</em> of the <code>"value"</code> attribute
|
||||
* Retrieve the <em>default value</em> of the {@code "value"} attribute
|
||||
* of a single-element Annotation, given the {@link Class annotation type}.
|
||||
* @param annotationType the <em>annotation type</em> for which the default value should be retrieved
|
||||
* @return the default value, or <code>null</code> if not found
|
||||
* @return the default value, or {@code null} if not found
|
||||
* @see #getDefaultValue(Class, String)
|
||||
*/
|
||||
public static Object getDefaultValue(Class<? extends Annotation> annotationType) {
|
||||
@@ -459,7 +459,7 @@ public abstract class AnnotationUtils {
|
||||
* Retrieve the <em>default value</em> of a named Annotation attribute, given the {@link Class annotation type}.
|
||||
* @param annotationType the <em>annotation type</em> for which the default value should be retrieved
|
||||
* @param attributeName the name of the attribute value to retrieve.
|
||||
* @return the default value of the named attribute, or <code>null</code> if not found
|
||||
* @return the default value of the named attribute, or {@code null} if not found
|
||||
* @see #getDefaultValue(Annotation, String)
|
||||
*/
|
||||
public static Object getDefaultValue(Class<? extends Annotation> annotationType, String attributeName) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.core.Ordered;
|
||||
/**
|
||||
* Annotation that defines ordering. The value is optional, and represents order value
|
||||
* as defined in the {@link Ordered} interface. Lower values have higher priority.
|
||||
* The default value is <code>Ordered.LOWEST_PRECEDENCE</code>, indicating
|
||||
* The default value is {@code Ordered.LOWEST_PRECEDENCE}, indicating
|
||||
* lowest priority (losing to any other specified order value).
|
||||
*
|
||||
* <p><b>NOTE:</b> Annotation-based ordering is supported for specific kinds of
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* A description of a JavaBeans Property that allows us to avoid a dependency on
|
||||
* <code>java.beans.PropertyDescriptor</code>. The <code>java.beans</code> package
|
||||
* {@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
|
||||
* desirable for portability of Spring's core conversion facility.
|
||||
*
|
||||
@@ -90,21 +90,21 @@ public final class Property {
|
||||
}
|
||||
|
||||
/**
|
||||
* The property type: e.g. <code>java.lang.String</code>
|
||||
* The property type: e.g. {@code java.lang.String}
|
||||
*/
|
||||
public Class<?> getType() {
|
||||
return this.methodParameter.getParameterType();
|
||||
}
|
||||
|
||||
/**
|
||||
* The property getter method: e.g. <code>getFoo()</code>
|
||||
* The property getter method: e.g. {@code getFoo()}
|
||||
*/
|
||||
public Method getReadMethod() {
|
||||
return this.readMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* The property setter method: e.g. <code>setFoo(String)</code>
|
||||
* The property setter method: e.g. {@code setFoo(String)}
|
||||
*/
|
||||
public Method getWriteMethod() {
|
||||
return this.writeMethod;
|
||||
|
||||
@@ -169,12 +169,12 @@ public class TypeDescriptor {
|
||||
|
||||
/**
|
||||
* Creates a type descriptor for a nested type declared within the field.
|
||||
* <p>For example, if the field is a <code>List<String></code> and the nestingLevel is 1, the nested type descriptor will be <code>String.class</code>.
|
||||
* If the field is a <code>List<List<String>></code> and the nestingLevel is 2, the nested type descriptor will also be a <code>String.class</code>.
|
||||
* If the field is a <code>Map<Integer, String></code> and the nestingLevel is 1, the nested type descriptor will be String, derived from the map value.
|
||||
* If the field is a <code>List<Map<Integer, String>></code> and the nestingLevel is 2, the nested type descriptor will be String, derived from the map value.
|
||||
* Returns <code>null</code> if a nested type cannot be obtained because it was not declared.
|
||||
* For example, if the field is a <code>List<?></code>, the nested type descriptor returned will be <code>null</code>.
|
||||
* <p>For example, if the field is a {@code List<String>} and the nestingLevel is 1, the nested type descriptor will be {@code String.class}.
|
||||
* If the field is a {@code List<List<String>>} and the nestingLevel is 2, the nested type descriptor will also be a {@code String.class}.
|
||||
* If the field is a {@code Map<Integer, String>} and the nestingLevel is 1, the nested type descriptor will be String, derived from the map value.
|
||||
* If the field is a {@code List<Map<Integer, String>>} and the nestingLevel is 2, the nested type descriptor will be String, derived from the map value.
|
||||
* Returns {@code null} if a nested type cannot be obtained because it was not declared.
|
||||
* For example, if the field is a {@code List<?>}, the nested type descriptor returned will be {@code null}.
|
||||
* @param field the field
|
||||
* @param nestingLevel the nesting level of the collection/array element or map key/value declaration within the field
|
||||
* @return the nested type descriptor at the specified nestingLevel, or null if it could not be obtained
|
||||
@@ -186,15 +186,15 @@ public class TypeDescriptor {
|
||||
|
||||
/**
|
||||
* Creates a type descriptor for a nested type declared within the property.
|
||||
* <p>For example, if the property is a <code>List<String></code> and the nestingLevel is 1, the nested type descriptor will be <code>String.class</code>.
|
||||
* If the property is a <code>List<List<String>></code> and the nestingLevel is 2, the nested type descriptor will also be a <code>String.class</code>.
|
||||
* If the property is a <code>Map<Integer, String></code> and the nestingLevel is 1, the nested type descriptor will be String, derived from the map value.
|
||||
* If the property is a <code>List<Map<Integer, String>></code> and the nestingLevel is 2, the nested type descriptor will be String, derived from the map value.
|
||||
* Returns <code>null</code> if a nested type cannot be obtained because it was not declared.
|
||||
* For example, if the property is a <code>List<?></code>, the nested type descriptor returned will be <code>null</code>.
|
||||
* <p>For example, if the property is a {@code List<String>} and the nestingLevel is 1, the nested type descriptor will be {@code String.class}.
|
||||
* If the property is a {@code List<List<String>>} and the nestingLevel is 2, the nested type descriptor will also be a {@code String.class}.
|
||||
* If the property is a {@code Map<Integer, String>} and the nestingLevel is 1, the nested type descriptor will be String, derived from the map value.
|
||||
* If the property is a {@code List<Map<Integer, String>>} and the nestingLevel is 2, the nested type descriptor will be String, derived from the map value.
|
||||
* Returns {@code null} if a nested type cannot be obtained because it was not declared.
|
||||
* For example, if the property is a {@code List<?>}, the nested type descriptor returned will be {@code null}.
|
||||
* @param property the property
|
||||
* @param nestingLevel the nesting level of the collection/array element or map key/value declaration within the property
|
||||
* @return the nested type descriptor at the specified nestingLevel, or <code>null</code> if it could not be obtained
|
||||
* @return the nested type descriptor at the specified nestingLevel, or {@code null} if it could not be obtained
|
||||
* @throws IllegalArgumentException if the types up to the specified nesting level are not of collection, array, or map types
|
||||
*/
|
||||
public static TypeDescriptor nested(Property property, int nestingLevel) {
|
||||
@@ -217,7 +217,7 @@ public class TypeDescriptor {
|
||||
* Returns primitive types as-is.
|
||||
* <p>See {@link #getObjectType()} for a variation of this operation that resolves primitive types
|
||||
* to their corresponding Object types if necessary.
|
||||
* @return the type, or <code>null</code>
|
||||
* @return the type, or {@code null}
|
||||
* @see #getObjectType()
|
||||
*/
|
||||
public Class<?> getType() {
|
||||
@@ -235,11 +235,11 @@ public class TypeDescriptor {
|
||||
|
||||
/**
|
||||
* Narrows this {@link TypeDescriptor} by setting its type to the class of the provided value.
|
||||
* If the value is <code>null</code>, no narrowing is performed and this TypeDescriptor is returned unchanged.
|
||||
* If the value is {@code null}, no narrowing is performed and this TypeDescriptor is returned unchanged.
|
||||
* <p>Designed to be called by binding frameworks when they read property, field, or method return values.
|
||||
* Allows such frameworks to narrow a TypeDescriptor built from a declared property, field, or method return value type.
|
||||
* For example, a field declared as <code>java.lang.Object</code> would be narrowed to <code>java.util.HashMap</code>
|
||||
* if it was set to a <code>java.util.HashMap</code> value. The narrowed TypeDescriptor can then be used to convert
|
||||
* For example, a field declared as {@code java.lang.Object} would be narrowed to {@code java.util.HashMap}
|
||||
* if it was set to a {@code java.util.HashMap} value. The narrowed TypeDescriptor can then be used to convert
|
||||
* the HashMap to some other type. Annotation and nested type context is preserved by the narrowed copy.
|
||||
* @param value the value to use for narrowing this type descriptor
|
||||
* @return this TypeDescriptor narrowed (returns a copy with its type updated to the class of the provided value)
|
||||
@@ -304,7 +304,7 @@ public class TypeDescriptor {
|
||||
/**
|
||||
* Obtain the annotation associated with this type descriptor of the specified type.
|
||||
* @param annotationType the annotation type
|
||||
* @return the annotation, or <code>null</code> if no such annotation exists on this type descriptor
|
||||
* @return the annotation, or {@code null} if no such annotation exists on this type descriptor
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
|
||||
@@ -372,7 +372,7 @@ public class TypeDescriptor {
|
||||
* If this type is an array, returns the array's component type.
|
||||
* If this type is a {@link Collection} and it is parameterized, returns the Collection's element type.
|
||||
* If the Collection is not parameterized, returns null indicating the element type is not declared.
|
||||
* @return the array component type or Collection element type, or <code>null</code> if this type is a Collection but its element type is not parameterized
|
||||
* @return the array component type or Collection element type, or {@code null} if this type is a Collection but its element type is not parameterized
|
||||
* @throws IllegalStateException if this type is not a java.util.Collection or Array type
|
||||
*/
|
||||
public TypeDescriptor getElementTypeDescriptor() {
|
||||
@@ -407,7 +407,7 @@ public class TypeDescriptor {
|
||||
/**
|
||||
* If this type is a {@link Map} and its key type is parameterized, returns the map's key type.
|
||||
* If the Map's key type is not parameterized, returns null indicating the key type is not declared.
|
||||
* @return the Map key type, or <code>null</code> if this type is a Map but its key type is not parameterized
|
||||
* @return the Map key type, or {@code null} if this type is a Map but its key type is not parameterized
|
||||
* @throws IllegalStateException if this type is not a java.util.Map
|
||||
*/
|
||||
public TypeDescriptor getMapKeyTypeDescriptor() {
|
||||
@@ -433,7 +433,7 @@ public class TypeDescriptor {
|
||||
/**
|
||||
* If this type is a {@link Map} and its value type is parameterized, returns the map's value type.
|
||||
* If the Map's value type is not parameterized, returns null indicating the value type is not declared.
|
||||
* @return the Map value type, or <code>null</code> if this type is a Map but its value type is not parameterized
|
||||
* @return the Map value type, or {@code null} if this type is a Map but its value type is not parameterized
|
||||
* @throws IllegalStateException if this type is not a java.util.Map
|
||||
*/
|
||||
public TypeDescriptor getMapValueTypeDescriptor() {
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter;
|
||||
|
||||
/**
|
||||
* Simply calls {@link Object#toString()} to convert any supported Object to a String.
|
||||
* Supports CharSequence, StringWriter, and any class with a String constructor or <code>valueOf(String)</code> method.
|
||||
* Supports CharSequence, StringWriter, and any class with a String constructor or {@code valueOf(String)} method.
|
||||
*
|
||||
* <p>Used by the default ConversionService as a fallback if there are no other explicit
|
||||
* to-String converters registered.
|
||||
|
||||
@@ -198,7 +198,7 @@ public class GenericConversionService implements ConfigurableConversionService {
|
||||
|
||||
/**
|
||||
* Template method to convert a null source.
|
||||
* <p>Default implementation returns <code>null</code>.
|
||||
* <p>Default implementation returns {@code null}.
|
||||
* Subclasses may override to return custom null objects for specific target types.
|
||||
* @param sourceType the sourceType to convert from
|
||||
* @param targetType the targetType to convert to
|
||||
@@ -244,7 +244,7 @@ public class GenericConversionService implements ConfigurableConversionService {
|
||||
/**
|
||||
* Return the default converter if no converter is found for the given sourceType/targetType pair.
|
||||
* Returns a NO_OP Converter if the sourceType is assignable to the targetType.
|
||||
* Returns <code>null</code> otherwise, indicating no suitable converter could be found.
|
||||
* Returns {@code null} otherwise, indicating no suitable converter could be found.
|
||||
* Subclasses may override.
|
||||
* @param sourceType the source type to convert from
|
||||
* @param targetType the target type to convert to
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* on the target entity type.
|
||||
*
|
||||
* <p>For this converter to match, the finder method must be public, static, have the signature
|
||||
* <code>find[EntityName]([IdType])</code>, and return an instance of the desired entity type.
|
||||
* {@code find[EntityName]([IdType])}, and return an instance of the desired entity type.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @since 3.0
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* Generic Converter that attempts to convert a source Object to a target type
|
||||
* by delegating to methods on the target type.
|
||||
*
|
||||
* <p>Calls the static <code>valueOf(sourceType)</code> method on the target type
|
||||
* <p>Calls the static {@code valueOf(sourceType)} method on the target type
|
||||
* to perform the conversion, if such a method exists. Else calls the target type's
|
||||
* Constructor that accepts a single sourceType argument, if such a Constructor exists.
|
||||
* Else throws a ConversionFailedException.
|
||||
|
||||
@@ -33,7 +33,7 @@ public abstract class AbstractGenericLabeledEnum extends AbstractLabeledEnum {
|
||||
|
||||
/**
|
||||
* Create a new StaticLabeledEnum instance.
|
||||
* @param label the label; if <code>null</code>), the enum's code
|
||||
* @param label the label; if {@code null}), the enum's code
|
||||
* will be used as label
|
||||
*/
|
||||
protected AbstractGenericLabeledEnum(String label) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.comparator.NullSafeComparator;
|
||||
*
|
||||
* <ul>
|
||||
* <li>A type that identifies the enum's class.
|
||||
* For example: <code>com.mycompany.util.FileFormat</code>.</li>
|
||||
* For example: {@code com.mycompany.util.FileFormat}.</li>
|
||||
*
|
||||
* <li>A code that uniquely identifies the enum within the context of its type.
|
||||
* For example: "CSV". Different classes of codes are possible
|
||||
@@ -64,7 +64,7 @@ public interface LabeledEnum extends Comparable, Serializable {
|
||||
// Constants for standard enum ordering (Comparator implementations)
|
||||
|
||||
/**
|
||||
* Shared Comparator instance that sorts enumerations by <code>CODE_ORDER</code>.
|
||||
* Shared Comparator instance that sorts enumerations by {@code CODE_ORDER}.
|
||||
*/
|
||||
Comparator CODE_ORDER = new Comparator() {
|
||||
public int compare(Object o1, Object o2) {
|
||||
@@ -75,7 +75,7 @@ public interface LabeledEnum extends Comparable, Serializable {
|
||||
};
|
||||
|
||||
/**
|
||||
* Shared Comparator instance that sorts enumerations by <code>LABEL_ORDER</code>.
|
||||
* Shared Comparator instance that sorts enumerations by {@code LABEL_ORDER}.
|
||||
*/
|
||||
Comparator LABEL_ORDER = new Comparator() {
|
||||
public int compare(Object o1, Object o2) {
|
||||
@@ -87,8 +87,8 @@ public interface LabeledEnum extends Comparable, Serializable {
|
||||
};
|
||||
|
||||
/**
|
||||
* Shared Comparator instance that sorts enumerations by <code>LABEL_ORDER</code>,
|
||||
* then <code>CODE_ORDER</code>.
|
||||
* Shared Comparator instance that sorts enumerations by {@code LABEL_ORDER},
|
||||
* then {@code CODE_ORDER}.
|
||||
*/
|
||||
Comparator DEFAULT_ORDER =
|
||||
new CompoundComparator(new Comparator[] { LABEL_ORDER, CODE_ORDER });
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Interface for looking up <code>LabeledEnum</code> instances.
|
||||
* Interface for looking up {@code LabeledEnum} instances.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
@@ -42,16 +42,16 @@ public interface LabeledEnumResolver {
|
||||
/**
|
||||
* Return a map of enumerations of a particular type. Each element in the
|
||||
* map should be a key/value pair, where the key is the enum code, and the
|
||||
* value is the <code>LabeledEnum</code> instance.
|
||||
* value is the {@code LabeledEnum} instance.
|
||||
* @param type the enum type
|
||||
* @return a Map of localized enumeration instances,
|
||||
* with enum code as key and <code>LabeledEnum</code> instance as value
|
||||
* with enum code as key and {@code LabeledEnum} instance as value
|
||||
* @throws IllegalArgumentException if the type is not supported
|
||||
*/
|
||||
public Map getLabeledEnumMap(Class type) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Resolve a single <code>LabeledEnum</code> by its identifying code.
|
||||
* Resolve a single {@code LabeledEnum} by its identifying code.
|
||||
* @param type the enum type
|
||||
* @param code the enum code
|
||||
* @return the enum
|
||||
@@ -60,7 +60,7 @@ public interface LabeledEnumResolver {
|
||||
public LabeledEnum getLabeledEnumByCode(Class type, Comparable code) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Resolve a single <code>LabeledEnum</code> by its identifying code.
|
||||
* Resolve a single {@code LabeledEnum} by its identifying code.
|
||||
* @param type the enum type
|
||||
* @param label the enum label
|
||||
* @return the enum
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* <p>Should almost always be subclassed, but for some simple situations it may be
|
||||
* used directly. Note that you will not be able to use unique type-based functionality
|
||||
* like <code>LabeledEnumResolver.getLabeledEnumSet(type)</code> in this case.
|
||||
* like {@code LabeledEnumResolver.getLabeledEnumSet(type)} in this case.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @since 1.2.2
|
||||
@@ -41,7 +41,7 @@ public class LetterCodedLabeledEnum extends AbstractGenericLabeledEnum {
|
||||
/**
|
||||
* Create a new LetterCodedLabeledEnum instance.
|
||||
* @param code the letter code
|
||||
* @param label the label (can be <code>null</code>)
|
||||
* @param label the label (can be {@code null})
|
||||
*/
|
||||
public LetterCodedLabeledEnum(char code, String label) {
|
||||
super(label);
|
||||
|
||||
@@ -21,7 +21,7 @@ package org.springframework.core.enums;
|
||||
*
|
||||
* <p>Should almost always be subclassed, but for some simple situations it may be
|
||||
* used directly. Note that you will not be able to use unique type-based functionality
|
||||
* like <code>LabeledEnumResolver.getLabeledEnumSet(type)</code> in this case.
|
||||
* like {@code LabeledEnumResolver.getLabeledEnumSet(type)} in this case.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @since 1.2.2
|
||||
@@ -39,7 +39,7 @@ public class ShortCodedLabeledEnum extends AbstractGenericLabeledEnum {
|
||||
/**
|
||||
* Create a new ShortCodedLabeledEnum instance.
|
||||
* @param code the short code
|
||||
* @param label the label (can be <code>null</code>)
|
||||
* @param label the label (can be {@code null})
|
||||
*/
|
||||
public ShortCodedLabeledEnum(int code, String label) {
|
||||
super(label);
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class StaticLabeledEnum extends AbstractLabeledEnum {
|
||||
/**
|
||||
* Create a new StaticLabeledEnum instance.
|
||||
* @param code the short code
|
||||
* @param label the label (can be <code>null</code>)
|
||||
* @param label the label (can be {@code null})
|
||||
*/
|
||||
protected StaticLabeledEnum(int code, String label) {
|
||||
this.code = new Short((short) code);
|
||||
|
||||
@@ -37,13 +37,13 @@ import org.springframework.util.Assert;
|
||||
public class StaticLabeledEnumResolver extends AbstractCachingLabeledEnumResolver {
|
||||
|
||||
/**
|
||||
* Shared <code>StaticLabeledEnumResolver</code> singleton instance.
|
||||
* Shared {@code StaticLabeledEnumResolver} singleton instance.
|
||||
*/
|
||||
private static final StaticLabeledEnumResolver INSTANCE = new StaticLabeledEnumResolver();
|
||||
|
||||
|
||||
/**
|
||||
* Return the shared <code>StaticLabeledEnumResolver</code> singleton instance.
|
||||
* Return the shared {@code StaticLabeledEnumResolver} singleton instance.
|
||||
* Mainly for resolving unique StaticLabeledEnum references on deserialization.
|
||||
* @see StaticLabeledEnum
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* <p>Should almost always be subclassed, but for some simple situations it may be
|
||||
* used directly. Note that you will not be able to use unique type-based
|
||||
* functionality like <code>LabeledEnumResolver.getLabeledEnumSet(type) in this case.
|
||||
* functionality like {@code LabeledEnumResolver.getLabeledEnumSet(type)} in this case.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
@@ -43,7 +43,7 @@ public class StringCodedLabeledEnum extends AbstractGenericLabeledEnum {
|
||||
/**
|
||||
* Create a new StringCodedLabeledEnum instance.
|
||||
* @param code the String code
|
||||
* @param label the label (can be <code>null</code>)
|
||||
* @param label the label (can be {@code null})
|
||||
*/
|
||||
public StringCodedLabeledEnum(String code, String label) {
|
||||
super(label);
|
||||
|
||||
@@ -164,7 +164,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
* </pre>
|
||||
* The search order is now C, D, A, B as desired.
|
||||
*
|
||||
* <p>Beyond these recommendations, subclasses may use any of the <code>add*</code>,
|
||||
* <p>Beyond these recommendations, subclasses may use any of the {@code add*},
|
||||
* {@code remove}, or {@code replace} methods exposed by {@link MutablePropertySources}
|
||||
* in order to create the exact arrangement of property sources desired.
|
||||
*
|
||||
|
||||
@@ -43,7 +43,7 @@ package org.springframework.core.env;
|
||||
* {@code Environment} in order to query profile state or resolve properties directly.
|
||||
*
|
||||
* <p>In most cases, however, application-level beans should not need to interact with the
|
||||
* {@code Environment} directly but instead may have to have <code>${...}</code> property
|
||||
* {@code Environment} directly but instead may have to have {@code ${...}} property
|
||||
* values replaced by a property placeholder configurer such as
|
||||
* {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer
|
||||
* PropertySourcesPlaceholderConfigurer}, which itself is {@code EnvironmentAware} and
|
||||
|
||||
@@ -65,14 +65,14 @@ public abstract class AbstractResource implements Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation always returns <code>true</code>.
|
||||
* This implementation always returns {@code true}.
|
||||
*/
|
||||
public boolean isReadable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation always returns <code>false</code>.
|
||||
* This implementation always returns {@code false}.
|
||||
*/
|
||||
public boolean isOpen() {
|
||||
return false;
|
||||
@@ -153,7 +153,7 @@ public abstract class AbstractResource implements Resource {
|
||||
/**
|
||||
* Determine the File to use for timestamp checking.
|
||||
* <p>The default implementation delegates to {@link #getFile()}.
|
||||
* @return the File to use for timestamp checking (never <code>null</code>)
|
||||
* @return the File to use for timestamp checking (never {@code null})
|
||||
* @throws IOException if the resource cannot be resolved as absolute
|
||||
* file path, i.e. if the resource is not available in a file system
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ public abstract class AbstractResource implements Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation always returns <code>null</code>,
|
||||
* This implementation always returns {@code null},
|
||||
* assuming that this resource type does not have a filename.
|
||||
*/
|
||||
public String getFilename() {
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ByteArrayResource extends AbstractResource {
|
||||
|
||||
|
||||
/**
|
||||
* This implementation always returns <code>true</code>.
|
||||
* This implementation always returns {@code true}.
|
||||
*/
|
||||
@Override
|
||||
public boolean exists() {
|
||||
|
||||
@@ -30,15 +30,15 @@ import org.springframework.util.StringUtils;
|
||||
* {@link Resource} implementation for class path resources.
|
||||
* Uses either a given ClassLoader or a given Class for loading resources.
|
||||
*
|
||||
* <p>Supports resolution as <code>java.io.File</code> if the class path
|
||||
* <p>Supports resolution as {@code java.io.File} if the class path
|
||||
* resource resides in the file system, but not for resources in a JAR.
|
||||
* Always supports resolution as URL.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Sam Brannen
|
||||
* @since 28.12.2003
|
||||
* @see java.lang.ClassLoader#getResourceAsStream(String)
|
||||
* @see java.lang.Class#getResourceAsStream(String)
|
||||
* @see ClassLoader#getResourceAsStream(String)
|
||||
* @see Class#getResourceAsStream(String)
|
||||
*/
|
||||
public class ClassPathResource extends AbstractFileResolvingResource {
|
||||
|
||||
@@ -69,8 +69,8 @@ public class ClassPathResource extends AbstractFileResolvingResource {
|
||||
* resource access methods will not accept it.
|
||||
* @param path the absolute path within the classpath
|
||||
* @param classLoader the class loader to load the resource with,
|
||||
* or <code>null</code> for the thread context class loader
|
||||
* @see java.lang.ClassLoader#getResourceAsStream(String)
|
||||
* or {@code null} for the thread context class loader
|
||||
* @see ClassLoader#getResourceAsStream(String)
|
||||
*/
|
||||
public ClassPathResource(String path, ClassLoader classLoader) {
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
|
||||
@@ -21,11 +21,11 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* {@link ResourceLoader} implementation that interprets plain resource paths
|
||||
* as relative to a given <code>java.lang.Class</code>.
|
||||
* as relative to a given {@code java.lang.Class}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see java.lang.Class#getResource(String)
|
||||
* @see Class#getResource(String)
|
||||
* @see ClassPathResource#ClassPathResource(String, Class)
|
||||
*/
|
||||
public class ClassRelativeResourceLoader extends DefaultResourceLoader {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class DefaultResourceLoader implements ResourceLoader {
|
||||
|
||||
/**
|
||||
* Create a new DefaultResourceLoader.
|
||||
* @param classLoader the ClassLoader to load class path resources with, or <code>null</code>
|
||||
* @param classLoader the ClassLoader to load class path resources with, or {@code null}
|
||||
* for using the thread context class loader at the time of actual resource access
|
||||
*/
|
||||
public DefaultResourceLoader(ClassLoader classLoader) {
|
||||
@@ -64,7 +64,7 @@ public class DefaultResourceLoader implements ResourceLoader {
|
||||
|
||||
|
||||
/**
|
||||
* Specify the ClassLoader to load class path resources with, or <code>null</code>
|
||||
* Specify the ClassLoader to load class path resources with, or {@code null}
|
||||
* for using the thread context class loader at the time of actual resource access.
|
||||
* <p>The default is that ClassLoader access will happen using the thread context
|
||||
* class loader at the time of this ResourceLoader's initialization.
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.io.InputStream;
|
||||
* Simple {@link Resource} implementation that holds a resource description
|
||||
* but does not point to an actually readable resource.
|
||||
*
|
||||
* <p>To be used as placeholder if a <code>Resource</code> argument is
|
||||
* <p>To be used as placeholder if a {@code Resource} argument is
|
||||
* expected by an API but not necessarily used for actual reading.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* {@link Resource} implementation for <code>java.io.File</code> handles.
|
||||
* {@link Resource} implementation for {@code java.io.File} handles.
|
||||
* Obviously supports resolution as File, and also as URL.
|
||||
* Implements the extended {@link WritableResource} interface.
|
||||
*
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.io.InputStream;
|
||||
*
|
||||
* <p>In contrast to other Resource implementations, this is a descriptor
|
||||
* for an <i>already opened</i> resource - therefore returning "true" from
|
||||
* <code>isOpen()</code>. Do not use it if you need to keep the resource
|
||||
* {@code isOpen()}. Do not use it if you need to keep the resource
|
||||
* descriptor somewhere, or if you need to read a stream multiple times.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
@@ -69,7 +69,7 @@ public class InputStreamResource extends AbstractResource {
|
||||
|
||||
|
||||
/**
|
||||
* This implementation always returns <code>true</code>.
|
||||
* This implementation always returns {@code true}.
|
||||
*/
|
||||
@Override
|
||||
public boolean exists() {
|
||||
@@ -77,7 +77,7 @@ public class InputStreamResource extends AbstractResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation always returns <code>true</code>.
|
||||
* This implementation always returns {@code true}.
|
||||
*/
|
||||
@Override
|
||||
public boolean isOpen() {
|
||||
|
||||
@@ -25,8 +25,8 @@ import java.io.InputStream;
|
||||
* <p>This is the base interface for Spring's more extensive {@link Resource} interface.
|
||||
*
|
||||
* <p>For single-use streams, {@link InputStreamResource} can be used for any
|
||||
* given <code>InputStream</code>. Spring's {@link ByteArrayResource} or any
|
||||
* file-based <code>Resource</code> implementation can be used as a concrete
|
||||
* given {@code InputStream}. Spring's {@link ByteArrayResource} or any
|
||||
* file-based {@code Resource} implementation can be used as a concrete
|
||||
* instance, allowing one to read the underlying content stream multiple times.
|
||||
* This makes this interface useful as an abstract content source for mail
|
||||
* attachments, for example.
|
||||
@@ -46,7 +46,7 @@ public interface InputStreamSource {
|
||||
* <p>This requirement is particularly important when you consider an API such
|
||||
* as JavaMail, which needs to be able to read the stream multiple times when
|
||||
* creating mail attachments. For such a use case, it is <i>required</i>
|
||||
* that each <code>getInputStream()</code> call returns a fresh stream.
|
||||
* that each {@code getInputStream()} call returns a fresh stream.
|
||||
* @return the input stream for the underlying resource (must not be {@code null})
|
||||
* @throws IOException if the stream could not be opened
|
||||
* @see org.springframework.mail.javamail.MimeMessageHelper#addAttachment(String, InputStreamSource)
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface Resource extends InputStreamSource {
|
||||
/**
|
||||
* Return whether this resource actually exists in physical form.
|
||||
* <p>This method performs a definitive existence check, whereas the
|
||||
* existence of a <code>Resource</code> handle only guarantees a
|
||||
* existence of a {@code Resource} handle only guarantees a
|
||||
* valid descriptor handle.
|
||||
*/
|
||||
boolean exists();
|
||||
@@ -57,9 +57,9 @@ public interface Resource extends InputStreamSource {
|
||||
/**
|
||||
* Return whether the contents of this resource can be read,
|
||||
* e.g. via {@link #getInputStream()} or {@link #getFile()}.
|
||||
* <p>Will be <code>true</code> for typical resource descriptors;
|
||||
* <p>Will be {@code true} for typical resource descriptors;
|
||||
* note that actual content reading may still fail when attempted.
|
||||
* However, a value of <code>false</code> is a definitive indication
|
||||
* However, a value of {@code false} is a definitive indication
|
||||
* that the resource content cannot be read.
|
||||
* @see #getInputStream()
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ public interface Resource extends InputStreamSource {
|
||||
* Return whether this resource represents a handle with an open
|
||||
* stream. If true, the InputStream cannot be read multiple times,
|
||||
* and must be read and closed to avoid resource leaks.
|
||||
* <p>Will be <code>false</code> for typical resource descriptors.
|
||||
* <p>Will be {@code false} for typical resource descriptors.
|
||||
*/
|
||||
boolean isOpen();
|
||||
|
||||
@@ -119,7 +119,7 @@ public interface Resource extends InputStreamSource {
|
||||
/**
|
||||
* Determine a filename for this resource, i.e. typically the last
|
||||
* part of the path: for example, "myfile.txt".
|
||||
* <p>Returns <code>null</code> if this type of resource does not
|
||||
* <p>Returns {@code null} if this type of resource does not
|
||||
* have a filename.
|
||||
*/
|
||||
String getFilename();
|
||||
@@ -128,8 +128,8 @@ public interface Resource extends InputStreamSource {
|
||||
* Return a description for this resource,
|
||||
* to be used for error output when working with the resource.
|
||||
* <p>Implementations are also encouraged to return this value
|
||||
* from their <code>toString</code> method.
|
||||
* @see java.lang.Object#toString()
|
||||
* from their {@code toString} method.
|
||||
* @see Object#toString()
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ import org.springframework.util.StringUtils;
|
||||
* e.g. {@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>${...}</code> placeholders, to be
|
||||
* <p>The path may contain {@code ${...}} placeholders, to be
|
||||
* resolved as {@link org.springframework.core.env.Environment} properties:
|
||||
* e.g. <code>${user.dir}</code>. Unresolvable placeholders are ignored by default.
|
||||
* e.g. {@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}.
|
||||
@@ -67,7 +67,7 @@ public class ResourceEditor extends PropertyEditorSupport {
|
||||
/**
|
||||
* Create a new instance of the {@link ResourceEditor} class
|
||||
* using the given {@link ResourceLoader} and a {@link StandardEnvironment}.
|
||||
* @param resourceLoader the <code>ResourceLoader</code> to use
|
||||
* @param resourceLoader the {@code ResourceLoader} to use
|
||||
* @deprecated as of Spring 3.1 in favor of
|
||||
* {@link #ResourceEditor(ResourceLoader, PropertyResolver)}
|
||||
*/
|
||||
@@ -79,8 +79,8 @@ public class ResourceEditor extends PropertyEditorSupport {
|
||||
/**
|
||||
* Create a new instance of the {@link ResourceEditor} class
|
||||
* using the given {@link ResourceLoader} and {@link PropertyResolver}.
|
||||
* @param resourceLoader the <code>ResourceLoader</code> to use
|
||||
* @param propertyResolver the <code>PropertyResolver</code> to use
|
||||
* @param resourceLoader the {@code ResourceLoader} to use
|
||||
* @param propertyResolver the {@code PropertyResolver} to use
|
||||
*/
|
||||
public ResourceEditor(ResourceLoader resourceLoader, PropertyResolver propertyResolver) {
|
||||
this(resourceLoader, propertyResolver, true);
|
||||
@@ -89,7 +89,7 @@ public class ResourceEditor extends PropertyEditorSupport {
|
||||
/**
|
||||
* Create a new instance of the {@link ResourceEditor} class
|
||||
* using the given {@link ResourceLoader}.
|
||||
* @param resourceLoader the <code>ResourceLoader</code> to use
|
||||
* @param resourceLoader the {@code ResourceLoader} to use
|
||||
* @param ignoreUnresolvablePlaceholders whether to ignore unresolvable placeholders
|
||||
* if no corresponding property could be found
|
||||
* @deprecated as of Spring 3.1 in favor of
|
||||
@@ -103,10 +103,10 @@ public class ResourceEditor extends PropertyEditorSupport {
|
||||
/**
|
||||
* Create a new instance of the {@link ResourceEditor} class
|
||||
* using the given {@link ResourceLoader}.
|
||||
* @param resourceLoader the <code>ResourceLoader</code> to use
|
||||
* @param propertyResolver the <code>PropertyResolver</code> to use
|
||||
* @param resourceLoader the {@code ResourceLoader} to use
|
||||
* @param propertyResolver the {@code PropertyResolver} to use
|
||||
* @param ignoreUnresolvablePlaceholders whether to ignore unresolvable placeholders
|
||||
* if no corresponding property could be found in the given <code>propertyResolver</code>
|
||||
* if no corresponding property could be found in the given {@code propertyResolver}
|
||||
*/
|
||||
public ResourceEditor(ResourceLoader resourceLoader, PropertyResolver propertyResolver, boolean ignoreUnresolvablePlaceholders) {
|
||||
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
|
||||
@@ -130,7 +130,7 @@ public class ResourceEditor extends PropertyEditorSupport {
|
||||
|
||||
/**
|
||||
* Resolve the given path, replacing placeholders with corresponding
|
||||
* property values from the <code>environment</code> if necessary.
|
||||
* property values from the {@code environment} if necessary.
|
||||
* @param path the original file path
|
||||
* @return the resolved file path
|
||||
* @see PropertyResolver#resolvePlaceholders
|
||||
|
||||
@@ -70,7 +70,7 @@ public interface ResourceLoader {
|
||||
* <p>Clients which need to access the ClassLoader directly can do so
|
||||
* in a uniform manner with the ResourceLoader, rather than relying
|
||||
* on the thread context ClassLoader.
|
||||
* @return the ClassLoader (never <code>null</code>)
|
||||
* @return the ClassLoader (never {@code null})
|
||||
*/
|
||||
ClassLoader getClassLoader();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* {@link Resource} implementation for <code>java.net.URL</code> locators.
|
||||
* {@link Resource} implementation for {@code java.net.URL} locators.
|
||||
* Obviously supports resolution as URL, and also as File in case of
|
||||
* the "file:" protocol.
|
||||
*
|
||||
@@ -112,7 +112,7 @@ public class UrlResource extends AbstractFileResolvingResource {
|
||||
|
||||
/**
|
||||
* This implementation opens an InputStream for the given URL.
|
||||
* It sets the "UseCaches" flag to <code>false</code>,
|
||||
* It sets the "UseCaches" flag to {@code false},
|
||||
* mainly to avoid jar file locking on Windows.
|
||||
* @see java.net.URL#openConnection()
|
||||
* @see java.net.URLConnection#setUseCaches(boolean)
|
||||
|
||||
@@ -33,8 +33,8 @@ import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* Utility for detecting the JBoss VFS version available in the classpath.
|
||||
* JBoss AS 5+ uses VFS 2.x (package <code>org.jboss.virtual</code>) while
|
||||
* JBoss AS 6+ uses VFS 3.x (package <code>org.jboss.vfs</code>).
|
||||
* JBoss AS 5+ uses VFS 2.x (package {@code org.jboss.virtual}) while
|
||||
* JBoss AS 6+ uses VFS 3.x (package {@code org.jboss.vfs}).
|
||||
*
|
||||
* <p>Thanks go to Marius Bogoevici for the initial patch.
|
||||
*
|
||||
|
||||
@@ -32,9 +32,9 @@ public interface WritableResource extends Resource {
|
||||
/**
|
||||
* Return whether the contents of this resource can be modified,
|
||||
* e.g. via {@link #getOutputStream()} or {@link #getFile()}.
|
||||
* <p>Will be <code>true</code> for typical resource descriptors;
|
||||
* <p>Will be {@code true} for typical resource descriptors;
|
||||
* note that actual content writing may still fail when attempted.
|
||||
* However, a value of <code>false</code> is a definitive indication
|
||||
* However, a value of {@code false} is a definitive indication
|
||||
* that the resource content cannot be modified.
|
||||
* @see #getOutputStream()
|
||||
* @see #isReadable()
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.util.ObjectUtils;
|
||||
* with a specific encoding to be used for reading from the resource.
|
||||
*
|
||||
* <p>Used as argument for operations that support to read content with
|
||||
* a specific encoding (usually through a <code>java.io.Reader</code>.
|
||||
* a specific encoding (usually through a {@code java.io.Reader}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2.6
|
||||
@@ -73,14 +73,14 @@ public class EncodedResource {
|
||||
|
||||
/**
|
||||
* Return the encoding to use for reading from the resource,
|
||||
* or <code>null</code> if none specified.
|
||||
* or {@code null} if none specified.
|
||||
*/
|
||||
public final String getEncoding() {
|
||||
return this.encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a <code>java.io.Reader</code> for the specified resource,
|
||||
* Open a {@code java.io.Reader} for the specified resource,
|
||||
* using the specified encoding (if any).
|
||||
* @throws IOException if opening the Reader failed
|
||||
*/
|
||||
|
||||
@@ -71,7 +71,7 @@ public class LocalizedResourceHelper {
|
||||
* Find the most specific localized resource for the given name,
|
||||
* extension and locale:
|
||||
* <p>The file will be searched with locations in the following order,
|
||||
* similar to <code>java.util.ResourceBundle</code>'s search order:
|
||||
* similar to {@code java.util.ResourceBundle}'s search order:
|
||||
* <ul>
|
||||
* <li>[name]_[language]_[country]_[variant][extension]
|
||||
* <li>[name]_[language]_[country][extension]
|
||||
@@ -82,7 +82,7 @@ public class LocalizedResourceHelper {
|
||||
* 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 locale the current locale (may be <code>null</code>)
|
||||
* @param locale the current locale (may be {@code null})
|
||||
* @return the most specific localized resource found
|
||||
* @see java.util.ResourceBundle
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.springframework.util.StringUtils;
|
||||
* specified resource location path into one or more matching Resources.
|
||||
* The source path may be a simple path which has a one-to-one mapping to a
|
||||
* target {@link org.springframework.core.io.Resource}, or alternatively
|
||||
* may contain the special "<code>classpath*:</code>" prefix and/or
|
||||
* may contain the special "{@code classpath*:}" prefix and/or
|
||||
* internal Ant-style regular expressions (matched using Spring's
|
||||
* {@link org.springframework.util.AntPathMatcher} utility).
|
||||
* Both of the latter are effectively wildcards.
|
||||
@@ -60,14 +60,14 @@ import org.springframework.util.StringUtils;
|
||||
* <p><b>No Wildcards:</b>
|
||||
*
|
||||
* <p>In the simple case, if the specified location path does not start with the
|
||||
* <code>"classpath*:</code>" prefix, and does not contain a PathMatcher pattern,
|
||||
* {@code "classpath*:}" prefix, and does not contain a PathMatcher pattern,
|
||||
* this resolver will simply return a single resource via a
|
||||
* <code>getResource()</code> call on the underlying <code>ResourceLoader</code>.
|
||||
* Examples are real URLs such as "<code>file:C:/context.xml</code>", pseudo-URLs
|
||||
* such as "<code>classpath:/context.xml</code>", and simple unprefixed paths
|
||||
* such as "<code>/WEB-INF/context.xml</code>". The latter will resolve in a
|
||||
* fashion specific to the underlying <code>ResourceLoader</code> (e.g.
|
||||
* <code>ServletContextResource</code> for a <code>WebApplicationContext</code>).
|
||||
* {@code getResource()} call on the underlying {@code ResourceLoader}.
|
||||
* 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.
|
||||
* {@code ServletContextResource} for a {@code WebApplicationContext}).
|
||||
*
|
||||
* <p><b>Ant-style Patterns:</b>
|
||||
*
|
||||
@@ -78,67 +78,67 @@ import org.springframework.util.StringUtils;
|
||||
* file:C:/some/path/*-context.xml
|
||||
* classpath:com/mycompany/**/applicationContext.xml</pre>
|
||||
* the resolver follows a more complex but defined procedure to try to resolve
|
||||
* the wildcard. It produces a <code>Resource</code> for the path up to the last
|
||||
* non-wildcard segment and obtains a <code>URL</code> from it. If this URL is
|
||||
* not a "<code>jar:</code>" URL or container-specific variant (e.g.
|
||||
* "<code>zip:</code>" in WebLogic, "<code>wsjar</code>" in WebSphere", etc.),
|
||||
* then a <code>java.io.File</code> is obtained from it, and used to resolve the
|
||||
* 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 wsjar}" in WebSphere", etc.),
|
||||
* then a {@code java.io.File} is obtained from it, and used to resolve the
|
||||
* wildcard by walking the filesystem. In the case of a jar URL, the resolver
|
||||
* either gets a <code>java.net.JarURLConnection</code> from it, or manually parses
|
||||
* either gets a {@code java.net.JarURLConnection} from it, or manually parses
|
||||
* the jar URL, and then traverses the contents of the jar file, to resolve the
|
||||
* wildcards.
|
||||
*
|
||||
* <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</code> 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()</code> call. Since this is just 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
|
||||
* this case. In practice, it is usually a <code>java.io.File</code> representing
|
||||
* 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
|
||||
* to a jar location. Still, there is a portability concern on this operation.
|
||||
*
|
||||
* <p>If a jar URL is obtained for the last non-wildcard segment, the resolver
|
||||
* must be able to get a <code>java.net.JarURLConnection</code> from it, or
|
||||
* must be able to get a {@code java.net.JarURLConnection} from it, or
|
||||
* manually parse the jar URL, to be able to walk the contents of the jar,
|
||||
* and resolve the wildcard. This will work in most environments, but will
|
||||
* fail in others, and it is strongly recommended that the wildcard
|
||||
* resolution of resources coming from jars be thoroughly tested in your
|
||||
* specific environment before you rely on it.
|
||||
*
|
||||
* <p><b><code>classpath*:</code> Prefix:</b>
|
||||
* <p><b>{@code classpath*:} Prefix:</b>
|
||||
*
|
||||
* <p>There is special support for retrieving multiple class path resources with
|
||||
* the same name, via the "<code>classpath*:</code>" prefix. For example,
|
||||
* "<code>classpath*:META-INF/beans.xml</code>" will find all "beans.xml"
|
||||
* the same name, via the "{@code classpath*:}" prefix. For example,
|
||||
* "{@code classpath*:META-INF/beans.xml}" will find all "beans.xml"
|
||||
* files in the class path, be it in "classes" directories or in JAR files.
|
||||
* This is particularly useful for autodetecting config files of the same name
|
||||
* at the same location within each jar file. Internally, this happens via a
|
||||
* <code>ClassLoader.getResources()</code> call, and is completely portable.
|
||||
* {@code ClassLoader.getResources()} call, and is completely portable.
|
||||
*
|
||||
* <p>The "classpath*:" prefix can also be combined with a PathMatcher pattern in
|
||||
* the rest of the location path, for example "classpath*:META-INF/*-beans.xml".
|
||||
* In this case, the resolution strategy is fairly simple: a
|
||||
* <code>ClassLoader.getResources()</code> call is used on the last non-wildcard
|
||||
* {@code ClassLoader.getResources()} call is used on the last non-wildcard
|
||||
* path segment to get all the matching resources in the class loader hierarchy,
|
||||
* and then off each resource the same PathMatcher resolution strategy described
|
||||
* above is used for the wildcard subpath.
|
||||
*
|
||||
* <p><b>Other notes:</b>
|
||||
*
|
||||
* <p><b>WARNING:</b> Note that "<code>classpath*:</code>" when combined with
|
||||
* <p><b>WARNING:</b> Note that "{@code classpath*:}" when combined with
|
||||
* Ant-style patterns will only work reliably with at least one root directory
|
||||
* before the pattern starts, unless the actual target files reside in the file
|
||||
* system. This means that a pattern like "<code>classpath*:*.xml</code>" will
|
||||
* system. This means that a pattern like "{@code classpath*:*.xml}" will
|
||||
* <i>not</i> retrieve files from the root of jar files but rather only from the
|
||||
* root of expanded directories. This originates from a limitation in the JDK's
|
||||
* <code>ClassLoader.getResources()</code> method which only returns file system
|
||||
* {@code ClassLoader.getResources()} method which only returns file system
|
||||
* locations for a passed-in empty String (indicating potential roots to search).
|
||||
*
|
||||
* <p><b>WARNING:</b> Ant-style patterns with "classpath:" resources are not
|
||||
@@ -148,9 +148,9 @@ import org.springframework.util.StringUtils;
|
||||
* </pre>may be in only one location, but when a path such as<pre>
|
||||
* classpath:com/mycompany/**/service-context.xml
|
||||
* </pre>is used to try to resolve it, the resolver will work off the (first) URL
|
||||
* returned by <code>getResource("com/mycompany");</code>. If this base package
|
||||
* returned by {@code getResource("com/mycompany");}. If this base package
|
||||
* node exists in multiple classloader locations, the actual end resource may
|
||||
* not be underneath. Therefore, preferably, use "<code>classpath*:<code>" with the same
|
||||
* not be underneath. Therefore, preferably, use "{@code classpath*:}" with the same
|
||||
* Ant-style pattern in such a case, which will search <i>all</i> class path
|
||||
* locations that contain the root package.
|
||||
*
|
||||
@@ -162,7 +162,7 @@ import org.springframework.util.StringUtils;
|
||||
* @see #CLASSPATH_ALL_URL_PREFIX
|
||||
* @see org.springframework.util.AntPathMatcher
|
||||
* @see org.springframework.core.io.ResourceLoader#getResource(String)
|
||||
* @see java.lang.ClassLoader#getResources(String)
|
||||
* @see ClassLoader#getResources(String)
|
||||
*/
|
||||
public class PathMatchingResourcePatternResolver implements ResourcePatternResolver {
|
||||
|
||||
@@ -201,7 +201,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
/**
|
||||
* Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.
|
||||
* @param classLoader the ClassLoader to load classpath resources with,
|
||||
* or <code>null</code> for using the thread context class loader
|
||||
* or {@code null} for using the thread context class loader
|
||||
* at the time of actual resource access
|
||||
* @see org.springframework.core.io.DefaultResourceLoader
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
|
||||
/**
|
||||
* Return the ClassLoader that this pattern resolver works with
|
||||
* (never <code>null</code>).
|
||||
* (never {@code null}).
|
||||
*/
|
||||
public ClassLoader getClassLoader() {
|
||||
return getResourceLoader().getClassLoader();
|
||||
@@ -356,8 +356,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
/**
|
||||
* Determine the root directory for the given location.
|
||||
* <p>Used for determining the starting point for file matching,
|
||||
* resolving the root directory location to a <code>java.io.File</code>
|
||||
* and passing it into <code>retrieveMatchingFiles</code>, with the
|
||||
* resolving the root directory location to a {@code java.io.File}
|
||||
* and passing it into {@code retrieveMatchingFiles}, with the
|
||||
* remainder of the location as pattern.
|
||||
* <p>Will return "/WEB-INF/" for the pattern "/WEB-INF/*.xml",
|
||||
* for example.
|
||||
@@ -398,7 +398,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||
|
||||
/**
|
||||
* Return whether the given resource handle indicates a jar resource
|
||||
* that the <code>doFindPathMatchingJarResources</code> method can handle.
|
||||
* that the {@code doFindPathMatchingJarResources} method can handle.
|
||||
* <p>The default implementation checks against the URL protocols
|
||||
* "jar", "zip" and "wsjar" (the latter are used by BEA WebLogic Server
|
||||
* and IBM WebSphere, respectively, but can be treated like jar files).
|
||||
|
||||
@@ -118,7 +118,7 @@ public abstract class PropertiesLoaderSupport {
|
||||
|
||||
/**
|
||||
* Set the encoding to use for parsing properties files.
|
||||
* <p>Default is none, using the <code>java.util.Properties</code>
|
||||
* <p>Default is none, using the {@code java.util.Properties}
|
||||
* default encoding.
|
||||
* <p>Only applies to classic properties files, not to XML files.
|
||||
* @see org.springframework.util.PropertiesPersister#load
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
|
||||
/**
|
||||
* Convenient utility methods for loading of <code>java.util.Properties</code>,
|
||||
* Convenient utility methods for loading of {@code java.util.Properties},
|
||||
* performing standard handling of input streams.
|
||||
*
|
||||
* <p>For more configurable properties loading, including the option of a
|
||||
@@ -90,7 +90,7 @@ public abstract class PropertiesLoaderUtils {
|
||||
* found in the class path.
|
||||
* @param resourceName the name of the class path resource
|
||||
* @param classLoader the ClassLoader to use for loading
|
||||
* (or <code>null</code> to use the default class loader)
|
||||
* (or {@code null} to use the default class loader)
|
||||
* @return the populated Properties instance
|
||||
* @throws IOException if loading failed
|
||||
*/
|
||||
|
||||
@@ -32,14 +32,14 @@ import org.springframework.core.io.Resource;
|
||||
|
||||
/**
|
||||
* Editor for {@link org.springframework.core.io.Resource} arrays, to
|
||||
* automatically convert <code>String</code> location patterns
|
||||
* (e.g. <code>"file:C:/my*.txt"</code> or <code>"classpath*:myfile.txt"</code>)
|
||||
* to <code>Resource</code> array properties. Can also translate a collection
|
||||
* automatically convert {@code String} location patterns
|
||||
* (e.g. {@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>${...}</code> placeholders, to be
|
||||
* <p>A path may contain {@code ${...}} placeholders, to be
|
||||
* resolved as {@link org.springframework.core.env.Environment} properties:
|
||||
* e.g. <code>${user.dir}</code>. Unresolvable placeholders are ignored by default.
|
||||
* e.g. {@code ${user.dir}}. Unresolvable placeholders are ignored by default.
|
||||
*
|
||||
* <p>Delegates to a {@link ResourcePatternResolver},
|
||||
* by default using a {@link PathMatchingResourcePatternResolver}.
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.util.ResourceUtils;
|
||||
* location that can be loaded via a ResourcePatternResolver.
|
||||
*
|
||||
* <p>Callers will usually assume that a location is a relative path
|
||||
* if the {@link #isUrl(String)} method returns <code>false</code>.
|
||||
* if the {@link #isUrl(String)} method returns {@code false}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2.3
|
||||
@@ -54,7 +54,7 @@ public abstract class ResourcePatternUtils {
|
||||
* ResourcePatternResolver extension, or a PathMatchingResourcePatternResolver
|
||||
* built on the given ResourceLoader.
|
||||
* @param resourceLoader the ResourceLoader to build a pattern resolver for
|
||||
* (may be <code>null</code> to indicate a default ResourceLoader)
|
||||
* (may be {@code null} to indicate a default ResourceLoader)
|
||||
* @return the ResourcePatternResolver
|
||||
* @see PathMatchingResourcePatternResolver
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.springframework.core.NestedRuntimeException;
|
||||
public class SerializationFailedException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
* Construct a <code>SerializationException</code> with the specified detail message.
|
||||
* Construct a {@code SerializationException} with the specified detail message.
|
||||
* @param message the detail message
|
||||
*/
|
||||
public SerializationFailedException(String message) {
|
||||
@@ -39,7 +39,7 @@ public class SerializationFailedException extends NestedRuntimeException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a <code>SerializationException</code> with the specified detail message
|
||||
* Construct a {@code SerializationException} with the specified detail message
|
||||
* and nested exception.
|
||||
* @param message the detail message
|
||||
* @param cause the nested exception
|
||||
|
||||
@@ -21,9 +21,9 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Spring's default <code>toString()</code> styler.
|
||||
* Spring's default {@code toString()} styler.
|
||||
*
|
||||
* <p>This class is used by {@link ToStringCreator} to style <code>toString()</code>
|
||||
* <p>This class is used by {@link ToStringCreator} to style {@code toString()}
|
||||
* output in a consistent manner according to Spring conventions.
|
||||
*
|
||||
* @author Keith Donald
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Converts objects to String form, generally for debugging purposes,
|
||||
* using Spring's <code>toString</code> styling conventions.
|
||||
* using Spring's {@code toString} styling conventions.
|
||||
*
|
||||
* <p>Uses the reflective visitor pattern underneath the hood to nicely
|
||||
* encapsulate styling algorithms for each type of styled object.
|
||||
|
||||
@@ -32,7 +32,7 @@ package org.springframework.core.style;
|
||||
public abstract class StylerUtils {
|
||||
|
||||
/**
|
||||
* Default ValueStyler instance used by the <code>style</code> method.
|
||||
* Default ValueStyler instance used by the {@code style} method.
|
||||
* Also available for the {@link ToStringCreator} class in this package.
|
||||
*/
|
||||
static final ValueStyler DEFAULT_VALUE_STYLER = new DefaultValueStyler();
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.springframework.core.style;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Utility class that builds pretty-printing <code>toString()</code> methods
|
||||
* Utility class that builds pretty-printing {@code toString()} methods
|
||||
* with pluggable styling conventions. By default, ToStringCreator adheres
|
||||
* to Spring's <code>toString()</code> styling conventions.
|
||||
* to Spring's {@code toString()} styling conventions.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.core.style;
|
||||
|
||||
/**
|
||||
* A strategy interface for pretty-printing <code>toString()</code> methods.
|
||||
* A strategy interface for pretty-printing {@code toString()} methods.
|
||||
* Encapsulates the print algorithms; some other object such as a builder
|
||||
* should provide the workflow.
|
||||
*
|
||||
@@ -27,14 +27,14 @@ package org.springframework.core.style;
|
||||
public interface ToStringStyler {
|
||||
|
||||
/**
|
||||
* Style a <code>toString()</code>'ed object before its fields are styled.
|
||||
* Style a {@code toString()}'ed object before its fields are styled.
|
||||
* @param buffer the buffer to print to
|
||||
* @param obj the object to style
|
||||
*/
|
||||
void styleStart(StringBuilder buffer, Object obj);
|
||||
|
||||
/**
|
||||
* Style a <code>toString()</code>'ed object after it's fields are styled.
|
||||
* Style a {@code toString()}'ed object after it's fields are styled.
|
||||
* @param buffer the buffer to print to
|
||||
* @param obj the object to style
|
||||
*/
|
||||
|
||||
@@ -49,8 +49,8 @@ public interface AsyncTaskExecutor extends TaskExecutor {
|
||||
|
||||
|
||||
/**
|
||||
* Execute the given <code>task</code>.
|
||||
* @param task the <code>Runnable</code> to execute (never <code>null</code>)
|
||||
* Execute the given {@code task}.
|
||||
* @param task the {@code Runnable} to execute (never {@code null})
|
||||
* @param startTimeout the time duration (milliseconds) within which the task is
|
||||
* supposed to start. This is intended as a hint to the executor, allowing for
|
||||
* preferred handling of immediate tasks. Typical values are {@link #TIMEOUT_IMMEDIATE}
|
||||
@@ -63,8 +63,8 @@ public interface AsyncTaskExecutor extends TaskExecutor {
|
||||
|
||||
/**
|
||||
* Submit a Runnable task for execution, receiving a Future representing that task.
|
||||
* The Future will return a <code>null</code> result upon completion.
|
||||
* @param task the <code>Runnable</code> to execute (never <code>null</code>)
|
||||
* The Future will return a {@code null} result upon completion.
|
||||
* @param task the {@code Runnable} to execute (never {@code null})
|
||||
* @return a Future representing pending completion of the task
|
||||
* @throws TaskRejectedException if the given task was not accepted
|
||||
*/
|
||||
@@ -73,7 +73,7 @@ public interface AsyncTaskExecutor extends TaskExecutor {
|
||||
/**
|
||||
* Submit a Callable task for execution, receiving a Future representing that task.
|
||||
* The Future will return the Callable's result upon completion.
|
||||
* @param task the <code>Callable</code> to execute (never <code>null</code>)
|
||||
* @param task the {@code Callable} to execute (never {@code null})
|
||||
* @return a Future representing pending completion of the task
|
||||
* @throws TaskRejectedException if the given task was not accepted
|
||||
*/
|
||||
|
||||
@@ -129,7 +129,7 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator implement
|
||||
|
||||
/**
|
||||
* Return whether this throttle is currently active.
|
||||
* @return <code>true</code> if the concurrency limit for this instance is active
|
||||
* @return {@code true} if the concurrency limit for this instance is active
|
||||
* @see #getConcurrencyLimit()
|
||||
* @see #setConcurrencyLimit
|
||||
*/
|
||||
@@ -195,7 +195,7 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator implement
|
||||
|
||||
/**
|
||||
* Subclass of the general ConcurrencyThrottleSupport class,
|
||||
* making <code>beforeAccess()</code> and <code>afterAccess()</code>
|
||||
* making {@code beforeAccess()} and {@code afterAccess()}
|
||||
* visible to the surrounding class.
|
||||
*/
|
||||
private static class ConcurrencyThrottleAdapter extends ConcurrencyThrottleSupport {
|
||||
@@ -213,7 +213,7 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator implement
|
||||
|
||||
|
||||
/**
|
||||
* This Runnable calls <code>afterAccess()</code> after the
|
||||
* This Runnable calls {@code afterAccess()} after the
|
||||
* target Runnable has finished its execution.
|
||||
*/
|
||||
private class ConcurrencyThrottlingRunnable implements Runnable {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
||||
* in it's 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</code> instead for such scenarios.
|
||||
* {@code TaskExecutor} instead for such scenarios.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
@@ -39,9 +39,9 @@ import org.springframework.util.Assert;
|
||||
public class SyncTaskExecutor implements TaskExecutor, Serializable {
|
||||
|
||||
/**
|
||||
* Executes the given <code>task</code> synchronously, through direct
|
||||
* Executes the given {@code task} synchronously, through direct
|
||||
* invocation of it's {@link Runnable#run() run()} method.
|
||||
* @throws IllegalArgumentException if the given <code>task</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if the given {@code task} is {@code null}
|
||||
*/
|
||||
public void execute(Runnable task) {
|
||||
Assert.notNull(task, "Runnable must not be null");
|
||||
|
||||
@@ -38,11 +38,11 @@ import java.util.concurrent.Executor;
|
||||
public interface TaskExecutor extends Executor {
|
||||
|
||||
/**
|
||||
* Execute the given <code>task</code>.
|
||||
* Execute the given {@code task}.
|
||||
* <p>The call might return immediately if the implementation uses
|
||||
* an asynchronous execution strategy, or might block in the case
|
||||
* of synchronous execution.
|
||||
* @param task the <code>Runnable</code> to execute (never <code>null</code>)
|
||||
* @param task the {@code Runnable} to execute (never {@code null})
|
||||
* @throws TaskRejectedException if the given task was not accepted
|
||||
*/
|
||||
void execute(Runnable task);
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.concurrent.RejectedExecutionException;
|
||||
public class TaskRejectedException extends RejectedExecutionException {
|
||||
|
||||
/**
|
||||
* Create a new <code>TaskRejectedException</code>
|
||||
* Create a new {@code TaskRejectedException}
|
||||
* with the specified detail message and no root cause.
|
||||
* @param msg the detail message
|
||||
*/
|
||||
@@ -39,11 +39,11 @@ public class TaskRejectedException extends RejectedExecutionException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>TaskRejectedException</code>
|
||||
* Create a new {@code TaskRejectedException}
|
||||
* with the specified detail message and the given root cause.
|
||||
* @param msg the detail message
|
||||
* @param cause the root cause (usually from using an underlying
|
||||
* API such as the <code>java.util.concurrent</code> package)
|
||||
* API such as the {@code java.util.concurrent} package)
|
||||
* @see java.util.concurrent.RejectedExecutionException
|
||||
*/
|
||||
public TaskRejectedException(String msg, Throwable cause) {
|
||||
|
||||
@@ -28,7 +28,7 @@ package org.springframework.core.task;
|
||||
public class TaskTimeoutException extends TaskRejectedException {
|
||||
|
||||
/**
|
||||
* Create a new <code>TaskTimeoutException</code>
|
||||
* Create a new {@code TaskTimeoutException}
|
||||
* with the specified detail message and no root cause.
|
||||
* @param msg the detail message
|
||||
*/
|
||||
@@ -37,11 +37,11 @@ public class TaskTimeoutException extends TaskRejectedException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>TaskTimeoutException</code>
|
||||
* Create a new {@code TaskTimeoutException}
|
||||
* with the specified detail message and the given root cause.
|
||||
* @param msg the detail message
|
||||
* @param cause the root cause (usually from using an underlying
|
||||
* API such as the <code>java.util.concurrent</code> package)
|
||||
* API such as the {@code java.util.concurrent} package)
|
||||
* @see java.util.concurrent.RejectedExecutionException
|
||||
*/
|
||||
public TaskTimeoutException(String msg, Throwable cause) {
|
||||
|
||||
@@ -25,16 +25,16 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor})
|
||||
* and exposes a full <code>java.util.concurrent.ExecutorService</code> for it.
|
||||
* and exposes a full {@code java.util.concurrent.ExecutorService} for it.
|
||||
*
|
||||
* <p>This is primarily for adapting to client components that communicate via the
|
||||
* <code>java.util.concurrent.ExecutorService</code> API. It can also be used as
|
||||
* common ground between a local Spring <code>TaskExecutor</code> backend and a
|
||||
* JNDI-located <code>ManagedExecutorService</code> in a Java EE 6 environment.
|
||||
* {@code java.util.concurrent.ExecutorService} API. It can also be used as
|
||||
* common ground between a local Spring {@code TaskExecutor} backend and a
|
||||
* JNDI-located {@code ManagedExecutorService} in a Java EE 6 environment.
|
||||
*
|
||||
* <p><b>NOTE:</b> This ExecutorService adapter does <em>not</em> support the
|
||||
* lifecycle methods in the <code>java.util.concurrent.ExecutorService</code> API
|
||||
* ("shutdown()" etc), similar to a server-wide <code>ManagedExecutorService</code>
|
||||
* lifecycle methods in the {@code java.util.concurrent.ExecutorService} API
|
||||
* ("shutdown()" etc), similar to a server-wide {@code ManagedExecutorService}
|
||||
* in a Java EE 6 environment. The lifecycle is always up to the backend pool,
|
||||
* with this adapter acting as an access-only proxy for that target pool.
|
||||
*
|
||||
|
||||
@@ -28,9 +28,9 @@ import org.springframework.core.task.TaskRejectedException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Adapter that takes a JDK 1.5 <code>java.util.concurrent.Executor</code> and
|
||||
* Adapter that takes a JDK 1.5 {@code java.util.concurrent.Executor} and
|
||||
* exposes a Spring {@link org.springframework.core.task.TaskExecutor} for it.
|
||||
* Also detects an extended <code>java.util.concurrent.ExecutorService</code>, adapting
|
||||
* Also detects an extended {@code java.util.concurrent.ExecutorService}, adapting
|
||||
* the {@link org.springframework.core.task.AsyncTaskExecutor} interface accordingly.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -65,7 +65,7 @@ public interface AnnotationMetadata extends ClassMetadata {
|
||||
* Determine whether the underlying class has an annotation or
|
||||
* meta-annotation of the given type defined.
|
||||
* <p>This is equivalent to a "hasAnnotation || hasMetaAnnotation"
|
||||
* check. If this method returns <code>true</code>, then
|
||||
* check. If this method returns {@code true}, then
|
||||
* {@link #getAnnotationAttributes} will return a non-null Map.
|
||||
* @param annotationType the annotation type to look for
|
||||
* @return whether a matching annotation is defined
|
||||
@@ -79,7 +79,7 @@ public interface AnnotationMetadata extends ClassMetadata {
|
||||
* @param annotationType the annotation type to look for
|
||||
* @return a Map of attributes, with the attribute name as key (e.g. "value")
|
||||
* and the defined attribute value as Map value. This return value will be
|
||||
* <code>null</code> if no matching annotation is defined.
|
||||
* {@code null} if no matching annotation is defined.
|
||||
*/
|
||||
Map<String, Object> getAnnotationAttributes(String annotationType);
|
||||
|
||||
@@ -93,7 +93,7 @@ public interface AnnotationMetadata extends ClassMetadata {
|
||||
* references which might potentially have to be loaded first
|
||||
* @return a Map of attributes, with the attribute name as key (e.g. "value")
|
||||
* and the defined attribute value as Map value. This return value will be
|
||||
* <code>null</code> if no matching annotation is defined.
|
||||
* {@code null} if no matching annotation is defined.
|
||||
*/
|
||||
Map<String, Object> getAnnotationAttributes(String annotationType, boolean classValuesAsString);
|
||||
|
||||
@@ -107,7 +107,7 @@ public interface AnnotationMetadata extends ClassMetadata {
|
||||
* Retrieve the method metadata for all methods that are annotated
|
||||
* (or meta-annotated) with the given annotation type.
|
||||
* <p>For any returned method, {@link MethodMetadata#isAnnotated} will
|
||||
* return <code>true</code> for the given annotation type.
|
||||
* return {@code true} for the given annotation type.
|
||||
* @param annotationType the annotation type to look for
|
||||
* @return a Set of {@link MethodMetadata} for methods that have a matching
|
||||
* annotation. The return value will be an empty set if no methods match
|
||||
|
||||
@@ -66,14 +66,14 @@ public interface ClassMetadata {
|
||||
* Return whether the underlying class has an enclosing class
|
||||
* (i.e. the underlying class is an inner/nested class or
|
||||
* a local class within a method).
|
||||
* <p>If this method returns <code>false</code>, then the
|
||||
* <p>If this method returns {@code false}, then the
|
||||
* underlying class is a top-level class.
|
||||
*/
|
||||
boolean hasEnclosingClass();
|
||||
|
||||
/**
|
||||
* Return the name of the enclosing class of the underlying class,
|
||||
* or <code>null</code> if the underlying class is a top-level class.
|
||||
* or {@code null} if the underlying class is a top-level class.
|
||||
*/
|
||||
String getEnclosingClassName();
|
||||
|
||||
@@ -84,7 +84,7 @@ public interface ClassMetadata {
|
||||
|
||||
/**
|
||||
* Return the name of the super class of the underlying class,
|
||||
* or <code>null</code> if there is no super class defined.
|
||||
* or {@code null} if there is no super class defined.
|
||||
*/
|
||||
String getSuperClassName();
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public interface MethodMetadata {
|
||||
* @param annotationType the annotation type to look for
|
||||
* @return a Map of attributes, with the attribute name as key (e.g. "value")
|
||||
* and the defined attribute value as Map value. This return value will be
|
||||
* <code>null</code> if no matching annotation is defined.
|
||||
* {@code null} if no matching annotation is defined.
|
||||
*/
|
||||
Map<String, Object> getAnnotationAttributes(String annotationType);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link ClassMetadata} implementation that uses standard reflection
|
||||
* to introspect a given <code>Class</code>.
|
||||
* to introspect a given {@code Class}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.5
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link MethodMetadata} implementation that uses standard reflection
|
||||
* to introspect a given <code>Method</code>.
|
||||
* to introspect a given {@code Method}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Mark Pollack
|
||||
|
||||
@@ -34,7 +34,7 @@ public interface MetadataReaderFactory {
|
||||
/**
|
||||
* Obtain a MetadataReader for the given class name.
|
||||
* @param className the class name (to be resolved to a ".class" file)
|
||||
* @return a holder for the ClassReader instance (never <code>null</code>)
|
||||
* @return a holder for the ClassReader instance (never {@code null})
|
||||
* @throws IOException in case of I/O failure
|
||||
*/
|
||||
MetadataReader getMetadataReader(String className) throws IOException;
|
||||
@@ -42,7 +42,7 @@ public interface MetadataReaderFactory {
|
||||
/**
|
||||
* Obtain a MetadataReader for the given resource.
|
||||
* @param resource the resource (pointing to a ".class" file)
|
||||
* @return a holder for the ClassReader instance (never <code>null</code>)
|
||||
* @return a holder for the ClassReader instance (never {@code null})
|
||||
* @throws IOException in case of I/O failure
|
||||
*/
|
||||
MetadataReader getMetadataReader(Resource resource) throws IOException;
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.core.type.ClassMetadata;
|
||||
* {@link org.springframework.asm.ClassReader}.
|
||||
*
|
||||
* <p>Package-visible in order to allow for repackaging the ASM library
|
||||
* without effect on users of the <code>core.type</code> package.
|
||||
* without effect on users of the {@code core.type} package.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Costin Leau
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.core.type.classreading.MetadataReader;
|
||||
* A simple filter which matches classes with a given annotation,
|
||||
* checking inherited annotations as well.
|
||||
*
|
||||
* <p>The matching logic mirrors that of <code>Class.isAnnotationPresent()</code>.
|
||||
* <p>The matching logic mirrors that of {@code Class.isAnnotationPresent()}.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Ramnivas Laddad
|
||||
@@ -44,7 +44,7 @@ public class AnnotationTypeFilter extends AbstractTypeHierarchyTraversingFilter
|
||||
* Create a new AnnotationTypeFilter for the given annotation type.
|
||||
* This filter will also match meta-annotations. To disable the
|
||||
* meta-annotation matching, use the constructor that accepts a
|
||||
* '<code>considerMetaAnnotations</code>' argument. The filter will
|
||||
* '{@code considerMetaAnnotations}' argument. The filter will
|
||||
* not match interfaces.
|
||||
* @param annotationType the annotation type to match
|
||||
*/
|
||||
|
||||
@@ -33,13 +33,13 @@ import java.util.regex.Pattern;
|
||||
* <p>The mapping matches URLs using the following rules:<br> <ul> <li>? matches one character</li> <li>* matches zero
|
||||
* or more characters</li> <li>** matches zero or more 'directories' in a path</li> </ul>
|
||||
*
|
||||
* <p>Some examples:<br> <ul> <li><code>com/t?st.jsp</code> - matches <code>com/test.jsp</code> but also
|
||||
* <code>com/tast.jsp</code> or <code>com/txst.jsp</code></li> <li><code>com/*.jsp</code> - matches all
|
||||
* <code>.jsp</code> files in the <code>com</code> directory</li> <li><code>com/**/test.jsp</code> - matches all
|
||||
* <code>test.jsp</code> files underneath the <code>com</code> path</li> <li><code>org/springframework/**/*.jsp</code>
|
||||
* - matches all <code>.jsp</code> files underneath the <code>org/springframework</code> path</li>
|
||||
* <li><code>org/**/servlet/bla.jsp</code> - matches <code>org/springframework/servlet/bla.jsp</code> but also
|
||||
* <code>org/springframework/testing/servlet/bla.jsp</code> and <code>org/servlet/bla.jsp</code></li> </ul>
|
||||
* <p>Some examples:<br> <ul> <li>{@code com/t?st.jsp} - matches {@code com/test.jsp} but also
|
||||
* {@code com/tast.jsp} or {@code com/txst.jsp}</li> <li>{@code com/*.jsp} - matches all
|
||||
* {@code .jsp} files in the {@code com} directory</li> <li>{@code com/**/test.jsp} - matches all
|
||||
* {@code test.jsp} files underneath the {@code com} path</li> <li>{@code org/springframework/**/*.jsp}
|
||||
* - matches all {@code .jsp} files underneath the {@code org/springframework} path</li>
|
||||
* <li>{@code org/**/servlet/bla.jsp} - matches {@code org/springframework/servlet/bla.jsp} but also
|
||||
* {@code org/springframework/testing/servlet/bla.jsp} and {@code org/servlet/bla.jsp}</li> </ul>
|
||||
*
|
||||
* @author Alef Arendsen
|
||||
* @author Juergen Hoeller
|
||||
@@ -81,12 +81,12 @@ public class AntPathMatcher implements PathMatcher {
|
||||
|
||||
|
||||
/**
|
||||
* Actually match the given <code>path</code> against the given <code>pattern</code>.
|
||||
* Actually match the given {@code path} against the given {@code pattern}.
|
||||
* @param pattern the pattern to match against
|
||||
* @param path the path String to test
|
||||
* @param fullMatch whether a full pattern match is required (else a pattern match
|
||||
* as far as the given base path goes is sufficient)
|
||||
* @return <code>true</code> if the supplied <code>path</code> matched, <code>false</code> if it didn't
|
||||
* @return {@code true} if the supplied {@code path} matched, {@code false} if it didn't
|
||||
*/
|
||||
protected boolean doMatch(String pattern, String path, boolean fullMatch,
|
||||
Map<String, String> uriTemplateVariables) {
|
||||
@@ -219,9 +219,9 @@ public class AntPathMatcher implements PathMatcher {
|
||||
* Tests whether or not a string matches against a pattern. The pattern may contain two special characters:
|
||||
* <br>'*' means zero or more characters
|
||||
* <br>'?' means one and only one character
|
||||
* @param pattern pattern to match against. Must not be <code>null</code>.
|
||||
* @param str string which must be matched against the pattern. Must not be <code>null</code>.
|
||||
* @return <code>true</code> if the string matches against the pattern, or <code>false</code> otherwise.
|
||||
* @param pattern pattern to match against. Must not be {@code null}.
|
||||
* @param str string which must be matched against the pattern. Must not be {@code null}.
|
||||
* @return {@code true} if the string matches against the pattern, or {@code false} otherwise.
|
||||
*/
|
||||
private boolean matchStrings(String pattern, String str, Map<String, String> uriTemplateVariables) {
|
||||
AntPathStringMatcher matcher = this.stringMatcherCache.get(pattern);
|
||||
@@ -234,15 +234,15 @@ public class AntPathMatcher implements PathMatcher {
|
||||
|
||||
/**
|
||||
* Given a pattern and a full path, determine the pattern-mapped part. <p>For example: <ul>
|
||||
* <li>'<code>/docs/cvs/commit.html</code>' and '<code>/docs/cvs/commit.html</code> -> ''</li>
|
||||
* <li>'<code>/docs/*</code>' and '<code>/docs/cvs/commit</code> -> '<code>cvs/commit</code>'</li>
|
||||
* <li>'<code>/docs/cvs/*.html</code>' and '<code>/docs/cvs/commit.html</code> -> '<code>commit.html</code>'</li>
|
||||
* <li>'<code>/docs/**</code>' and '<code>/docs/cvs/commit</code> -> '<code>cvs/commit</code>'</li>
|
||||
* <li>'<code>/docs/**\/*.html</code>' and '<code>/docs/cvs/commit.html</code> -> '<code>cvs/commit.html</code>'</li>
|
||||
* <li>'<code>/*.html</code>' and '<code>/docs/cvs/commit.html</code> -> '<code>docs/cvs/commit.html</code>'</li>
|
||||
* <li>'<code>*.html</code>' and '<code>/docs/cvs/commit.html</code> -> '<code>/docs/cvs/commit.html</code>'</li>
|
||||
* <li>'<code>*</code>' and '<code>/docs/cvs/commit.html</code> -> '<code>/docs/cvs/commit.html</code>'</li> </ul>
|
||||
* <p>Assumes that {@link #match} returns <code>true</code> for '<code>pattern</code>' and '<code>path</code>', but
|
||||
* <li>'{@code /docs/cvs/commit.html}' and '{@code /docs/cvs/commit.html} -> ''</li>
|
||||
* <li>'{@code /docs/*}' and '{@code /docs/cvs/commit} -> '{@code cvs/commit}'</li>
|
||||
* <li>'{@code /docs/cvs/*.html}' and '{@code /docs/cvs/commit.html} -> '{@code commit.html}'</li>
|
||||
* <li>'{@code /docs/**}' and '{@code /docs/cvs/commit} -> '{@code cvs/commit}'</li>
|
||||
* <li>'{@code /docs/**\/*.html}' and '{@code /docs/cvs/commit.html} -> '{@code cvs/commit.html}'</li>
|
||||
* <li>'{@code /*.html}' and '{@code /docs/cvs/commit.html} -> '{@code docs/cvs/commit.html}'</li>
|
||||
* <li>'{@code *.html}' and '{@code /docs/cvs/commit.html} -> '{@code /docs/cvs/commit.html}'</li>
|
||||
* <li>'{@code *}' and '{@code /docs/cvs/commit.html} -> '{@code /docs/cvs/commit.html}'</li> </ul>
|
||||
* <p>Assumes that {@link #match} returns {@code true} for '{@code pattern}' and '{@code path}', but
|
||||
* does <strong>not</strong> enforce this.
|
||||
*/
|
||||
public String extractPathWithinPattern(String pattern, String path) {
|
||||
@@ -369,10 +369,10 @@ public class AntPathMatcher implements PathMatcher {
|
||||
|
||||
/**
|
||||
* Given a full path, returns a {@link Comparator} suitable for sorting patterns in order of explicitness.
|
||||
* <p>The returned <code>Comparator</code> will {@linkplain java.util.Collections#sort(java.util.List,
|
||||
* <p>The returned {@code Comparator} will {@linkplain java.util.Collections#sort(java.util.List,
|
||||
* java.util.Comparator) sort} a list so that more specific patterns (without uri templates or wild cards) come before
|
||||
* generic patterns. So given a list with the following patterns: <ol> <li><code>/hotels/new</code></li>
|
||||
* <li><code>/hotels/{hotel}</code></li> <li><code>/hotels/*</code></li> </ol> the returned comparator will sort this
|
||||
* generic patterns. So given a list with the following patterns: <ol> <li>{@code /hotels/new}</li>
|
||||
* <li>{@code /hotels/{hotel}}</li> <li>{@code /hotels/*}</li> </ol> the returned comparator will sort this
|
||||
* list so that the order will be as indicated.
|
||||
* <p>The full path given as parameter is used to test for exact matches. So when the given path is {@code /hotels/2},
|
||||
* the pattern {@code /hotels/2} will be sorted before {@code /hotels/1}.
|
||||
@@ -525,7 +525,7 @@ public class AntPathMatcher implements PathMatcher {
|
||||
|
||||
/**
|
||||
* Main entry point.
|
||||
* @return <code>true</code> if the string matches against the pattern, or <code>false</code> otherwise.
|
||||
* @return {@code true} if the string matches against the pattern, or {@code false} otherwise.
|
||||
*/
|
||||
public boolean matchStrings(String str, Map<String, String> uriTemplateVariables) {
|
||||
Matcher matcher = this.pattern.matcher(str);
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
* Useful for identifying programmer errors early and clearly at runtime.
|
||||
*
|
||||
* <p>For example, if the contract of a public method states it does not
|
||||
* allow <code>null</code> arguments, Assert can be used to validate that
|
||||
* allow {@code null} arguments, Assert can be used to validate that
|
||||
* contract. Doing this clearly indicates a contract violation when it
|
||||
* occurs and protects the class's invariants.
|
||||
*
|
||||
@@ -53,12 +53,12 @@ import java.util.Map;
|
||||
public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert a boolean expression, throwing <code>IllegalArgumentException</code>
|
||||
* if the test result is <code>false</code>.
|
||||
* Assert a boolean expression, throwing {@code IllegalArgumentException}
|
||||
* if the test result is {@code false}.
|
||||
* <pre class="code">Assert.isTrue(i > 0, "The value must be greater than zero");</pre>
|
||||
* @param expression a boolean expression
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalArgumentException if expression is <code>false</code>
|
||||
* @throws IllegalArgumentException if expression is {@code false}
|
||||
*/
|
||||
public static void isTrue(boolean expression, String message) {
|
||||
if (!expression) {
|
||||
@@ -67,22 +67,22 @@ public abstract class Assert {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert a boolean expression, throwing <code>IllegalArgumentException</code>
|
||||
* if the test result is <code>false</code>.
|
||||
* Assert a boolean expression, throwing {@code IllegalArgumentException}
|
||||
* if the test result is {@code false}.
|
||||
* <pre class="code">Assert.isTrue(i > 0);</pre>
|
||||
* @param expression a boolean expression
|
||||
* @throws IllegalArgumentException if expression is <code>false</code>
|
||||
* @throws IllegalArgumentException if expression is {@code false}
|
||||
*/
|
||||
public static void isTrue(boolean expression) {
|
||||
isTrue(expression, "[Assertion failed] - this expression must be true");
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that an object is <code>null</code> .
|
||||
* Assert that an object is {@code null} .
|
||||
* <pre class="code">Assert.isNull(value, "The value must be null");</pre>
|
||||
* @param object the object to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalArgumentException if the object is not <code>null</code>
|
||||
* @throws IllegalArgumentException if the object is not {@code null}
|
||||
*/
|
||||
public static void isNull(Object object, String message) {
|
||||
if (object != null) {
|
||||
@@ -91,21 +91,21 @@ public abstract class Assert {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that an object is <code>null</code> .
|
||||
* Assert that an object is {@code null} .
|
||||
* <pre class="code">Assert.isNull(value);</pre>
|
||||
* @param object the object to check
|
||||
* @throws IllegalArgumentException if the object is not <code>null</code>
|
||||
* @throws IllegalArgumentException if the object is not {@code null}
|
||||
*/
|
||||
public static void isNull(Object object) {
|
||||
isNull(object, "[Assertion failed] - the object argument must be null");
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that an object is not <code>null</code> .
|
||||
* Assert that an object is not {@code null} .
|
||||
* <pre class="code">Assert.notNull(clazz, "The class must not be null");</pre>
|
||||
* @param object the object to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalArgumentException if the object is <code>null</code>
|
||||
* @throws IllegalArgumentException if the object is {@code null}
|
||||
*/
|
||||
public static void notNull(Object object, String message) {
|
||||
if (object == null) {
|
||||
@@ -114,10 +114,10 @@ public abstract class Assert {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that an object is not <code>null</code> .
|
||||
* Assert that an object is not {@code null} .
|
||||
* <pre class="code">Assert.notNull(clazz);</pre>
|
||||
* @param object the object to check
|
||||
* @throws IllegalArgumentException if the object is <code>null</code>
|
||||
* @throws IllegalArgumentException if the object is {@code null}
|
||||
*/
|
||||
public static void notNull(Object object) {
|
||||
notNull(object, "[Assertion failed] - this argument is required; it must not be null");
|
||||
@@ -125,7 +125,7 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that the given String is not empty; that is,
|
||||
* it must not be <code>null</code> and not the empty String.
|
||||
* it must not be {@code null} and not the empty String.
|
||||
* <pre class="code">Assert.hasLength(name, "Name must not be empty");</pre>
|
||||
* @param text the String to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
@@ -139,7 +139,7 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that the given String is not empty; that is,
|
||||
* it must not be <code>null</code> and not the empty String.
|
||||
* it must not be {@code null} and not the empty String.
|
||||
* <pre class="code">Assert.hasLength(name);</pre>
|
||||
* @param text the String to check
|
||||
* @see StringUtils#hasLength
|
||||
@@ -151,7 +151,7 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that the given String has valid text content; that is, it must not
|
||||
* be <code>null</code> and must contain at least one non-whitespace character.
|
||||
* be {@code null} and must contain at least one non-whitespace character.
|
||||
* <pre class="code">Assert.hasText(name, "'name' must not be empty");</pre>
|
||||
* @param text the String to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
@@ -165,7 +165,7 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that the given String has valid text content; that is, it must not
|
||||
* be <code>null</code> and must contain at least one non-whitespace character.
|
||||
* be {@code null} and must contain at least one non-whitespace character.
|
||||
* <pre class="code">Assert.hasText(name, "'name' must not be empty");</pre>
|
||||
* @param text the String to check
|
||||
* @see StringUtils#hasText
|
||||
@@ -203,11 +203,11 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that an array has elements; that is, it must not be
|
||||
* <code>null</code> and must have at least one element.
|
||||
* {@code null} and must have at least one element.
|
||||
* <pre class="code">Assert.notEmpty(array, "The array must have elements");</pre>
|
||||
* @param array the array to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalArgumentException if the object array is <code>null</code> or has no elements
|
||||
* @throws IllegalArgumentException if the object array is {@code null} or has no elements
|
||||
*/
|
||||
public static void notEmpty(Object[] array, String message) {
|
||||
if (ObjectUtils.isEmpty(array)) {
|
||||
@@ -217,10 +217,10 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that an array has elements; that is, it must not be
|
||||
* <code>null</code> and must have at least one element.
|
||||
* {@code null} and must have at least one element.
|
||||
* <pre class="code">Assert.notEmpty(array);</pre>
|
||||
* @param array the array to check
|
||||
* @throws IllegalArgumentException if the object array is <code>null</code> or has no elements
|
||||
* @throws IllegalArgumentException if the object array is {@code null} or has no elements
|
||||
*/
|
||||
public static void notEmpty(Object[] array) {
|
||||
notEmpty(array, "[Assertion failed] - this array must not be empty: it must contain at least 1 element");
|
||||
@@ -232,7 +232,7 @@ public abstract class Assert {
|
||||
* <pre class="code">Assert.noNullElements(array, "The array must have non-null elements");</pre>
|
||||
* @param array the array to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalArgumentException if the object array contains a <code>null</code> element
|
||||
* @throws IllegalArgumentException if the object array contains a {@code null} element
|
||||
*/
|
||||
public static void noNullElements(Object[] array, String message) {
|
||||
if (array != null) {
|
||||
@@ -249,7 +249,7 @@ public abstract class Assert {
|
||||
* Note: Does not complain if the array is empty!
|
||||
* <pre class="code">Assert.noNullElements(array);</pre>
|
||||
* @param array the array to check
|
||||
* @throws IllegalArgumentException if the object array contains a <code>null</code> element
|
||||
* @throws IllegalArgumentException if the object array contains a {@code null} element
|
||||
*/
|
||||
public static void noNullElements(Object[] array) {
|
||||
noNullElements(array, "[Assertion failed] - this array must not contain any null elements");
|
||||
@@ -257,11 +257,11 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that a collection has elements; that is, it must not be
|
||||
* <code>null</code> and must have at least one element.
|
||||
* {@code null} and must have at least one element.
|
||||
* <pre class="code">Assert.notEmpty(collection, "Collection must have elements");</pre>
|
||||
* @param collection the collection to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalArgumentException if the collection is <code>null</code> or has no elements
|
||||
* @throws IllegalArgumentException if the collection is {@code null} or has no elements
|
||||
*/
|
||||
public static void notEmpty(Collection collection, String message) {
|
||||
if (CollectionUtils.isEmpty(collection)) {
|
||||
@@ -271,10 +271,10 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert that a collection has elements; that is, it must not be
|
||||
* <code>null</code> and must have at least one element.
|
||||
* {@code null} and must have at least one element.
|
||||
* <pre class="code">Assert.notEmpty(collection, "Collection must have elements");</pre>
|
||||
* @param collection the collection to check
|
||||
* @throws IllegalArgumentException if the collection is <code>null</code> or has no elements
|
||||
* @throws IllegalArgumentException if the collection is {@code null} or has no elements
|
||||
*/
|
||||
public static void notEmpty(Collection collection) {
|
||||
notEmpty(collection,
|
||||
@@ -282,12 +282,12 @@ public abstract class Assert {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that a Map has entries; that is, it must not be <code>null</code>
|
||||
* Assert that a Map has entries; that is, it must not be {@code null}
|
||||
* and must have at least one entry.
|
||||
* <pre class="code">Assert.notEmpty(map, "Map must have entries");</pre>
|
||||
* @param map the map to check
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalArgumentException if the map is <code>null</code> or has no entries
|
||||
* @throws IllegalArgumentException if the map is {@code null} or has no entries
|
||||
*/
|
||||
public static void notEmpty(Map map, String message) {
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
@@ -296,11 +296,11 @@ public abstract class Assert {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that a Map has entries; that is, it must not be <code>null</code>
|
||||
* Assert that a Map has entries; that is, it must not be {@code null}
|
||||
* and must have at least one entry.
|
||||
* <pre class="code">Assert.notEmpty(map);</pre>
|
||||
* @param map the map to check
|
||||
* @throws IllegalArgumentException if the map is <code>null</code> or has no entries
|
||||
* @throws IllegalArgumentException if the map is {@code null} or has no entries
|
||||
*/
|
||||
public static void notEmpty(Map map) {
|
||||
notEmpty(map, "[Assertion failed] - this map must not be empty; it must contain at least one entry");
|
||||
@@ -341,7 +341,7 @@ public abstract class Assert {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that <code>superType.isAssignableFrom(subType)</code> is <code>true</code>.
|
||||
* 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
|
||||
@@ -352,7 +352,7 @@ public abstract class Assert {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that <code>superType.isAssignableFrom(subType)</code> is <code>true</code>.
|
||||
* 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 against
|
||||
* @param subType the sub type to check
|
||||
@@ -371,13 +371,13 @@ public abstract class Assert {
|
||||
|
||||
|
||||
/**
|
||||
* Assert a boolean expression, throwing <code>IllegalStateException</code>
|
||||
* if the test result is <code>false</code>. Call isTrue if you wish to
|
||||
* Assert a boolean expression, throwing {@code IllegalStateException}
|
||||
* if the test result is {@code false}. Call isTrue if you wish to
|
||||
* throw IllegalArgumentException on an assertion failure.
|
||||
* <pre class="code">Assert.state(id == null, "The id property must not already be initialized");</pre>
|
||||
* @param expression a boolean expression
|
||||
* @param message the exception message to use if the assertion fails
|
||||
* @throws IllegalStateException if expression is <code>false</code>
|
||||
* @throws IllegalStateException if expression is {@code false}
|
||||
*/
|
||||
public static void state(boolean expression, String message) {
|
||||
if (!expression) {
|
||||
@@ -387,12 +387,12 @@ public abstract class Assert {
|
||||
|
||||
/**
|
||||
* Assert a boolean expression, throwing {@link IllegalStateException}
|
||||
* if the test result is <code>false</code>.
|
||||
* if the test result is {@code false}.
|
||||
* <p>Call {@link #isTrue(boolean)} if you wish to
|
||||
* throw {@link IllegalArgumentException} on an assertion failure.
|
||||
* <pre class="code">Assert.state(id == null);</pre>
|
||||
* @param expression a boolean expression
|
||||
* @throws IllegalStateException if the supplied expression is <code>false</code>
|
||||
* @throws IllegalStateException if the supplied expression is {@code false}
|
||||
*/
|
||||
public static void state(boolean expression) {
|
||||
state(expression, "[Assertion failed] - this state invariant must be true");
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.util.ListIterator;
|
||||
* <p>Note: This class is not thread-safe. To create a thread-safe version,
|
||||
* use the {@link java.util.Collections#synchronizedList} utility methods.
|
||||
*
|
||||
* <p>Inspired by <code>LazyList</code> from Commons Collections.
|
||||
* <p>Inspired by {@code LazyList} from Commons Collections.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
@@ -54,7 +54,7 @@ public class AutoPopulatingList<E> implements List<E>, Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new <code>AutoPopulatingList</code> that is backed by a standard
|
||||
* Creates a new {@code AutoPopulatingList} that is backed by a standard
|
||||
* {@link ArrayList} and adds new instances of the supplied {@link Class element Class}
|
||||
* to the backing {@link List} on demand.
|
||||
*/
|
||||
@@ -63,7 +63,7 @@ public class AutoPopulatingList<E> implements List<E>, Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>AutoPopulatingList</code> that is backed by the supplied {@link List}
|
||||
* Creates a new {@code AutoPopulatingList} that is backed by the supplied {@link List}
|
||||
* and adds new instances of the supplied {@link Class element Class} to the backing
|
||||
* {@link List} on demand.
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ public class AutoPopulatingList<E> implements List<E>, Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>AutoPopulatingList</code> that is backed by a standard
|
||||
* Creates a new {@code AutoPopulatingList} that is backed by a standard
|
||||
* {@link ArrayList} and creates new elements on demand using the supplied {@link ElementFactory}.
|
||||
*/
|
||||
public AutoPopulatingList(ElementFactory<E> elementFactory) {
|
||||
@@ -80,7 +80,7 @@ public class AutoPopulatingList<E> implements List<E>, Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>AutoPopulatingList</code> that is backed by the supplied {@link List}
|
||||
* Creates a new {@code AutoPopulatingList} that is backed by the supplied {@link List}
|
||||
* and creates new elements on demand using the supplied {@link ElementFactory}.
|
||||
*/
|
||||
public AutoPopulatingList(List<E> backingList, ElementFactory<E> elementFactory) {
|
||||
@@ -244,8 +244,8 @@ public class AutoPopulatingList<E> implements List<E>, Serializable {
|
||||
|
||||
/**
|
||||
* Reflective implementation of the ElementFactory interface,
|
||||
* using <code>Class.newInstance()</code> on a given element class.
|
||||
* @see java.lang.Class#newInstance()
|
||||
* using {@code Class.newInstance()} on a given element class.
|
||||
* @see Class#newInstance()
|
||||
*/
|
||||
private static class ReflectiveElementFactory<E> implements ElementFactory<E>, Serializable {
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.WeakHashMap;
|
||||
* expensive values in a target Map. Supports caching weak or strong keys.
|
||||
*
|
||||
* <p>This class is an abstract template. Caching Map implementations
|
||||
* should subclass and override the <code>create(key)</code> method which
|
||||
* should subclass and override the {@code create(key)} method which
|
||||
* encapsulates expensive creation of a new object.
|
||||
*
|
||||
* @author Keith Donald
|
||||
@@ -263,8 +263,8 @@ public abstract class CachingMapDecorator<K, V> implements Map<K, V>, Serializab
|
||||
* the given key-value pair.
|
||||
* @param key the candidate key
|
||||
* @param value the candidate value
|
||||
* @return <code>true</code> in order to use a weak reference;
|
||||
* <code>false</code> otherwise.
|
||||
* @return {@code true} in order to use a weak reference;
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
protected boolean useWeakValue(K key, V value) {
|
||||
return this.weak;
|
||||
@@ -295,7 +295,7 @@ public abstract class CachingMapDecorator<K, V> implements Map<K, V>, Serializab
|
||||
|
||||
/**
|
||||
* Create a value to cache for the given key.
|
||||
* Called by <code>get</code> if there is no value cached already.
|
||||
* Called by {@code get} if there is no value cached already.
|
||||
* @param key the cache key
|
||||
* @see #get(Object)
|
||||
*/
|
||||
|
||||
@@ -147,10 +147,10 @@ public abstract class ClassUtils {
|
||||
* <p>Call this method if you intend to use the thread context ClassLoader
|
||||
* in a scenario where you absolutely need a non-null ClassLoader reference:
|
||||
* for example, for class path resource loading (but not necessarily for
|
||||
* <code>Class.forName</code>, which accepts a <code>null</code> ClassLoader
|
||||
* {@code Class.forName}, which accepts a {@code null} ClassLoader
|
||||
* reference as well).
|
||||
* @return the default ClassLoader (never <code>null</code>)
|
||||
* @see java.lang.Thread#getContextClassLoader()
|
||||
* @return the default ClassLoader (never {@code null})
|
||||
* @see Thread#getContextClassLoader()
|
||||
*/
|
||||
public static ClassLoader getDefaultClassLoader() {
|
||||
ClassLoader cl = null;
|
||||
@@ -172,7 +172,7 @@ public abstract class ClassUtils {
|
||||
* if necessary, i.e. if the bean ClassLoader is not equivalent to the thread
|
||||
* context ClassLoader already.
|
||||
* @param classLoaderToUse the actual ClassLoader to use for the thread context
|
||||
* @return the original thread context ClassLoader, or <code>null</code> if not overridden
|
||||
* @return the original thread context ClassLoader, or {@code null} if not overridden
|
||||
*/
|
||||
public static ClassLoader overrideThreadContextClassLoader(ClassLoader classLoaderToUse) {
|
||||
Thread currentThread = Thread.currentThread();
|
||||
@@ -187,7 +187,7 @@ public abstract class ClassUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement for <code>Class.forName()</code> that also returns Class instances
|
||||
* Replacement for {@code Class.forName()} that also returns Class instances
|
||||
* for primitives (like "int") and array class names (like "String[]").
|
||||
* <p>Always uses the default class loader: that is, preferably the thread context
|
||||
* class loader, or the ClassLoader that loaded the ClassUtils class as fallback.
|
||||
@@ -206,13 +206,13 @@ public abstract class ClassUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement for <code>Class.forName()</code> that also returns Class instances
|
||||
* Replacement for {@code Class.forName()} that also returns Class instances
|
||||
* for primitives (e.g."int") and array class names (e.g. "String[]").
|
||||
* Furthermore, it is also capable of resolving inner class names in Java source
|
||||
* style (e.g. "java.lang.Thread.State" instead of "java.lang.Thread$State").
|
||||
* @param name the name of the Class
|
||||
* @param classLoader the class loader to use
|
||||
* (may be <code>null</code>, which indicates the default class loader)
|
||||
* (may be {@code null}, which indicates the default class loader)
|
||||
* @return Class instance for the supplied name
|
||||
* @throws ClassNotFoundException if the class was not found
|
||||
* @throws LinkageError if the class file could not be loaded
|
||||
@@ -275,12 +275,12 @@ public abstract class ClassUtils {
|
||||
/**
|
||||
* Resolve the given class name into a Class instance. Supports
|
||||
* primitives (like "int") and array class names (like "String[]").
|
||||
* <p>This is effectively equivalent to the <code>forName</code>
|
||||
* <p>This is effectively equivalent to the {@code forName}
|
||||
* method with the same arguments, with the only difference being
|
||||
* the exceptions thrown in case of class loading failure.
|
||||
* @param className the name of the Class
|
||||
* @param classLoader the class loader to use
|
||||
* (may be <code>null</code>, which indicates the default class loader)
|
||||
* (may be {@code null}, which indicates the default class loader)
|
||||
* @return Class instance for the supplied name
|
||||
* @throws IllegalArgumentException if the class name was not resolvable
|
||||
* (that is, the class could not be found or the class file could not be loaded)
|
||||
@@ -306,7 +306,7 @@ public abstract class ClassUtils {
|
||||
* Does <i>not</i> support the "[]" suffix notation for primitive arrays;
|
||||
* this is only supported by {@link #forName(String, ClassLoader)}.
|
||||
* @param name the name of the potentially primitive class
|
||||
* @return the primitive class, or <code>null</code> if the name does not denote
|
||||
* @return the primitive class, or {@code null} if the name does not denote
|
||||
* a primitive class or primitive array class
|
||||
*/
|
||||
public static Class<?> resolvePrimitiveClassName(String name) {
|
||||
@@ -322,7 +322,7 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the {@link Class} identified by the supplied name is present
|
||||
* and can be loaded. Will return <code>false</code> if either the class or
|
||||
* and can be loaded. Will return {@code false} if either the class or
|
||||
* one of its dependencies is not present or cannot be loaded.
|
||||
* @param className the name of the class to check
|
||||
* @return whether the specified class is present
|
||||
@@ -335,11 +335,11 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the {@link Class} identified by the supplied name is present
|
||||
* and can be loaded. Will return <code>false</code> if either the class or
|
||||
* and can be loaded. Will return {@code false} if either the class or
|
||||
* one of its dependencies is not present or cannot be loaded.
|
||||
* @param className the name of the class to check
|
||||
* @param classLoader the class loader to use
|
||||
* (may be <code>null</code>, which indicates the default class loader)
|
||||
* (may be {@code null}, which indicates the default class loader)
|
||||
* @return whether the specified class is present
|
||||
*/
|
||||
public static boolean isPresent(String className, ClassLoader classLoader) {
|
||||
@@ -575,11 +575,11 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the given class has a public constructor with the given signature.
|
||||
* <p>Essentially translates <code>NoSuchMethodException</code> to "false".
|
||||
* @param clazz the clazz to analyze
|
||||
* <p>Essentially translates {@code NoSuchMethodException} to "false".
|
||||
* @param clazz the clazz to analyze
|
||||
* @param paramTypes the parameter types of the method
|
||||
* @return whether the class has a corresponding constructor
|
||||
* @see java.lang.Class#getMethod
|
||||
* @see Class#getMethod
|
||||
*/
|
||||
public static boolean hasConstructor(Class<?> clazz, Class<?>... paramTypes) {
|
||||
return (getConstructorIfAvailable(clazz, paramTypes) != null);
|
||||
@@ -587,12 +587,12 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the given class has a public constructor with the given signature,
|
||||
* and return it if available (else return <code>null</code>).
|
||||
* <p>Essentially translates <code>NoSuchMethodException</code> to <code>null</code>.
|
||||
* @param clazz the clazz to analyze
|
||||
* and return it if available (else return {@code null}).
|
||||
* <p>Essentially translates {@code NoSuchMethodException} to {@code null}.
|
||||
* @param clazz the clazz to analyze
|
||||
* @param paramTypes the parameter types of the method
|
||||
* @return the constructor, or <code>null</code> if not found
|
||||
* @see java.lang.Class#getConstructor
|
||||
* @return the constructor, or {@code null} if not found
|
||||
* @see Class#getConstructor
|
||||
*/
|
||||
public static <T> Constructor<T> getConstructorIfAvailable(Class<T> clazz, Class<?>... paramTypes) {
|
||||
Assert.notNull(clazz, "Class must not be null");
|
||||
@@ -606,12 +606,12 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the given class has a method with the given signature.
|
||||
* <p>Essentially translates <code>NoSuchMethodException</code> to "false".
|
||||
* @param clazz the clazz to analyze
|
||||
* <p>Essentially translates {@code NoSuchMethodException} to "false".
|
||||
* @param clazz the clazz to analyze
|
||||
* @param methodName the name of the method
|
||||
* @param paramTypes the parameter types of the method
|
||||
* @return whether the class has a corresponding method
|
||||
* @see java.lang.Class#getMethod
|
||||
* @see Class#getMethod
|
||||
*/
|
||||
public static boolean hasMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) {
|
||||
return (getMethodIfAvailable(clazz, methodName, paramTypes) != null);
|
||||
@@ -619,14 +619,14 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the given class has a method with the given signature,
|
||||
* and return it if available (else throws an <code>IllegalStateException</code>).
|
||||
* <p>Essentially translates <code>NoSuchMethodException</code> to <code>IllegalStateException</code>.
|
||||
* @param clazz the clazz to analyze
|
||||
* and return it if available (else throws an {@code IllegalStateException}).
|
||||
* <p>Essentially translates {@code NoSuchMethodException} to {@code IllegalStateException}.
|
||||
* @param clazz the clazz to analyze
|
||||
* @param methodName the name of the method
|
||||
* @param paramTypes the parameter types of the method
|
||||
* @return the method (never <code>null</code>)
|
||||
* @return the method (never {@code null})
|
||||
* @throws IllegalStateException if the method has not been found
|
||||
* @see java.lang.Class#getMethod
|
||||
* @see Class#getMethod
|
||||
*/
|
||||
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) {
|
||||
Assert.notNull(clazz, "Class must not be null");
|
||||
@@ -641,13 +641,13 @@ public abstract class ClassUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the given class has a method with the given signature,
|
||||
* and return it if available (else return <code>null</code>).
|
||||
* <p>Essentially translates <code>NoSuchMethodException</code> to <code>null</code>.
|
||||
* @param clazz the clazz to analyze
|
||||
* and return it if available (else return {@code null}).
|
||||
* <p>Essentially translates {@code NoSuchMethodException} to {@code null}.
|
||||
* @param clazz the clazz to analyze
|
||||
* @param methodName the name of the method
|
||||
* @param paramTypes the parameter types of the method
|
||||
* @return the method, or <code>null</code> if not found
|
||||
* @see java.lang.Class#getMethod
|
||||
* @return the method, or {@code null} if not found
|
||||
* @see Class#getMethod
|
||||
*/
|
||||
public static Method getMethodIfAvailable(Class<?> clazz, String methodName, Class<?>... paramTypes) {
|
||||
Assert.notNull(clazz, "Class must not be null");
|
||||
@@ -716,9 +716,9 @@ public abstract class ClassUtils {
|
||||
/**
|
||||
* Given a method, which may come from an interface, and a target class used
|
||||
* in the current reflective invocation, find the corresponding target method
|
||||
* if there is one. E.g. the method may be <code>IFoo.bar()</code> and the
|
||||
* target class may be <code>DefaultFoo</code>. In this case, the method may be
|
||||
* <code>DefaultFoo.bar()</code>. This enables attributes on that method to be found.
|
||||
* if there is one. E.g. the method may be {@code IFoo.bar()} and the
|
||||
* target class may be {@code DefaultFoo}. In this case, the method may be
|
||||
* {@code DefaultFoo.bar()}. This enables attributes on that method to be found.
|
||||
* <p><b>NOTE:</b> In contrast to {@link org.springframework.aop.support.AopUtils#getMostSpecificMethod},
|
||||
* this method does <i>not</i> resolve Java 5 bridge methods automatically.
|
||||
* Call {@link org.springframework.core.BridgeMethodResolver#findBridgedMethod}
|
||||
@@ -729,9 +729,9 @@ public abstract class ClassUtils {
|
||||
* will fall back to returning the originally provided method.
|
||||
* @param method the method to be invoked, which may come from an interface
|
||||
* @param targetClass the target class for the current invocation.
|
||||
* May be <code>null</code> or may not even implement the method.
|
||||
* May be {@code null} or may not even implement the method.
|
||||
* @return the specific target method, or the original method if the
|
||||
* <code>targetClass</code> doesn't implement it or is <code>null</code>
|
||||
* {@code targetClass} doesn't implement it or is {@code null}
|
||||
*/
|
||||
public static Method getMostSpecificMethod(Method method, Class<?> targetClass) {
|
||||
if (method != null && isOverridable(method, targetClass) &&
|
||||
@@ -776,9 +776,9 @@ public abstract class ClassUtils {
|
||||
/**
|
||||
* Return a public static method of a class.
|
||||
* @param methodName the static method name
|
||||
* @param clazz the class which defines the method
|
||||
* @param clazz the class which defines the method
|
||||
* @param args the parameter types to the method
|
||||
* @return the static method, or <code>null</code> if no static method was found
|
||||
* @return the static method, or {@code null} if no static method was found
|
||||
* @throws IllegalArgumentException if the method name is blank or the clazz is null
|
||||
*/
|
||||
public static Method getStaticMethod(Class<?> clazz, String methodName, Class<?>... args) {
|
||||
@@ -915,8 +915,8 @@ public abstract class ClassUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a path suitable for use with <code>ClassLoader.getResource</code>
|
||||
* (also suitable for use with <code>Class.getResource</code> by prepending a
|
||||
* Return a path suitable for use with {@code ClassLoader.getResource}
|
||||
* (also suitable for use with {@code Class.getResource} by prepending a
|
||||
* slash ('/') to the return value). Built by taking the package of the specified
|
||||
* class file, converting all dots ('.') to slashes ('/'), adding a trailing slash
|
||||
* if necessary, and concatenating the specified resource name to this.
|
||||
@@ -924,11 +924,11 @@ public abstract class ClassUtils {
|
||||
* loading a resource file that is in the same package as a class file,
|
||||
* although {@link org.springframework.core.io.ClassPathResource} is usually
|
||||
* even more convenient.
|
||||
* @param clazz the Class whose package will be used as the base
|
||||
* @param clazz the Class whose package will be used as the base
|
||||
* @param resourceName the resource name to append. A leading slash is optional.
|
||||
* @return the built-up resource path
|
||||
* @see java.lang.ClassLoader#getResource
|
||||
* @see java.lang.Class#getResource
|
||||
* @see ClassLoader#getResource
|
||||
* @see Class#getResource
|
||||
*/
|
||||
public static String addResourcePathToPackagePath(Class<?> clazz, String resourceName) {
|
||||
Assert.notNull(resourceName, "Resource name must not be null");
|
||||
@@ -943,10 +943,10 @@ public abstract class ClassUtils {
|
||||
* class's package name as a pathname, i.e., all dots ('.') are replaced by
|
||||
* slashes ('/'). Neither a leading nor trailing slash is added. The result
|
||||
* could be concatenated with a slash and the name of a resource and fed
|
||||
* directly to <code>ClassLoader.getResource()</code>. For it to be fed to
|
||||
* <code>Class.getResource</code> instead, a leading slash would also have
|
||||
* directly to {@code ClassLoader.getResource()}. For it to be fed to
|
||||
* {@code Class.getResource} instead, a leading slash would also have
|
||||
* to be prepended to the returned value.
|
||||
* @param clazz the input class. A <code>null</code> value or the default
|
||||
* @param clazz the input class. A {@code null} value or the default
|
||||
* (empty) package will result in an empty string ("") being returned.
|
||||
* @return a path which represents the package name
|
||||
* @see ClassLoader#getResource
|
||||
@@ -968,9 +968,9 @@ public abstract class ClassUtils {
|
||||
/**
|
||||
* Build a String that consists of the names of the classes/interfaces
|
||||
* in the given array.
|
||||
* <p>Basically like <code>AbstractCollection.toString()</code>, but stripping
|
||||
* <p>Basically like {@code AbstractCollection.toString()}, but stripping
|
||||
* the "class "/"interface " prefix before every class name.
|
||||
* @param classes a Collection of Class objects (may be <code>null</code>)
|
||||
* @param classes a Collection of Class objects (may be {@code null})
|
||||
* @return a String of form "[com.foo.Bar, com.foo.Baz]"
|
||||
* @see java.util.AbstractCollection#toString()
|
||||
*/
|
||||
@@ -981,9 +981,9 @@ public abstract class ClassUtils {
|
||||
/**
|
||||
* Build a String that consists of the names of the classes/interfaces
|
||||
* in the given collection.
|
||||
* <p>Basically like <code>AbstractCollection.toString()</code>, but stripping
|
||||
* <p>Basically like {@code AbstractCollection.toString()}, but stripping
|
||||
* the "class "/"interface " prefix before every class name.
|
||||
* @param classes a Collection of Class objects (may be <code>null</code>)
|
||||
* @param classes a Collection of Class objects (may be {@code null})
|
||||
* @return a String of form "[com.foo.Bar, com.foo.Baz]"
|
||||
* @see java.util.AbstractCollection#toString()
|
||||
*/
|
||||
@@ -1007,8 +1007,8 @@ public abstract class ClassUtils {
|
||||
* Copy the given Collection into a Class array.
|
||||
* The Collection must contain Class elements only.
|
||||
* @param collection the Collection to copy
|
||||
* @return the Class array (<code>null</code> if the passed-in
|
||||
* Collection was <code>null</code>)
|
||||
* @return the Class array ({@code null} if the passed-in
|
||||
* Collection was {@code null})
|
||||
*/
|
||||
public static Class<?>[] toClassArray(Collection<Class<?>> collection) {
|
||||
if (collection == null) {
|
||||
@@ -1045,7 +1045,7 @@ public abstract class ClassUtils {
|
||||
* <p>If the class itself is an interface, it gets returned as sole interface.
|
||||
* @param clazz the class to analyze for interfaces
|
||||
* @param classLoader the ClassLoader that the interfaces need to be visible in
|
||||
* (may be <code>null</code> when accepting all declared interfaces)
|
||||
* (may be {@code null} when accepting all declared interfaces)
|
||||
* @return all interfaces that the given object implements as array
|
||||
*/
|
||||
public static Class<?>[] getAllInterfacesForClass(Class<?> clazz, ClassLoader classLoader) {
|
||||
@@ -1081,7 +1081,7 @@ public abstract class ClassUtils {
|
||||
* <p>If the class itself is an interface, it gets returned as sole interface.
|
||||
* @param clazz the class to analyze for interfaces
|
||||
* @param classLoader the ClassLoader that the interfaces need to be visible in
|
||||
* (may be <code>null</code> when accepting all declared interfaces)
|
||||
* (may be {@code null} when accepting all declared interfaces)
|
||||
* @return all interfaces that the given object implements as Set
|
||||
*/
|
||||
public static Set<Class> getAllInterfacesForClassAsSet(Class clazz, ClassLoader classLoader) {
|
||||
@@ -1118,8 +1118,8 @@ public abstract class ClassUtils {
|
||||
/**
|
||||
* Check whether the given class is visible in the given ClassLoader.
|
||||
* @param clazz the class to check (typically an interface)
|
||||
* @param classLoader the ClassLoader to check against (may be <code>null</code>,
|
||||
* in which case this method will always return <code>true</code>)
|
||||
* @param classLoader the ClassLoader to check against (may be {@code null},
|
||||
* in which case this method will always return {@code true})
|
||||
*/
|
||||
public static boolean isVisible(Class<?> clazz, ClassLoader classLoader) {
|
||||
if (classLoader == null) {
|
||||
|
||||
@@ -42,8 +42,8 @@ import java.util.Set;
|
||||
public abstract class CollectionUtils {
|
||||
|
||||
/**
|
||||
* Return <code>true</code> if the supplied Collection is <code>null</code>
|
||||
* or empty. Otherwise, return <code>false</code>.
|
||||
* Return {@code true} if the supplied Collection is {@code null}
|
||||
* or empty. Otherwise, return {@code false}.
|
||||
* @param collection the Collection to check
|
||||
* @return whether the given Collection is empty
|
||||
*/
|
||||
@@ -52,8 +52,8 @@ public abstract class CollectionUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return <code>true</code> if the supplied Map is <code>null</code>
|
||||
* or empty. Otherwise, return <code>false</code>.
|
||||
* Return {@code true} if the supplied Map is {@code null}
|
||||
* or empty. Otherwise, return {@code false}.
|
||||
* @param map the Map to check
|
||||
* @return whether the given Map is empty
|
||||
*/
|
||||
@@ -64,7 +64,7 @@ public abstract class CollectionUtils {
|
||||
/**
|
||||
* Convert the supplied array into a List. A primitive array gets
|
||||
* converted into a List of the appropriate wrapper type.
|
||||
* <p>A <code>null</code> source value will be converted to an
|
||||
* <p>A {@code null} source value will be converted to an
|
||||
* empty List.
|
||||
* @param source the (potentially primitive) array
|
||||
* @return the converted List result
|
||||
@@ -76,7 +76,7 @@ public abstract class CollectionUtils {
|
||||
|
||||
/**
|
||||
* Merge the given array into the given Collection.
|
||||
* @param array the array to merge (may be <code>null</code>)
|
||||
* @param array the array to merge (may be {@code null})
|
||||
* @param collection the target Collection to merge the array into
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -93,9 +93,9 @@ public abstract class CollectionUtils {
|
||||
/**
|
||||
* Merge the given Properties instance into the given Map,
|
||||
* copying all properties (key-value pairs) over.
|
||||
* <p>Uses <code>Properties.propertyNames()</code> to even catch
|
||||
* <p>Uses {@code Properties.propertyNames()} to even catch
|
||||
* default properties linked into the original Properties instance.
|
||||
* @param props the Properties instance to merge (may be <code>null</code>)
|
||||
* @param props the Properties instance to merge (may be {@code null})
|
||||
* @param map the target Map to merge the properties into
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -121,7 +121,7 @@ public abstract class CollectionUtils {
|
||||
* Check whether the given Iterator contains the given element.
|
||||
* @param iterator the Iterator to check
|
||||
* @param element the element to look for
|
||||
* @return <code>true</code> if found, <code>false</code> else
|
||||
* @return {@code true} if found, {@code false} else
|
||||
*/
|
||||
public static boolean contains(Iterator iterator, Object element) {
|
||||
if (iterator != null) {
|
||||
@@ -139,7 +139,7 @@ public abstract class CollectionUtils {
|
||||
* Check whether the given Enumeration contains the given element.
|
||||
* @param enumeration the Enumeration to check
|
||||
* @param element the element to look for
|
||||
* @return <code>true</code> if found, <code>false</code> else
|
||||
* @return {@code true} if found, {@code false} else
|
||||
*/
|
||||
public static boolean contains(Enumeration enumeration, Object element) {
|
||||
if (enumeration != null) {
|
||||
@@ -156,10 +156,10 @@ public abstract class CollectionUtils {
|
||||
/**
|
||||
* Check whether the given Collection contains the given element instance.
|
||||
* <p>Enforces the given instance to be present, rather than returning
|
||||
* <code>true</code> for an equal element as well.
|
||||
* {@code true} for an equal element as well.
|
||||
* @param collection the Collection to check
|
||||
* @param element the element to look for
|
||||
* @return <code>true</code> if found, <code>false</code> else
|
||||
* @return {@code true} if found, {@code false} else
|
||||
*/
|
||||
public static boolean containsInstance(Collection collection, Object element) {
|
||||
if (collection != null) {
|
||||
@@ -173,8 +173,8 @@ public abstract class CollectionUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return <code>true</code> if any element in '<code>candidates</code>' is
|
||||
* contained in '<code>source</code>'; otherwise returns <code>false</code>.
|
||||
* Return {@code true} if any element in '{@code candidates}' is
|
||||
* contained in '{@code source}'; otherwise returns {@code false}.
|
||||
* @param source the source Collection
|
||||
* @param candidates the candidates to search for
|
||||
* @return whether any of the candidates has been found
|
||||
@@ -192,13 +192,13 @@ public abstract class CollectionUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the first element in '<code>candidates</code>' that is contained in
|
||||
* '<code>source</code>'. If no element in '<code>candidates</code>' is present in
|
||||
* '<code>source</code>' returns <code>null</code>. Iteration order is
|
||||
* Return the first element in '{@code candidates}' that is contained in
|
||||
* '{@code source}'. If no element in '{@code candidates}' is present in
|
||||
* '{@code source}' returns {@code null}. Iteration order is
|
||||
* {@link Collection} implementation specific.
|
||||
* @param source the source Collection
|
||||
* @param candidates the candidates to search for
|
||||
* @return the first present object, or <code>null</code> if not found
|
||||
* @return the first present object, or {@code null} if not found
|
||||
*/
|
||||
public static Object findFirstMatch(Collection source, Collection candidates) {
|
||||
if (isEmpty(source) || isEmpty(candidates)) {
|
||||
@@ -217,7 +217,7 @@ public abstract class CollectionUtils {
|
||||
* @param collection the Collection to search
|
||||
* @param type the type to look for
|
||||
* @return a value of the given type found if there is a clear match,
|
||||
* or <code>null</code> if none or more than one such value found
|
||||
* or {@code null} if none or more than one such value found
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T findValueOfType(Collection<?> collection, Class<T> type) {
|
||||
@@ -244,7 +244,7 @@ public abstract class CollectionUtils {
|
||||
* @param collection the collection to search
|
||||
* @param types the types to look for, in prioritized order
|
||||
* @return a value of one of the given types found if there is a clear match,
|
||||
* or <code>null</code> if none or more than one such value found
|
||||
* or {@code null} if none or more than one such value found
|
||||
*/
|
||||
public static Object findValueOfType(Collection<?> collection, Class<?>[] types) {
|
||||
if (isEmpty(collection) || ObjectUtils.isEmpty(types)) {
|
||||
@@ -262,8 +262,8 @@ public abstract class CollectionUtils {
|
||||
/**
|
||||
* Determine whether the given Collection only contains a single unique object.
|
||||
* @param collection the Collection to check
|
||||
* @return <code>true</code> if the collection contains a single reference or
|
||||
* multiple references to the same instance, <code>false</code> else
|
||||
* @return {@code true} if the collection contains a single reference or
|
||||
* multiple references to the same instance, {@code false} else
|
||||
*/
|
||||
public static boolean hasUniqueObject(Collection collection) {
|
||||
if (isEmpty(collection)) {
|
||||
@@ -286,7 +286,7 @@ public abstract class CollectionUtils {
|
||||
/**
|
||||
* Find the common element type of the given Collection, if any.
|
||||
* @param collection the Collection to check
|
||||
* @return the common element type, or <code>null</code> if no clear
|
||||
* @return the common element type, or {@code null} if no clear
|
||||
* common type has been found (or the collection was empty)
|
||||
*/
|
||||
public static Class<?> findCommonElementType(Collection collection) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.io.Writer;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
/**
|
||||
* <code>java.io.Writer</code> adapter for a Commons Logging <code>Log</code>.
|
||||
* {@code java.io.Writer} adapter for a Commons Logging {@code Log}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.5.1
|
||||
|
||||
@@ -28,7 +28,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</code>
|
||||
* appropriate points of its workflow. Note that {@code afterAccess}
|
||||
* should usually be called in a finally block!
|
||||
*
|
||||
* <p>The default concurrency limit of this support class is -1
|
||||
@@ -88,7 +88,7 @@ public abstract class ConcurrencyThrottleSupport implements Serializable {
|
||||
|
||||
/**
|
||||
* Return whether this throttle is currently active.
|
||||
* @return <code>true</code> if the concurrency limit for this instance is active
|
||||
* @return {@code true} if the concurrency limit for this instance is active
|
||||
* @see #getConcurrencyLimit()
|
||||
*/
|
||||
public boolean isThrottleActive() {
|
||||
|
||||
@@ -131,7 +131,7 @@ public class CustomizableThreadCreator implements Serializable {
|
||||
|
||||
/**
|
||||
* Return the thread group that threads should be created in
|
||||
* (or <code>null</code>) for the default group.
|
||||
* (or {@code null}) for the default group.
|
||||
*/
|
||||
public ThreadGroup getThreadGroup() {
|
||||
return this.threadGroup;
|
||||
@@ -170,7 +170,7 @@ public class CustomizableThreadCreator implements Serializable {
|
||||
|
||||
/**
|
||||
* Build the default thread name prefix for this factory.
|
||||
* @return the default thread name prefix (never <code>null</code>)
|
||||
* @return the default thread name prefix (never {@code null})
|
||||
*/
|
||||
protected String getDefaultThreadNamePrefix() {
|
||||
return ClassUtils.getShortName(getClass()) + "-";
|
||||
|
||||
@@ -29,17 +29,17 @@ import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link PropertiesPersister} interface.
|
||||
* Follows the native parsing of <code>java.util.Properties</code>.
|
||||
* Follows the native parsing of {@code java.util.Properties}.
|
||||
*
|
||||
* <p>Allows for reading from any Reader and writing to any Writer, for example
|
||||
* to specify a charset for a properties file. This is a capability that standard
|
||||
* <code>java.util.Properties</code> unfortunately lacks up until JDK 1.5:
|
||||
* {@code java.util.Properties} unfortunately lacks up until JDK 1.5:
|
||||
* You can only load files using the ISO-8859-1 charset there.
|
||||
*
|
||||
* <p>Loading from and storing to a stream delegates to <code>Properties.load</code>
|
||||
* and <code>Properties.store</code>, respectively, to be fully compatible with
|
||||
* <p>Loading from and storing to a stream delegates to {@code Properties.load}
|
||||
* and {@code Properties.store}, respectively, to be fully compatible with
|
||||
* the Unicode conversion as implemented by the JDK Properties class. On JDK 1.6,
|
||||
* <code>Properties.load/store</code> will also be used for readers/writers,
|
||||
* {@code Properties.load/store} will also be used for readers/writers,
|
||||
* effectively turning this class into a plain backwards compatibility adapter.
|
||||
*
|
||||
* <p>The persistence code that works with Reader/Writer follows the JDK's parsing
|
||||
@@ -50,7 +50,7 @@ import java.util.Properties;
|
||||
* "defaultEncoding" and "fileEncodings" properties).
|
||||
*
|
||||
* <p>As of Spring 1.2.2, this implementation also supports properties XML files,
|
||||
* through the <code>loadFromXml</code> and <code>storeToXml</code> methods.
|
||||
* through the {@code loadFromXml} and {@code storeToXml} methods.
|
||||
* The default implementations delegate to JDK 1.5's corresponding methods,
|
||||
* throwing an exception if running on an older JDK. Those implementations
|
||||
* could be subclassed to apply custom XML handling on JDK 1.4, for example.
|
||||
|
||||
@@ -31,9 +31,9 @@ public abstract class FileSystemUtils {
|
||||
/**
|
||||
* Delete the supplied {@link File} - for directories,
|
||||
* recursively delete any nested directories or files as well.
|
||||
* @param root the root <code>File</code> to delete
|
||||
* @return <code>true</code> if the <code>File</code> was deleted,
|
||||
* otherwise <code>false</code>
|
||||
* @param root the root {@code File} to delete
|
||||
* @return {@code true} if the {@code File} was deleted,
|
||||
* otherwise {@code false}
|
||||
*/
|
||||
public static boolean deleteRecursively(File root) {
|
||||
if (root != null && root.exists()) {
|
||||
@@ -51,8 +51,8 @@ public abstract class FileSystemUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively copy the contents of the <code>src</code> file/directory
|
||||
* to the <code>dest</code> file/directory.
|
||||
* Recursively copy the contents of the {@code src} file/directory
|
||||
* to the {@code dest} file/directory.
|
||||
* @param src the source directory
|
||||
* @param dest the destination directory
|
||||
* @throws IOException in the case of I/O errors
|
||||
@@ -64,8 +64,8 @@ public abstract class FileSystemUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually copy the contents of the <code>src</code> file/directory
|
||||
* to the <code>dest</code> file/directory.
|
||||
* Actually copy the contents of the {@code src} file/directory
|
||||
* to the {@code dest} file/directory.
|
||||
* @param src the source directory
|
||||
* @param dest the destination directory
|
||||
* @throws IOException in the case of I/O errors
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
* <p>Preserves the original order as well as the original casing of keys,
|
||||
* while allowing for contains, get and remove calls with any case of key.
|
||||
*
|
||||
* <p>Does <i>not</i> support <code>null</code> keys.
|
||||
* <p>Does <i>not</i> support {@code null} keys.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.apache.log4j.xml.DOMConfigurator;
|
||||
*
|
||||
* <p>For web environments, the analogous Log4jWebConfigurer class can be found
|
||||
* in the web package, reading in its configuration from context-params in
|
||||
* <code>web.xml</code>. In a J2EE web application, log4j is usually set up
|
||||
* {@code web.xml}. In a J2EE web application, log4j is usually set up
|
||||
* via Log4jConfigListener or Log4jConfigServlet, delegating to
|
||||
* Log4jWebConfigurer underneath.
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user