git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1078032 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2011-03-04 16:07:14 +00:00
parent ef14f844cc
commit 0ca84735ad
16 changed files with 1650 additions and 1649 deletions

View File

@ -89,7 +89,7 @@ protected void appendDetail(StringBuffer buffer, String fieldName, Object value)
};
/**
* <p><code>AnnotationUtils</code> instances should NOT be constructed in
* <p>{@code AnnotationUtils} instances should NOT be constructed in
* standard programming. Instead, the class should be used statically.</p>
*
* <p>This constructor is public to permit tools that require a JavaBean

File diff suppressed because it is too large Load Diff

View File

@ -123,8 +123,8 @@ public short getShortRawValue(short holder) {
*
* @param holder the int data containing the bits we're interested
* in
* @return <code>true</code> if any of the bits are set,
* else <code>false</code>
* @return {@code true} if any of the bits are set,
* else {@code false}
*/
public boolean isSet(int holder) {
return (holder & _mask) != 0;
@ -135,12 +135,12 @@ public boolean isSet(int holder) {
*
* <p>This is a stricter test than {@link #isSet(int)},
* in that all of the bits in a multi-bit set must be set
* for this method to return <code>true</code>.</p>
* for this method to return {@code true}.</p>
*
* @param holder the int data containing the bits we're
* interested in
* @return <code>true</code> if all of the bits are set,
* else <code>false</code>
* @return {@code true} if all of the bits are set,
* else {@code false}
*/
public boolean isAllSet(int holder) {
return (holder & _mask) == _mask;
@ -180,7 +180,7 @@ public short setShortValue(short holder, short value) {
* @param holder the int data containing the bits we're
* interested in
* @return the value of holder with the specified bits cleared
* (set to <code>0</code>)
* (set to {@code 0})
*/
public int clear(int holder) {
return holder & ~_mask;
@ -192,7 +192,7 @@ public int clear(int holder) {
* @param holder the short data containing the bits we're
* interested in
* @return the value of holder with the specified bits cleared
* (set to <code>0</code>)
* (set to {@code 0})
*/
public short clearShort(short holder) {
return (short) clear(holder);
@ -205,7 +205,7 @@ public short clearShort(short holder) {
* interested in
*
* @return the value of holder with the specified bits cleared
* (set to <code>0</code>)
* (set to {@code 0})
*/
public byte clearByte(byte holder) {
return (byte) clear(holder);
@ -217,7 +217,7 @@ public byte clearByte(byte holder) {
* @param holder the int data containing the bits we're
* interested in
* @return the value of holder with the specified bits set
* to <code>1</code>
* to {@code 1}
*/
public int set(int holder) {
return holder | _mask;
@ -229,7 +229,7 @@ public int set(int holder) {
* @param holder the short data containing the bits we're
* interested in
* @return the value of holder with the specified bits set
* to <code>1</code>
* to {@code 1}
*/
public short setShort(short holder) {
return (short) set(holder);
@ -242,7 +242,7 @@ public short setShort(short holder) {
* interested in
*
* @return the value of holder with the specified bits set
* to <code>1</code>
* to {@code 1}
*/
public byte setByte(byte holder) {
return (byte) set(holder);

View File

@ -884,7 +884,7 @@ public static String toString(boolean bool, String trueString, String falseStrin
* BooleanUtils.xor(new boolean[] { true, false }) = true
* </pre>
*
* @param array an array of <code>boolean<code>s
* @param array an array of {@code boolean}s
* @return {@code true} if the xor is successful.
* @throws IllegalArgumentException if {@code array} is {@code null}
* @throws IllegalArgumentException if {@code array} is empty.
@ -924,7 +924,7 @@ public static boolean xor(boolean... array) {
* BooleanUtils.xor(new Boolean[] { Boolean.TRUE, Boolean.FALSE }) = Boolean.TRUE
* </pre>
*
* @param array an array of <code>Boolean<code>s
* @param array an array of {@code Boolean}s
* @return {@code true} if the xor is successful.
* @throws IllegalArgumentException if {@code array} is {@code null}
* @throws IllegalArgumentException if {@code array} is empty.

View File

@ -19,8 +19,8 @@
/**
* <p>Operations on char primitives and Character objects.</p>
*
* <p>This class tries to handle <code>null</code> input gracefully.
* An exception will not be thrown for a <code>null</code> input.
* <p>This class tries to handle {@code null} input gracefully.
* An exception will not be thrown for a {@code null} input.
* Each method documents its behaviour in more detail.</p>
*
* <p>#ThreadSafe#</p>
@ -52,7 +52,7 @@ public class CharUtils {
private static final Character[] CHAR_ARRAY = new Character[128];
/**
* <code>\u000a</code> linefeed LF ('\n').
* {@code \u000a} linefeed LF ('\n').
*
* @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089">JLF: Escape Sequences
* for Character and String Literals</a>
@ -61,7 +61,7 @@ public class CharUtils {
public static final char LF = '\n';
/**
* <code>\u000d</code> carriage return CR ('\r').
* {@code \u000d} carriage return CR ('\r').
*
* @see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089">JLF: Escape Sequences
* for Character and String Literals</a>
@ -78,8 +78,8 @@ public class CharUtils {
}
/**
* <p><code>CharUtils</code> instances should NOT be constructed in standard programming.
* Instead, the class should be used as <code>CharUtils.toString('c');</code>.</p>
* <p>{@code CharUtils} instances should NOT be constructed in standard programming.
* Instead, the class should be used as {@code CharUtils.toString('c');}.</p>
*
* <p>This constructor is public to permit tools that require a JavaBean instance
* to operate.</p>
@ -136,7 +136,7 @@ public static Character toCharacterObject(String str) {
//-----------------------------------------------------------------------
/**
* <p>Converts the Character to a char throwing an exception for <code>null</code>.</p>
* <p>Converts the Character to a char throwing an exception for {@code null}.</p>
*
* <pre>
* CharUtils.toChar(null) = IllegalArgumentException
@ -156,7 +156,7 @@ public static char toChar(Character ch) {
}
/**
* <p>Converts the Character to a char handling <code>null</code>.</p>
* <p>Converts the Character to a char handling {@code null}.</p>
*
* <pre>
* CharUtils.toChar(null, 'X') = 'X'
@ -339,7 +339,7 @@ public static String toString(char ch) {
* <p>For ASCII 7 bit characters, this uses a cache that will return the
* same String object each time.</p>
*
* <p>If <code>null</code> is passed in, <code>null</code> will be returned.</p>
* <p>If {@code null} is passed in, {@code null} will be returned.</p>
*
* <pre>
* CharUtils.toString(null) = null
@ -387,7 +387,7 @@ public static String unicodeEscaped(char ch) {
*
* <p>This format is the Java source code format.</p>
*
* <p>If <code>null</code> is passed in, <code>null</code> will be returned.</p>
* <p>If {@code null} is passed in, {@code null} will be returned.</p>
*
* <pre>
* CharUtils.unicodeEscaped(null) = null

View File

@ -29,13 +29,13 @@
/**
* <p>Operates on classes without using reflection.</p>
*
* <p>This class handles invalid <code>null</code> inputs as best it can.
* <p>This class handles invalid {@code null} inputs as best it can.
* Each method documents its behaviour in more detail.</p>
*
* <p>The notion of a <code>canonical name</code> includes the human
* readable name for the type, for example <code>int[]</code>. The
* <p>The notion of a {@code canonical name} includes the human
* readable name for the type, for example {@code int[]}. The
* non-canonical method variants work with the JVM names, such as
* <code>[I</code>. </p>
* {@code [I}. </p>
*
* @author Apache Software Foundation
* @author Gary Gregory
@ -53,7 +53,7 @@ public class ClassUtils {
public static final char PACKAGE_SEPARATOR_CHAR = '.';
/**
* <p>The package separator String: <code>"&#x2e;"</code>.</p>
* <p>The package separator String: {@code "&#x2e;"}.</p>
*/
public static final String PACKAGE_SEPARATOR = String.valueOf(PACKAGE_SEPARATOR_CHAR);
@ -63,12 +63,12 @@ public class ClassUtils {
public static final char INNER_CLASS_SEPARATOR_CHAR = '$';
/**
* <p>The inner class separator String: <code>"$"</code>.</p>
* <p>The inner class separator String: {@code "$"}.</p>
*/
public static final String INNER_CLASS_SEPARATOR = String.valueOf(INNER_CLASS_SEPARATOR_CHAR);
/**
* Maps primitive <code>Class</code>es to their corresponding wrapper <code>Class</code>.
* Maps primitive {@code Class}es to their corresponding wrapper {@code Class}.
*/
private static final Map<Class<?>, Class<?>> primitiveWrapperMap = new HashMap<Class<?>, Class<?>>();
static {
@ -84,7 +84,7 @@ public class ClassUtils {
}
/**
* Maps wrapper <code>Class</code>es to their corresponding primitive types.
* Maps wrapper {@code Class}es to their corresponding primitive types.
*/
private static final Map<Class<?>, Class<?>> wrapperPrimitiveMap = new HashMap<Class<?>, Class<?>>();
static {
@ -134,7 +134,7 @@ private static void addAbbreviation(String primitive, String abbreviation) {
/**
* <p>ClassUtils instances should NOT be constructed in standard programming.
* Instead, the class should be used as
* <code>ClassUtils.getShortClassName(cls)</code>.</p>
* {@code ClassUtils.getShortClassName(cls)}.</p>
*
* <p>This constructor is public to permit tools that require a JavaBean
* instance to operate.</p>
@ -146,7 +146,7 @@ public ClassUtils() {
// Short class name
// ----------------------------------------------------------------------
/**
* <p>Gets the class name minus the package name for an <code>Object</code>.</p>
* <p>Gets the class name minus the package name for an {@code Object}.</p>
*
* @param object the class to get the short name for, may be null
* @param valueIfNull the value to return if null
@ -160,7 +160,7 @@ public static String getShortClassName(Object object, String valueIfNull) {
}
/**
* <p>Gets the class name minus the package name from a <code>Class</code>.</p>
* <p>Gets the class name minus the package name from a {@code Class}.</p>
*
* @param cls the class to get the short name for.
* @return the class name without the package name or an empty string
@ -219,7 +219,7 @@ public static String getShortClassName(String className) {
// Package name
// ----------------------------------------------------------------------
/**
* <p>Gets the package name of an <code>Object</code>.</p>
* <p>Gets the package name of an {@code Object}.</p>
*
* @param object the class to get the package name for, may be null
* @param valueIfNull the value to return if null
@ -233,9 +233,9 @@ public static String getPackageName(Object object, String valueIfNull) {
}
/**
* <p>Gets the package name of a <code>Class</code>.</p>
* <p>Gets the package name of a {@code Class}.</p>
*
* @param cls the class to get the package name for, may be <code>null</code>.
* @param cls the class to get the package name for, may be {@code null}.
* @return the package name or an empty string
*/
public static String getPackageName(Class<?> cls) {
@ -246,12 +246,12 @@ public static String getPackageName(Class<?> cls) {
}
/**
* <p>Gets the package name from a <code>String</code>.</p>
* <p>Gets the package name from a {@code String}.</p>
*
* <p>The string passed in is assumed to be a class name - it is not checked.</p>
* <p>If the class is unpackaged, return an empty string.</p>
*
* @param className the className to get the package name for, may be <code>null</code>
* @param className the className to get the package name for, may be {@code null}
* @return the package name or an empty string
*/
public static String getPackageName(String className) {
@ -278,11 +278,11 @@ public static String getPackageName(String className) {
// Superclasses/Superinterfaces
// ----------------------------------------------------------------------
/**
* <p>Gets a <code>List</code> of superclasses for the given class.</p>
* <p>Gets a {@code List} of superclasses for the given class.</p>
*
* @param cls the class to look up, may be <code>null</code>
* @return the <code>List</code> of superclasses in order going up from this one
* <code>null</code> if null input
* @param cls the class to look up, may be {@code null}
* @return the {@code List} of superclasses in order going up from this one
* {@code null} if null input
*/
public static List<Class<?>> getAllSuperclasses(Class<?> cls) {
if (cls == null) {
@ -298,7 +298,7 @@ public static List<Class<?>> getAllSuperclasses(Class<?> cls) {
}
/**
* <p>Gets a <code>List</code> of all interfaces implemented by the given
* <p>Gets a {@code List} of all interfaces implemented by the given
* class and its superclasses.</p>
*
* <p>The order is determined by looking through each interface in turn as
@ -306,9 +306,9 @@ public static List<Class<?>> getAllSuperclasses(Class<?> cls) {
* superclass is considered in the same way. Later duplicates are ignored,
* so the order is maintained.</p>
*
* @param cls the class to look up, may be <code>null</code>
* @return the <code>List</code> of interfaces in order,
* <code>null</code> if null input
* @param cls the class to look up, may be {@code null}
* @return the {@code List} of interfaces in order,
* {@code null} if null input
*/
public static List<Class<?>> getAllInterfaces(Class<?> cls) {
if (cls == null) {
@ -324,8 +324,8 @@ public static List<Class<?>> getAllInterfaces(Class<?> cls) {
/**
* Get the interfaces for the specified class.
*
* @param cls the class to look up, may be <code>null</code>
* @param interfacesFound the <code>Set</code> of interfaces for the class
* @param cls the class to look up, may be {@code null}
* @param interfacesFound the {@code Set} of interfaces for the class
*/
private static void getAllInterfaces(Class<?> cls, HashSet<Class<?>> interfacesFound) {
while (cls != null) {
@ -344,15 +344,15 @@ private static void getAllInterfaces(Class<?> cls, HashSet<Class<?>> interfacesF
// Convert list
// ----------------------------------------------------------------------
/**
* <p>Given a <code>List</code> of class names, this method converts them into classes.</p>
* <p>Given a {@code List} of class names, this method converts them into classes.</p>
*
* <p>A new <code>List</code> is returned. If the class name cannot be found, <code>null</code>
* is stored in the <code>List</code>. If the class name in the <code>List</code> is
* <code>null</code>, <code>null</code> is stored in the output <code>List</code>.</p>
* <p>A new {@code List} is returned. If the class name cannot be found, {@code null}
* is stored in the {@code List}. If the class name in the {@code List} is
* {@code null}, {@code null} is stored in the output {@code List}.</p>
*
* @param classNames the classNames to change
* @return a <code>List</code> of Class objects corresponding to the class names,
* <code>null</code> if null input
* @return a {@code List} of Class objects corresponding to the class names,
* {@code null} if null input
* @throws ClassCastException if classNames contains a non String entry
*/
public static List<Class<?>> convertClassNamesToClasses(List<String> classNames) {
@ -371,16 +371,16 @@ public static List<Class<?>> convertClassNamesToClasses(List<String> classNames)
}
/**
* <p>Given a <code>List</code> of <code>Class</code> objects, this method converts
* <p>Given a {@code List} of {@code Class} objects, this method converts
* them into class names.</p>
*
* <p>A new <code>List</code> is returned. <code>null</code> objects will be copied into
* the returned list as <code>null</code>.</p>
* <p>A new {@code List} is returned. {@code null} objects will be copied into
* the returned list as {@code null}.</p>
*
* @param classes the classes to change
* @return a <code>List</code> of class names corresponding to the Class objects,
* <code>null</code> if null input
* @throws ClassCastException if <code>classes</code> contains a non-<code>Class</code> entry
* @return a {@code List} of class names corresponding to the Class objects,
* {@code null} if null input
* @throws ClassCastException if {@code classes} contains a non-{@code Class} entry
*/
public static List<String> convertClassesToClassNames(List<Class<?>> classes) {
if (classes == null) {
@ -409,19 +409,19 @@ public static List<String> convertClassesToClassNames(List<Class<?>> classes) {
*
* <p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method, this
* method takes into account widenings of primitive classes and
* <code>null</code>s.</p>
* {@code null}s.</p>
*
* <p>Primitive widenings allow an int to be assigned to a <code>long</code>,
* <code>float</code> or <code>double</code>. This method returns the correct
* <p>Primitive widenings allow an int to be assigned to a {@code long},
* {@code float} or {@code double}. This method returns the correct
* result for these cases.</p>
*
* <p><code>Null</code> may be assigned to any reference type. This method will
* return <code>true</code> if <code>null</code> is passed in and the toClass is
* <p>{@code Null} may be assigned to any reference type. This method will
* return {@code true} if {@code null} is passed in and the toClass is
* non-primitive.</p>
*
* <p>Specifically, this method tests whether the type represented by the
* specified <code>Class</code> parameter can be converted to the type
* represented by this <code>Class</code> object via an identity conversion
* specified {@code Class} parameter can be converted to the type
* represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* <em><a href="http://java.sun.com/docs/books/jls/">The Java Language Specification</a></em>,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.</p>
@ -431,9 +431,9 @@ public static List<String> convertClassesToClassNames(List<Class<?>> classes) {
* to the running Java version</em>; i.e. autoboxing will be the default
* behavior in VMs running Java versions >= 1.5.</p>
*
* @param classArray the array of Classes to check, may be <code>null</code>
* @param toClassArray the array of Classes to try to assign into, may be <code>null</code>
* @return <code>true</code> if assignment possible
* @param classArray the array of Classes to check, may be {@code null}
* @param toClassArray the array of Classes to try to assign into, may be {@code null}
* @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArray) {
return isAssignable(classArray, toClassArray, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5));
@ -449,27 +449,27 @@ public static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArra
*
* <p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method, this
* method takes into account widenings of primitive classes and
* <code>null</code>s.</p>
* {@code null}s.</p>
*
* <p>Primitive widenings allow an int to be assigned to a <code>long</code>,
* <code>float</code> or <code>double</code>. This method returns the correct
* <p>Primitive widenings allow an int to be assigned to a {@code long},
* {@code float} or {@code double}. This method returns the correct
* result for these cases.</p>
*
* <p><code>Null</code> may be assigned to any reference type. This method will
* return <code>true</code> if <code>null</code> is passed in and the toClass is
* <p>{@code Null} may be assigned to any reference type. This method will
* return {@code true} if {@code null} is passed in and the toClass is
* non-primitive.</p>
*
* <p>Specifically, this method tests whether the type represented by the
* specified <code>Class</code> parameter can be converted to the type
* represented by this <code>Class</code> object via an identity conversion
* specified {@code Class} parameter can be converted to the type
* represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* <em><a href="http://java.sun.com/docs/books/jls/">The Java Language Specification</a></em>,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.</p>
*
* @param classArray the array of Classes to check, may be <code>null</code>
* @param toClassArray the array of Classes to try to assign into, may be <code>null</code>
* @param classArray the array of Classes to check, may be {@code null}
* @param toClassArray the array of Classes to try to assign into, may be {@code null}
* @param autoboxing whether to use implicit autoboxing/unboxing between primitives and wrappers
* @return <code>true</code> if assignment possible
* @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArray, boolean autoboxing) {
if (ArrayUtils.isSameLength(classArray, toClassArray) == false) {
@ -490,23 +490,23 @@ public static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArra
}
/**
* <p>Checks if one <code>Class</code> can be assigned to a variable of
* another <code>Class</code>.</p>
* <p>Checks if one {@code Class} can be assigned to a variable of
* another {@code Class}.</p>
*
* <p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method,
* this method takes into account widenings of primitive classes and
* <code>null</code>s.</p>
* {@code null}s.</p>
*
* <p>Primitive widenings allow an int to be assigned to a long, float or
* double. This method returns the correct result for these cases.</p>
*
* <p><code>Null</code> may be assigned to any reference type. This method
* will return <code>true</code> if <code>null</code> is passed in and the
* <p>{@code Null} may be assigned to any reference type. This method
* will return {@code true} if {@code null} is passed in and the
* toClass is non-primitive.</p>
*
* <p>Specifically, this method tests whether the type represented by the
* specified <code>Class</code> parameter can be converted to the type
* represented by this <code>Class</code> object via an identity conversion
* specified {@code Class} parameter can be converted to the type
* represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* <em><a href="http://java.sun.com/docs/books/jls/">The Java Language Specification</a></em>,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.</p>
@ -518,30 +518,30 @@ public static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArra
*
* @param cls the Class to check, may be null
* @param toClass the Class to try to assign into, returns false if null
* @return <code>true</code> if assignment possible
* @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class<?> cls, Class<?> toClass) {
return isAssignable(cls, toClass, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5));
}
/**
* <p>Checks if one <code>Class</code> can be assigned to a variable of
* another <code>Class</code>.</p>
* <p>Checks if one {@code Class} can be assigned to a variable of
* another {@code Class}.</p>
*
* <p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method,
* this method takes into account widenings of primitive classes and
* <code>null</code>s.</p>
* {@code null}s.</p>
*
* <p>Primitive widenings allow an int to be assigned to a long, float or
* double. This method returns the correct result for these cases.</p>
*
* <p><code>Null</code> may be assigned to any reference type. This method
* will return <code>true</code> if <code>null</code> is passed in and the
* <p>{@code Null} may be assigned to any reference type. This method
* will return {@code true} if {@code null} is passed in and the
* toClass is non-primitive.</p>
*
* <p>Specifically, this method tests whether the type represented by the
* specified <code>Class</code> parameter can be converted to the type
* represented by this <code>Class</code> object via an identity conversion
* specified {@code Class} parameter can be converted to the type
* represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* <em><a href="http://java.sun.com/docs/books/jls/">The Java Language Specification</a></em>,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.</p>
@ -549,7 +549,7 @@ public static boolean isAssignable(Class<?> cls, Class<?> toClass) {
* @param cls the Class to check, may be null
* @param toClass the Class to try to assign into, returns false if null
* @param autoboxing whether to use implicit autoboxing/unboxing between primitives and wrappers
* @return <code>true</code> if assignment possible
* @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class<?> cls, Class<?> toClass, boolean autoboxing) {
if (toClass == null) {
@ -628,12 +628,12 @@ public static boolean isAssignable(Class<?> cls, Class<?> toClass, boolean autob
* <p>Converts the specified primitive Class object to its corresponding
* wrapper Class object.</p>
*
* <p>NOTE: From v2.2, this method handles <code>Void.TYPE</code>,
* returning <code>Void.TYPE</code>.</p>
* <p>NOTE: From v2.2, this method handles {@code Void.TYPE},
* returning {@code Void.TYPE}.</p>
*
* @param cls the class to convert, may be null
* @return the wrapper class for <code>cls</code> or <code>cls</code> if
* <code>cls</code> is not a primitive. <code>null</code> if null input.
* @return the wrapper class for {@code cls} or {@code cls} if
* {@code cls} is not a primitive. {@code null} if null input.
* @since 2.1
*/
public static Class<?> primitiveToWrapper(Class<?> cls) {
@ -650,7 +650,7 @@ public static Class<?> primitiveToWrapper(Class<?> cls) {
*
* @param classes the class array to convert, may be null or empty
* @return an array which contains for each given class, the wrapper class or
* the original class if class is not a primitive. <code>null</code> if null input.
* the original class if class is not a primitive. {@code null} if null input.
* Empty array if an empty array passed in.
* @since 2.1
*/
@ -674,14 +674,14 @@ public static Class<?>[] primitivesToWrappers(Class<?>[] classes) {
* <p>Converts the specified wrapper class to its corresponding primitive
* class.</p>
*
* <p>This method is the counter part of <code>primitiveToWrapper()</code>.
* <p>This method is the counter part of {@code primitiveToWrapper()}.
* If the passed in class is a wrapper class for a primitive type, this
* primitive type will be returned (e.g. <code>Integer.TYPE</code> for
* <code>Integer.class</code>). For other classes, or if the parameter is
* primitive type will be returned (e.g. {@code Integer.TYPE} for
* {@code Integer.class}). For other classes, or if the parameter is
* <b>null</b>, the return value is <b>null</b>.</p>
*
* @param cls the class to convert, may be <b>null</b>
* @return the corresponding primitive type if <code>cls</code> is a
* @return the corresponding primitive type if {@code cls} is a
* wrapper class, <b>null</b> otherwise
* @see #primitiveToWrapper(Class)
* @since 2.4
@ -694,12 +694,12 @@ public static Class<?> wrapperToPrimitive(Class<?> cls) {
* <p>Converts the specified array of wrapper Class objects to an array of
* its corresponding primitive Class objects.</p>
*
* <p>This method invokes <code>wrapperToPrimitive()</code> for each element
* <p>This method invokes {@code wrapperToPrimitive()} for each element
* of the passed in array.</p>
*
* @param classes the class array to convert, may be null or empty
* @return an array which contains for each given class, the primitive class or
* <b>null</b> if the original class is not a wrapper class. <code>null</code> if null input.
* <b>null</b> if the original class is not a wrapper class. {@code null} if null input.
* Empty array if an empty array passed in.
* @see #wrapperToPrimitive(Class)
* @since 2.4
@ -726,8 +726,8 @@ public static Class<?>[] wrappersToPrimitives(Class<?>[] classes) {
* <p>Is the specified class an inner class or static nested class.</p>
*
* @param cls the class to check, may be null
* @return <code>true</code> if the class is an inner or static nested class,
* false if not or <code>null</code>
* @return {@code true} if the class is an inner or static nested class,
* false if not or {@code null}
*/
public static boolean isInnerClass(Class<?> cls) {
return cls != null && cls.getEnclosingClass() != null;
@ -736,15 +736,15 @@ public static boolean isInnerClass(Class<?> cls) {
// Class loading
// ----------------------------------------------------------------------
/**
* Returns the class represented by <code>className</code> using the
* <code>classLoader</code>. This implementation supports the syntaxes
* "<code>java.util.Map.Entry[]</code>", "<code>java.util.Map$Entry[]</code>",
* "<code>[Ljava.util.Map.Entry;</code>", and "<code>[Ljava.util.Map$Entry;</code>".
* Returns the class represented by {@code className} using the
* {@code classLoader}. This implementation supports the syntaxes
* "{@code java.util.Map.Entry[]}", "{@code java.util.Map$Entry[]}",
* "{@code [Ljava.util.Map.Entry;}", and "{@code [Ljava.util.Map$Entry;}".
*
* @param classLoader the class loader to use to load the class
* @param className the class name
* @param initialize whether the class must be initialized
* @return the class represented by <code>className</code> using the <code>classLoader</code>
* @return the class represented by {@code className} using the {@code classLoader}
* @throws ClassNotFoundException if the class is not found
*/
public static Class<?> getClass(
@ -776,15 +776,15 @@ public static Class<?> getClass(
}
/**
* Returns the (initialized) class represented by <code>className</code>
* using the <code>classLoader</code>. This implementation supports
* the syntaxes "<code>java.util.Map.Entry[]</code>",
* "<code>java.util.Map$Entry[]</code>", "<code>[Ljava.util.Map.Entry;</code>",
* and "<code>[Ljava.util.Map$Entry;</code>".
* Returns the (initialized) class represented by {@code className}
* using the {@code classLoader}. This implementation supports
* the syntaxes "{@code java.util.Map.Entry[]}",
* "{@code java.util.Map$Entry[]}", "{@code [Ljava.util.Map.Entry;}",
* and "{@code [Ljava.util.Map$Entry;}".
*
* @param classLoader the class loader to use to load the class
* @param className the class name
* @return the class represented by <code>className</code> using the <code>classLoader</code>
* @return the class represented by {@code className} using the {@code classLoader}
* @throws ClassNotFoundException if the class is not found
*/
public static Class<?> getClass(ClassLoader classLoader, String className) throws ClassNotFoundException {
@ -792,14 +792,14 @@ public static Class<?> getClass(ClassLoader classLoader, String className) throw
}
/**
* Returns the (initialized) class represented by <code>className</code>
* Returns the (initialized) class represented by {@code className}
* using the current thread's context class loader. This implementation
* supports the syntaxes "<code>java.util.Map.Entry[]</code>",
* "<code>java.util.Map$Entry[]</code>", "<code>[Ljava.util.Map.Entry;</code>",
* and "<code>[Ljava.util.Map$Entry;</code>".
* supports the syntaxes "{@code java.util.Map.Entry[]}",
* "{@code java.util.Map$Entry[]}", "{@code [Ljava.util.Map.Entry;}",
* and "{@code [Ljava.util.Map$Entry;}".
*
* @param className the class name
* @return the class represented by <code>className</code> using the current thread's context class loader
* @return the class represented by {@code className} using the current thread's context class loader
* @throws ClassNotFoundException if the class is not found
*/
public static Class<?> getClass(String className) throws ClassNotFoundException {
@ -807,14 +807,14 @@ public static Class<?> getClass(String className) throws ClassNotFoundException
}
/**
* Returns the class represented by <code>className</code> using the
* Returns the class represented by {@code className} using the
* current thread's context class loader. This implementation supports the
* syntaxes "<code>java.util.Map.Entry[]</code>", "<code>java.util.Map$Entry[]</code>",
* "<code>[Ljava.util.Map.Entry;</code>", and "<code>[Ljava.util.Map$Entry;</code>".
* syntaxes "{@code java.util.Map.Entry[]}", "{@code java.util.Map$Entry[]}",
* "{@code [Ljava.util.Map.Entry;}", and "{@code [Ljava.util.Map$Entry;}".
*
* @param className the class name
* @param initialize whether the class must be initialized
* @return the class represented by <code>className</code> using the current thread's context class loader
* @return the class represented by {@code className} using the current thread's context class loader
* @throws ClassNotFoundException if the class is not found
*/
public static Class<?> getClass(String className, boolean initialize) throws ClassNotFoundException {
@ -826,7 +826,7 @@ public static Class<?> getClass(String className, boolean initialize) throws Cla
// Public method
// ----------------------------------------------------------------------
/**
* <p>Returns the desired Method much like <code>Class.getMethod</code>, however
* <p>Returns the desired Method much like {@code Class.getMethod}, however
* it ensures that the returned Method is from a public class or interface and not
* from an anonymous inner class. This means that the Method is invokable and
* doesn't fall foul of Java bug
@ -906,13 +906,13 @@ private static String toCanonicalName(String className) {
}
/**
* <p>Converts an array of <code>Object</code> in to an array of <code>Class</code> objects.
* <p>Converts an array of {@code Object} in to an array of {@code Class} objects.
* If any of these objects is null, a null element will be inserted into the array.</p>
*
* <p>This method returns <code>null</code> for a <code>null</code> input array.</p>
* <p>This method returns {@code null} for a {@code null} input array.</p>
*
* @param array an <code>Object</code> array
* @return a <code>Class</code> array, <code>null</code> if null array input
* @param array an {@code Object} array
* @return a {@code Class} array, {@code null} if null array input
* @since 2.4
*/
public static Class<?>[] toClass(Object[] array) {
@ -931,7 +931,7 @@ public static Class<?>[] toClass(Object[] array) {
// Short canonical name
// ----------------------------------------------------------------------
/**
* <p>Gets the canonical name minus the package name for an <code>Object</code>.</p>
* <p>Gets the canonical name minus the package name for an {@code Object}.</p>
*
* @param object the class to get the short name for, may be null
* @param valueIfNull the value to return if null
@ -946,7 +946,7 @@ public static String getShortCanonicalName(Object object, String valueIfNull) {
}
/**
* <p>Gets the canonical name minus the package name from a <code>Class</code>.</p>
* <p>Gets the canonical name minus the package name from a {@code Class}.</p>
*
* @param cls the class to get the short name for.
* @return the canonical name without the package name or an empty string
@ -975,7 +975,7 @@ public static String getShortCanonicalName(String canonicalName) {
// Package name
// ----------------------------------------------------------------------
/**
* <p>Gets the package name from the canonical name of an <code>Object</code>.</p>
* <p>Gets the package name from the canonical name of an {@code Object}.</p>
*
* @param object the class to get the package name for, may be null
* @param valueIfNull the value to return if null
@ -990,9 +990,9 @@ public static String getPackageCanonicalName(Object object, String valueIfNull)
}
/**
* <p>Gets the package name from the canonical name of a <code>Class</code>.</p>
* <p>Gets the package name from the canonical name of a {@code Class}.</p>
*
* @param cls the class to get the package name for, may be <code>null</code>.
* @param cls the class to get the package name for, may be {@code null}.
* @return the package name or an empty string
* @since 2.4
*/
@ -1009,7 +1009,7 @@ public static String getPackageCanonicalName(Class<?> cls) {
* <p>The string passed in is assumed to be a canonical name - it is not checked.</p>
* <p>If the class is unpackaged, return an empty string.</p>
*
* @param canonicalName the canonical name to get the package name for, may be <code>null</code>
* @param canonicalName the canonical name to get the package name for, may be {@code null}
* @return the package name or an empty string
* @since 2.4
*/
@ -1023,9 +1023,9 @@ public static String getPackageCanonicalName(String canonicalName) {
* unchanged name.</p>
* <p>Example:
* <ul>
* <li><code>getCanonicalName("[I") = "int[]"</code></li>
* <li><code>getCanonicalName("[Ljava.lang.String;") = "java.lang.String[]"</code></li>
* <li><code>getCanonicalName("java.lang.String") = "java.lang.String"</code></li>
* <li>{@code getCanonicalName("[I") = "int[]"}</li>
* <li>{@code getCanonicalName("[Ljava.lang.String;") = "java.lang.String[]"}</li>
* <li>{@code getCanonicalName("java.lang.String") = "java.lang.String"}</li>
* </ul>
* </p>
*

View File

@ -29,8 +29,8 @@
/**
* <p>Operations to assist when working with a {@link Locale}.</p>
*
* <p>This class tries to handle <code>null</code> input gracefully.
* An exception will not be thrown for a <code>null</code> input.
* <p>This class tries to handle {@code null} input gracefully.
* An exception will not be thrown for a {@code null} input.
* Each method documents its behaviour in more detail.</p>
*
* @author Apache Software Foundation
@ -48,8 +48,8 @@ public class LocaleUtils {
new ConcurrentHashMap<String, List<Locale>>();
/**
* <p><code>LocaleUtils</code> instances should NOT be constructed in standard programming.
* Instead, the class should be used as <code>LocaleUtils.toLocale("en_GB");</code>.</p>
* <p>{@code LocaleUtils} instances should NOT be constructed in standard programming.
* Instead, the class should be used as {@code LocaleUtils.toLocale("en_GB");}.</p>
*
* <p>This constructor is public to permit tools that require a JavaBean instance
* to operate.</p>

View File

@ -17,8 +17,9 @@
package org.apache.commons.lang3;
import java.util.Random;
/**
* <p>Operations for random <code>String</code>s.</p>
* <p>Operations for random {@code String}s.</p>
* <p>Currently <em>private high surrogate</em> characters are ignored.
* These are unicode characters that fall between the values 56192 (db80)
* and 56319 (dbff) as we don't know how to handle them.
@ -46,9 +47,9 @@ public class RandomStringUtils {
private static final Random RANDOM = new Random();
/**
* <p><code>RandomStringUtils</code> instances should NOT be constructed in
* <p>{@code RandomStringUtils} instances should NOT be constructed in
* standard programming. Instead, the class should be used as
* <code>RandomStringUtils.random(5);</code>.</p>
* {@code RandomStringUtils.random(5);}.</p>
*
* <p>This constructor is public to permit tools that require a JavaBean instance
* to operate.</p>
@ -77,7 +78,7 @@ public static String random(int count) {
* specified.</p>
*
* <p>Characters will be chosen from the set of characters whose
* ASCII value is between <code>32</code> and <code>126</code> (inclusive).</p>
* ASCII value is between {@code 32} and {@code 126} (inclusive).</p>
*
* @param count the length of random string to create
* @return the random string
@ -136,9 +137,9 @@ public static String randomNumeric(int count) {
* characters as indicated by the arguments.</p>
*
* @param count the length of random string to create
* @param letters if <code>true</code>, generated string will include
* @param letters if {@code true}, generated string will include
* alphabetic characters
* @param numbers if <code>true</code>, generated string will include
* @param numbers if {@code true}, generated string will include
* numeric characters
* @return the random string
*/
@ -156,9 +157,9 @@ public static String random(int count, boolean letters, boolean numbers) {
* @param count the length of random string to create
* @param start the position in set of chars to start at
* @param end the position in set of chars to end before
* @param letters if <code>true</code>, generated string will include
* @param letters if {@code true}, generated string will include
* alphabetic characters
* @param numbers if <code>true</code>, generated string will include
* @param numbers if {@code true}, generated string will include
* numeric characters
* @return the random string
*/
@ -181,10 +182,10 @@ public static String random(int count, int start, int end, boolean letters, bool
* @param letters only allow letters?
* @param numbers only allow numbers?
* @param chars the set of chars to choose randoms from.
* If <code>null</code>, then it will use the set of all chars.
* If {@code null}, then it will use the set of all chars.
* @return the random string
* @throws ArrayIndexOutOfBoundsException if there are not
* <code>(end - start) + 1</code> characters in the set array.
* {@code (end - start) + 1} characters in the set array.
*/
public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] chars) {
return random(count, start, end, letters, numbers, chars, RANDOM);
@ -194,13 +195,13 @@ public static String random(int count, int start, int end, boolean letters, bool
* <p>Creates a random string based on a variety of options, using
* supplied source of randomness.</p>
*
* <p>If start and end are both <code>0</code>, start and end are set
* to <code>' '</code> and <code>'z'</code>, the ASCII printable
* <p>If start and end are both {@code 0}, start and end are set
* to {@code ' '} and {@code 'z'}, the ASCII printable
* characters, will be used, unless letters and numbers are both
* <code>false</code>, in which case, start and end are set to
* <code>0</code> and <code>Integer.MAX_VALUE</code>.
* {@code false}, in which case, start and end are set to
* {@code 0} and {@code Integer.MAX_VALUE}.
*
* <p>If set is not <code>null</code>, characters between start and
* <p>If set is not {@code null}, characters between start and
* end are chosen.</p>
*
* <p>This method accepts a user-supplied {@link Random}
@ -215,12 +216,12 @@ public static String random(int count, int start, int end, boolean letters, bool
* @param letters only allow letters?
* @param numbers only allow numbers?
* @param chars the set of chars to choose randoms from.
* If <code>null</code>, then it will use the set of all chars.
* If {@code null}, then it will use the set of all chars.
* @param random a source of randomness.
* @return the random string
* @throws ArrayIndexOutOfBoundsException if there are not
* <code>(end - start) + 1</code> characters in the set array.
* @throws IllegalArgumentException if <code>count</code> &lt; 0.
* {@code (end - start) + 1} characters in the set array.
* @throws IllegalArgumentException if {@code count} &lt; 0.
* @since 2.0
*/
public static String random(int count, int start, int end, boolean letters, boolean numbers,
@ -294,7 +295,7 @@ public static String random(int count, int start, int end, boolean letters, bool
* @param chars the String containing the set of characters to use,
* may be null
* @return the random string
* @throws IllegalArgumentException if <code>count</code> &lt; 0.
* @throws IllegalArgumentException if {@code count} &lt; 0.
*/
public static String random(int count, String chars) {
if (chars == null) {
@ -313,7 +314,7 @@ public static String random(int count, String chars) {
* @param chars the character array containing the set of characters to use,
* may be null
* @return the random string
* @throws IllegalArgumentException if <code>count</code> &lt; 0.
* @throws IllegalArgumentException if {@code count} &lt; 0.
*/
public static String random(int count, char[] chars) {
if (chars == null) {

View File

@ -20,9 +20,9 @@
import java.util.Comparator;
/**
* <p><code>Range</code> represents an immutable range of comparables of the same type.</p>
* <p>The objects need to either be implementations of <code>java.lang.Comparable</code>
* or you need to supply a <code>java.util.Comparator</code>. </p>
* <p>{@code Range} represents an immutable range of comparables of the same type.</p>
* <p>The objects need to either be implementations of {@code java.lang.Comparable}
* or you need to supply a {@code java.util.Comparator}. </p>
*
* <p>#ThreadSafe# if the comparables are thread-safe</p>
* @author Apache Software Foundation
@ -64,14 +64,14 @@ public final class Range<T> implements Serializable {
private transient String toString = null;
/**
* <p>Constructs a new <code>Range</code> using the specified
* <p>Constructs a new {@code Range} using the specified
* element as both the minimum and maximum in this range.</p>
* <p>The range uses the natural ordering of the elements to
* determine where values lie in the range.</p>
*
* @param element the value to use for this range, must not be <code>null</code>
* @param element the value to use for this range, must not be {@code null}
* @return the new range object
* @throws IllegalArgumentException if the value is <code>null</code>
* @throws IllegalArgumentException if the value is {@code null}
* @throws ClassCastException if the value is not Comparable
*/
public static <T extends Comparable<T>> Range<T> is(T element) {
@ -79,7 +79,7 @@ public static <T extends Comparable<T>> Range<T> is(T element) {
}
/**
* <p>Constructs a new <code>Range</code> with the specified
* <p>Constructs a new {@code Range} with the specified
* minimum and maximum values (both inclusive).</p>
* <p>The range uses the natural ordering of the elements to
* determine where values lie in the range.</p>
@ -90,7 +90,7 @@ public static <T extends Comparable<T>> Range<T> is(T element) {
* @param element1 first value that defines the edge of the range, inclusive
* @param element2 second value that defines the edge of the range, inclusive
* @return the new range object
* @throws IllegalArgumentException if either value is <code>null</code>
* @throws IllegalArgumentException if either value is {@code null}
* @throws ClassCastException if either value is not Comparable
*/
public static <T extends Comparable<T>> Range<T> between(T element1, T element2) {
@ -98,24 +98,24 @@ public static <T extends Comparable<T>> Range<T> between(T element1, T element2)
}
/**
* <p>Constructs a new <code>Range</code> using the specified
* <p>Constructs a new {@code Range} using the specified
* element as both the minimum and maximum in this range.</p>
* <p>The range uses the passed in <code>Comparator</code> to
* <p>The range uses the passed in {@code Comparator} to
* determine where values lie in the range.</p>
*
* @param element the value to use for this range, must not be <code>null</code>
* @param element the value to use for this range, must not be {@code null}
* @param c comparator to be used
* @return the new range object
* @throws IllegalArgumentException if the value is <code>null</code>
* @throws IllegalArgumentException if the value is {@code null}
*/
public static <T> Range<T> is(T element, Comparator<T> c) {
return new Range<T>(element, element, c);
}
/**
* <p>Constructs a new <code>Range</code> with the specified
* <p>Constructs a new {@code Range} with the specified
* minimum and maximum values (both inclusive).</p>
* <p>The range uses the passed in <code>Comparator</code> to
* <p>The range uses the passed in {@code Comparator} to
* determine where values lie in the range.</p>
*
* <p>The arguments may be passed in the order (min,max) or (max,min). The
@ -125,7 +125,7 @@ public static <T> Range<T> is(T element, Comparator<T> c) {
* @param element2 second value that defines the edge of the range, inclusive
* @param c comparator to be used
* @return the new range object
* @throws IllegalArgumentException if either value is <code>null</code>
* @throws IllegalArgumentException if either value is {@code null}
*/
public static <T> Range<T> between(T element1, T element2, Comparator<T> c) {
return new Range<T>(element1, element2, c);
@ -197,10 +197,10 @@ public boolean isDefaultNaturalOrdering() {
/**
* <p>Tests whether the specified element occurs within this range.</p>
*
* <p><code>null</code> is handled and returns <code>false</code>.</p>
* <p>{@code null} is handled and returns {@code false}.</p>
*
* @param element the element to test, may be <code>null</code>
* @return <code>true</code> if the specified element occurs within this range
* @param element the element to test, may be {@code null}
* @return {@code true} if the specified element occurs within this range
*/
public boolean contains(T element) {
if(element == null) {
@ -212,10 +212,10 @@ public boolean contains(T element) {
/**
* <p>Tests whether the specified element occurs before this range.</p>
*
* <p><code>null</code> is handled and returns <code>false</code>.</p>
* <p>{@code null} is handled and returns {@code false}.</p>
*
* @param element the element to test, may be <code>null</code>
* @return <code>true</code> if the specified element occurs before this range
* @param element the element to test, may be {@code null}
* @return {@code true} if the specified element occurs before this range
*/
public boolean elementBefore(T element) {
if (element == null) {
@ -228,10 +228,10 @@ public boolean elementBefore(T element) {
/**
* <p>Tests whether the specified element occurs after this range.</p>
*
* <p><code>null</code> is handled and returns <code>false</code>.</p>
* <p>{@code null} is handled and returns {@code false}.</p>
*
* @param element the element to test, may be <code>null</code>
* @return <code>true</code> if the specified element occurs after this range
* @param element the element to test, may be {@code null}
* @return {@code true} if the specified element occurs after this range
*/
public boolean elementAfter(T element) {
if (element == null) {
@ -243,9 +243,9 @@ public boolean elementAfter(T element) {
/**
* <p>Tests where the specified element occurs relative to this range.</p>
* <p>The API is reminiscent of the Comparable interface returning <code>-1</code> if
* the element is before the range, <code>0</code> if contained within the range and
* <code>1</code> if the element is after the range. </p>
* <p>The API is reminiscent of the Comparable interface returning {@code -1} if
* the element is before the range, {@code 0} if contained within the range and
* {@code 1} if the element is after the range. </p>
*
* @param element the element to test
* @return -1, 0 or +1 depending on the element's location relative to the range
@ -271,12 +271,12 @@ public int elementCompareTo(T element) {
/**
* <p>Tests whether the specified range occurs entirely within this range.</p>
*
* <p><code>null</code> is handled and returns <code>false</code>.</p>
* <p>{@code null} is handled and returns {@code false}.</p>
*
* @param range the range to test, may be <code>null</code>
* @return <code>true</code> if the specified range occurs entirely within
* this range; otherwise, <code>false</code>
* @throws IllegalArgumentException if the <code>Range</code> cannot be compared
* @param range the range to test, may be {@code null}
* @return {@code true} if the specified range occurs entirely within
* this range; otherwise, {@code false}
* @throws IllegalArgumentException if the {@code Range} cannot be compared
*/
public boolean containsAll(Range<T> range) {
if (range == null) {
@ -289,12 +289,12 @@ public boolean containsAll(Range<T> range) {
/**
* <p>Tests whether the specified range overlaps with this range.</p>
*
* <p><code>null</code> is handled and returns <code>false</code>.</p>
* <p>{@code null} is handled and returns {@code false}.</p>
*
* @param range the range to test, may be <code>null</code>
* @return <code>true</code> if the specified range overlaps with this
* range; otherwise, <code>false</code>
* @throws IllegalArgumentException if the <code>Range</code> cannot be compared
* @param range the range to test, may be {@code null}
* @return {@code true} if the specified range overlaps with this
* range; otherwise, {@code false}
* @throws IllegalArgumentException if the {@code Range} cannot be compared
*/
public boolean overlapsWith(Range<T> range) {
if (range == null) {
@ -314,7 +314,7 @@ public boolean overlapsWith(Range<T> range) {
* <p>To be equal, the class, minimum and maximum must be equal.</p>
*
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
* @return {@code true} if this object is equal
*/
@Override
public boolean equals(Object obj) {
@ -349,11 +349,11 @@ public int hashCode() {
}
/**
* <p>Gets the range as a <code>String</code>.</p>
* <p>Gets the range as a {@code String}.</p>
*
* <p>The format of the String is 'Range[<i>min</i>,<i>max</i>]'.</p>
*
* @return the <code>String</code> representation of this range
* @return the {@code String} representation of this range
*/
@Override
public String toString() {

View File

@ -36,7 +36,7 @@ public class SerializationException extends RuntimeException {
private static final long serialVersionUID = 4029025366392702726L;
/**
* <p>Constructs a new <code>SerializationException</code> without specified
* <p>Constructs a new {@code SerializationException} without specified
* detail message.</p>
*/
public SerializationException() {
@ -44,7 +44,7 @@ public SerializationException() {
}
/**
* <p>Constructs a new <code>SerializationException</code> with specified
* <p>Constructs a new {@code SerializationException} with specified
* detail message.</p>
*
* @param msg The error message.
@ -54,10 +54,10 @@ public SerializationException(String msg) {
}
/**
* <p>Constructs a new <code>SerializationException</code> with specified
* nested <code>Throwable</code>.</p>
* <p>Constructs a new {@code SerializationException} with specified
* nested {@code Throwable}.</p>
*
* @param cause The <code>Exception</code> or <code>Error</code>
* @param cause The {@code Exception} or {@code Error}
* that caused this exception to be thrown.
*/
public SerializationException(Throwable cause) {
@ -65,11 +65,11 @@ public SerializationException(Throwable cause) {
}
/**
* <p>Constructs a new <code>SerializationException</code> with specified
* detail message and nested <code>Throwable</code>.</p>
* <p>Constructs a new {@code SerializationException} with specified
* detail message and nested {@code Throwable}.</p>
*
* @param msg The error message.
* @param cause The <code>Exception</code> or <code>Error</code>
* @param cause The {@code Exception} or {@code Error}
* that caused this exception to be thrown.
*/
public SerializationException(String msg, Throwable cause) {

View File

@ -35,7 +35,7 @@
* <li>Deserialize managing finally and IOException
* </ul>
*
* <p>This class throws exceptions for invalid <code>null</code> inputs.
* <p>This class throws exceptions for invalid {@code null} inputs.
* Each method documents its behaviour in more detail.</p>
*
* <p>#ThreadSafe#</p>
@ -52,7 +52,7 @@ public class SerializationUtils {
/**
* <p>SerializationUtils instances should NOT be constructed in standard programming.
* Instead, the class should be used as <code>SerializationUtils.clone(object)</code>.</p>
* Instead, the class should be used as {@code SerializationUtils.clone(object)}.</p>
*
* <p>This constructor is public to permit tools that require a JavaBean instance
* to operate.</p>
@ -65,15 +65,15 @@ public SerializationUtils() {
// Clone
//-----------------------------------------------------------------------
/**
* <p>Deep clone an <code>Object</code> using serialization.</p>
* <p>Deep clone an {@code Object} using serialization.</p>
*
* <p>This is many times slower than writing clone methods by hand
* on all objects in your object graph. However, for complex object
* graphs, or for those that don't support deep cloning this can
* be a simple alternative implementation. Of course all the objects
* must be <code>Serializable</code>.</p>
* must be {@code Serializable}.</p>
*
* @param object the <code>Serializable</code> object to clone
* @param object the {@code Serializable} object to clone
* @return the cloned object
* @throws SerializationException (runtime) if the serialization fails
*/
@ -91,7 +91,7 @@ public static <T extends Serializable> T clone(T object) {
// Serialize
//-----------------------------------------------------------------------
/**
* <p>Serializes an <code>Object</code> to the specified stream.</p>
* <p>Serializes an {@code Object} to the specified stream.</p>
*
* <p>The stream will be closed once the object is written.
* This avoids the need for a finally clause, and maybe also exception
@ -102,7 +102,7 @@ public static <T extends Serializable> T clone(T object) {
*
* @param obj the object to serialize to bytes, may be null
* @param outputStream the stream to write to, must not be null
* @throws IllegalArgumentException if <code>outputStream</code> is <code>null</code>
* @throws IllegalArgumentException if {@code outputStream} is {@code null}
* @throws SerializationException (runtime) if the serialization fails
*/
public static void serialize(Serializable obj, OutputStream outputStream) {
@ -129,7 +129,7 @@ public static void serialize(Serializable obj, OutputStream outputStream) {
}
/**
* <p>Serializes an <code>Object</code> to a byte array for
* <p>Serializes an {@code Object} to a byte array for
* storage/serialization.</p>
*
* @param obj the object to serialize to bytes
@ -145,7 +145,7 @@ public static byte[] serialize(Serializable obj) {
// Deserialize
//-----------------------------------------------------------------------
/**
* <p>Deserializes an <code>Object</code> from the specified stream.</p>
* <p>Deserializes an {@code Object} from the specified stream.</p>
*
* <p>The stream will be closed once the object is written. This
* avoids the need for a finally clause, and maybe also exception
@ -156,7 +156,7 @@ public static byte[] serialize(Serializable obj) {
*
* @param inputStream the serialized object input stream, must not be null
* @return the deserialized object
* @throws IllegalArgumentException if <code>inputStream</code> is <code>null</code>
* @throws IllegalArgumentException if {@code inputStream} is {@code null}
* @throws SerializationException (runtime) if the serialization fails
*/
public static Object deserialize(InputStream inputStream) {
@ -185,11 +185,11 @@ public static Object deserialize(InputStream inputStream) {
}
/**
* <p>Deserializes a single <code>Object</code> from an array of bytes.</p>
* <p>Deserializes a single {@code Object} from an array of bytes.</p>
*
* @param objectData the serialized object, must not be null
* @return the deserialized object
* @throws IllegalArgumentException if <code>objectData</code> is <code>null</code>
* @throws IllegalArgumentException if {@code objectData} is {@code null}
* @throws SerializationException (runtime) if the serialization fails
*/
public static Object deserialize(byte[] objectData) {

View File

@ -29,7 +29,7 @@
import org.apache.commons.lang3.text.translate.UnicodeUnescaper;
/**
* <p>Escapes and unescapes <code>String</code>s for
* <p>Escapes and unescapes {@code String}s for
* Java, Java Script, HTML and XML.</p>
*
* <p>#ThreadSafe#</p>
@ -203,7 +203,7 @@ public int translate(CharSequence input, int index, Writer out) throws IOExcepti
/* Helper functions */
/**
* <p><code>StringEscapeUtils</code> instances should NOT be constructed in
* <p>{@code StringEscapeUtils} instances should NOT be constructed in
* standard programming.</p>
*
* <p>Instead, the class should be used as:
@ -219,12 +219,12 @@ public StringEscapeUtils() {
// Java and JavaScript
//--------------------------------------------------------------------------
/**
* <p>Escapes the characters in a <code>String</code> using Java String rules.</p>
* <p>Escapes the characters in a {@code String} using Java String rules.</p>
*
* <p>Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) </p>
*
* <p>So a tab becomes the characters <code>'\\'</code> and
* <code>'t'</code>.</p>
* <p>So a tab becomes the characters {@code '\\'} and
* {@code 't'}.</p>
*
* <p>The only difference between Java strings and JavaScript strings
* is that in JavaScript, a single quote and forward-slash (/) are escaped.</p>
@ -237,19 +237,19 @@ public StringEscapeUtils() {
* </p>
*
* @param input String to escape values in, may be null
* @return String with escaped values, <code>null</code> if null string input
* @return String with escaped values, {@code null} if null string input
*/
public static final String escapeJava(String input) {
return ESCAPE_JAVA.translate(input);
}
/**
* <p>Escapes the characters in a <code>String</code> using EcmaScript String rules.</p>
* <p>Escapes the characters in a {@code String} using EcmaScript String rules.</p>
* <p>Escapes any values it finds into their EcmaScript String form.
* Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) </p>
*
* <p>So a tab becomes the characters <code>'\\'</code> and
* <code>'t'</code>.</p>
* <p>So a tab becomes the characters {@code '\\'} and
* {@code 't'}.</p>
*
* <p>The only difference between Java strings and EcmaScript strings
* is that in EcmaScript, a single quote and forward-slash (/) are escaped.</p>
@ -264,35 +264,35 @@ public static final String escapeJava(String input) {
* </p>
*
* @param input String to escape values in, may be null
* @return String with escaped values, <code>null</code> if null string input
* @return String with escaped values, {@code null} if null string input
*/
public static final String escapeEcmaScript(String input) {
return ESCAPE_ECMASCRIPT.translate(input);
}
/**
* <p>Unescapes any Java literals found in the <code>String</code>.
* For example, it will turn a sequence of <code>'\'</code> and
* <code>'n'</code> into a newline character, unless the <code>'\'</code>
* is preceded by another <code>'\'</code>.</p>
* <p>Unescapes any Java literals found in the {@code String}.
* For example, it will turn a sequence of {@code '\'} and
* {@code 'n'} into a newline character, unless the {@code '\'}
* is preceded by another {@code '\'}.</p>
*
* @param input the <code>String</code> to unescape, may be null
* @return a new unescaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to unescape, may be null
* @return a new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeJava(String input) {
return UNESCAPE_JAVA.translate(input);
}
/**
* <p>Unescapes any EcmaScript literals found in the <code>String</code>.</p>
* <p>Unescapes any EcmaScript literals found in the {@code String}.</p>
*
* <p>For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code>
* into a newline character, unless the <code>'\'</code> is preceded by another
* <code>'\'</code>.</p>
* <p>For example, it will turn a sequence of {@code '\'} and {@code 'n'}
* into a newline character, unless the {@code '\'} is preceded by another
* {@code '\'}.</p>
*
* @see #unescapeJava(String)
* @param input the <code>String</code> to unescape, may be null
* @return A new unescaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to unescape, may be null
* @return A new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeEcmaScript(String input) {
return UNESCAPE_ECMASCRIPT.translate(input);
@ -301,7 +301,7 @@ public static final String unescapeEcmaScript(String input) {
// HTML and XML
//--------------------------------------------------------------------------
/**
* <p>Escapes the characters in a <code>String</code> using HTML entities.</p>
* <p>Escapes the characters in a {@code String} using HTML entities.</p>
*
* <p>
* For example:
@ -316,8 +316,8 @@ public static final String unescapeEcmaScript(String input) {
* Note that the commonly used apostrophe escape character (&amp;apos;)
* is not a legal entity and so is not supported). </p>
*
* @param input the <code>String</code> to escape, may be null
* @return a new escaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to escape, may be null
* @return a new escaped {@code String}, {@code null} if null string input
*
* @see <a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/">ISO Entities</a>
* @see <a href="http://www.w3.org/TR/REC-html32#latin1">HTML 3.2 Character Entities for ISO Latin-1</a>
@ -330,11 +330,11 @@ public static final String escapeHtml4(String input) {
}
/**
* <p>Escapes the characters in a <code>String</code> using HTML entities.</p>
* <p>Escapes the characters in a {@code String} using HTML entities.</p>
* <p>Supports only the HTML 3.0 entities. </p>
*
* @param input the <code>String</code> to escape, may be null
* @return a new escaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to escape, may be null
* @return a new escaped {@code String}, {@code null} if null string input
*
*/
public static final String escapeHtml3(String input) {
@ -354,8 +354,8 @@ public static final String escapeHtml3(String input) {
* verbatim into the result string. e.g. "&amp;gt;&amp;zzzz;x" will
* become "&gt;&amp;zzzz;x".</p>
*
* @param input the <code>String</code> to unescape, may be null
* @return a new unescaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to unescape, may be null
* @return a new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeHtml4(String input) {
return UNESCAPE_HTML4.translate(input);
@ -366,8 +366,8 @@ public static final String unescapeHtml4(String input) {
* containing the actual Unicode characters corresponding to the
* escapes. Supports only HTML 3.0 entities.</p>
*
* @param input the <code>String</code> to unescape, may be null
* @return a new unescaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to unescape, may be null
* @return a new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeHtml3(String input) {
return UNESCAPE_HTML3.translate(input);
@ -375,7 +375,7 @@ public static final String unescapeHtml3(String input) {
//-----------------------------------------------------------------------
/**
* <p>Escapes the characters in a <code>String</code> using XML entities.</p>
* <p>Escapes the characters in a {@code String} using XML entities.</p>
*
* <p>For example: <tt>"bread" & "butter"</tt> =>
* <tt>&amp;quot;bread&amp;quot; &amp;amp; &amp;quot;butter&amp;quot;</tt>.
@ -387,8 +387,8 @@ public static final String unescapeHtml3(String input) {
* <p>Note that unicode characters greater than 0x7f are as of 3.0, no longer
* escaped. </p>
*
* @param input the <code>String</code> to escape, may be null
* @return a new escaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to escape, may be null
* @return a new escaped {@code String}, {@code null} if null string input
* @see #unescapeXml(java.lang.String)
*/
public static final String escapeXml(String input) {
@ -408,8 +408,8 @@ public static final String escapeXml(String input) {
* <p>Note that numerical \\u unicode codes are unescaped to their respective
* unicode characters. This may change in future releases. </p>
*
* @param input the <code>String</code> to unescape, may be null
* @return a new unescaped <code>String</code>, <code>null</code> if null string input
* @param input the {@code String} to unescape, may be null
* @return a new unescaped {@code String}, {@code null} if null string input
* @see #escapeXml(String)
*/
public static final String unescapeXml(String input) {
@ -420,7 +420,7 @@ public static final String unescapeXml(String input) {
//-----------------------------------------------------------------------
/**
* <p>Returns a <code>String</code> value for a CSV column enclosed in double quotes,
* <p>Returns a {@code String} value for a CSV column enclosed in double quotes,
* if required.</p>
*
* <p>If the value contains a comma, newline or double quote, then the
@ -438,7 +438,7 @@ public static final String unescapeXml(String input) {
*
* @param input the input CSV column String, may be null
* @return the input String, enclosed in double quotes if the value contains a comma,
* newline or double quote, <code>null</code> if null string input
* newline or double quote, {@code null} if null string input
* @since 2.4
*/
public static final String escapeCsv(String input) {
@ -446,7 +446,7 @@ public static final String escapeCsv(String input) {
}
/**
* <p>Returns a <code>String</code> value for an unescaped CSV column. </p>
* <p>Returns a {@code String} value for an unescaped CSV column. </p>
*
* <p>If the value is enclosed in double quotes, and contains a comma, newline
* or double quote, then quotes are removed.
@ -464,7 +464,7 @@ public static final String escapeCsv(String input) {
*
* @param input the input CSV column String, may be null
* @return the input String, with enclosing double quotes removed and embedded double
* quotes unescaped, <code>null</code> if null string input
* quotes unescaped, {@code null} if null string input
* @since 2.4
*/
public static final String unescapeCsv(String input) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -25,8 +25,8 @@
* <p>This class assists in validating arguments. The validation methods are
* based along the following principles:
* <ul>
* <li>An invalid <code>null</code> argument causes a {@link NullPointerException}.</li>
* <li>A non-<code>null</code> argument causes an {@link IllegalArgumentException}.</li>
* <li>An invalid {@code null} argument causes a {@link NullPointerException}.</li>
* <li>A non-{@code null} argument causes an {@link IllegalArgumentException}.</li>
* <li>An invalid index into an array/collection/map/string causes an {@link IndexOutOfBoundsException}.</li>
* </ul>
*
@ -80,7 +80,7 @@ public Validate() {
//---------------------------------------------------------------------------------
/**
* <p>Validate that the argument condition is <code>true</code>; otherwise
* <p>Validate that the argument condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.</p>
@ -93,7 +93,7 @@ public Validate() {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param value the value to append to the message when invalid
* @throws IllegalArgumentException if expression is <code>false</code>
* @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean)
* @see #isTrue(boolean, String, double)
* @see #isTrue(boolean, String, Object...)
@ -105,7 +105,7 @@ public static void isTrue(boolean expression, String message, long value) {
}
/**
* <p>Validate that the argument condition is <code>true</code>; otherwise
* <p>Validate that the argument condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.</p>
@ -118,7 +118,7 @@ public static void isTrue(boolean expression, String message, long value) {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param value the value to append to the message when invalid
* @throws IllegalArgumentException if expression is <code>false</code>
* @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean)
* @see #isTrue(boolean, String, long)
* @see #isTrue(boolean, String, Object...)
@ -130,7 +130,7 @@ public static void isTrue(boolean expression, String message, double value) {
}
/**
* <p>Validate that the argument condition is <code>true</code>; otherwise
* <p>Validate that the argument condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.</p>
@ -142,7 +142,7 @@ public static void isTrue(boolean expression, String message, double value) {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @throws IllegalArgumentException if expression is <code>false</code>
* @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean)
* @see #isTrue(boolean, String, long)
* @see #isTrue(boolean, String, double)
@ -154,7 +154,7 @@ public static void isTrue(boolean expression, String message, Object... values)
}
/**
* <p>Validate that the argument condition is <code>true</code>; otherwise
* <p>Validate that the argument condition is {@code true}; otherwise
* throwing an exception. This method is useful when validating according
* to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.</p>
@ -167,7 +167,7 @@ public static void isTrue(boolean expression, String message, Object... values)
* false&quot;.</p>
*
* @param expression the boolean expression to check
* @throws IllegalArgumentException if expression is <code>false</code>
* @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean, String, long)
* @see #isTrue(boolean, String, double)
* @see #isTrue(boolean, String, Object...)
@ -182,7 +182,7 @@ public static void isTrue(boolean expression) {
//---------------------------------------------------------------------------------
/**
* <p>Validate that the specified argument is not <code>null</code>;
* <p>Validate that the specified argument is not {@code null};
* otherwise throwing an exception.
*
* <pre>Validate.notNull(myObject, "The object must not be null");</pre>
@ -192,8 +192,8 @@ public static void isTrue(boolean expression) {
*
* @param <T> the object type
* @param object the object to check
* @return the validated object (never <code>null</code> for method chaining)
* @throws NullPointerException if the object is <code>null</code>
* @return the validated object (never {@code null} for method chaining)
* @throws NullPointerException if the object is {@code null}
* @see #notNull(Object, String, Object...)
*/
public static <T> T notNull(T object) {
@ -201,7 +201,7 @@ public static <T> T notNull(T object) {
}
/**
* <p>Validate that the specified argument is not <code>null</code>;
* <p>Validate that the specified argument is not {@code null};
* otherwise throwing an exception with the specified message.
*
* <pre>Validate.notNull(myObject, "The object must not be null");</pre>
@ -210,8 +210,8 @@ public static <T> T notNull(T object) {
* @param object the object to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message
* @return the validated object (never <code>null</code> for method chaining)
* @throws NullPointerException if the object is <code>null</code>
* @return the validated object (never {@code null} for method chaining)
* @throws NullPointerException if the object is {@code null}
* @see #notNull(Object)
*/
public static <T> T notNull(T object, String message, Object... values) {
@ -225,7 +225,7 @@ public static <T> T notNull(T object, String message, Object... values) {
//---------------------------------------------------------------------------------
/**
* <p>Validate that the specified argument array is neither <code>null</code>
* <p>Validate that the specified argument array is neither {@code null}
* nor a length of zero (no elements); otherwise throwing an exception
* with the specified message.
*
@ -235,8 +235,8 @@ public static <T> T notNull(T object, String message, Object... values) {
* @param array the array to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated array (never <code>null</code> method for chaining)
* @throws NullPointerException if the array is <code>null</code>
* @return the validated array (never {@code null} method for chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if the array is empty
* @see #notEmpty(Object[])
*/
@ -251,7 +251,7 @@ public static <T> T[] notEmpty(T[] array, String message, Object... values) {
}
/**
* <p>Validate that the specified argument array is neither <code>null</code>
* <p>Validate that the specified argument array is neither {@code null}
* nor a length of zero (no elements); otherwise throwing an exception.
*
* <pre>Validate.notEmpty(myArray);</pre>
@ -261,8 +261,8 @@ public static <T> T[] notEmpty(T[] array, String message, Object... values) {
*
* @param <T> the array type
* @param array the array to check, validated not null by this method
* @return the validated array (never <code>null</code> method for chaining)
* @throws NullPointerException if the array is <code>null</code>
* @return the validated array (never {@code null} method for chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if the array is empty
* @see #notEmpty(Object[], String, Object...)
*/
@ -274,7 +274,7 @@ public static <T> T[] notEmpty(T[] array) {
//---------------------------------------------------------------------------------
/**
* <p>Validate that the specified argument collection is neither <code>null</code>
* <p>Validate that the specified argument collection is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception
* with the specified message.
*
@ -284,8 +284,8 @@ public static <T> T[] notEmpty(T[] array) {
* @param collection the collection to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated collection (never <code>null</code> method for chaining)
* @throws NullPointerException if the collection is <code>null</code>
* @return the validated collection (never {@code null} method for chaining)
* @throws NullPointerException if the collection is {@code null}
* @throws IllegalArgumentException if the collection is empty
* @see #notEmpty(Object[])
*/
@ -300,7 +300,7 @@ public static <T extends Collection<?>> T notEmpty(T collection, String message,
}
/**
* <p>Validate that the specified argument collection is neither <code>null</code>
* <p>Validate that the specified argument collection is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception.
*
* <pre>Validate.notEmpty(myCollection);</pre>
@ -310,8 +310,8 @@ public static <T extends Collection<?>> T notEmpty(T collection, String message,
*
* @param <T> the collection type
* @param collection the collection to check, validated not null by this method
* @return the validated collection (never <code>null</code> method for chaining)
* @throws NullPointerException if the collection is <code>null</code>
* @return the validated collection (never {@code null} method for chaining)
* @throws NullPointerException if the collection is {@code null}
* @throws IllegalArgumentException if the collection is empty
* @see #notEmpty(Collection, String, Object...)
*/
@ -323,7 +323,7 @@ public static <T extends Collection<?>> T notEmpty(T collection) {
//---------------------------------------------------------------------------------
/**
* <p>Validate that the specified argument map is neither <code>null</code>
* <p>Validate that the specified argument map is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception
* with the specified message.
*
@ -333,8 +333,8 @@ public static <T extends Collection<?>> T notEmpty(T collection) {
* @param map the map to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated map (never <code>null</code> method for chaining)
* @throws NullPointerException if the map is <code>null</code>
* @return the validated map (never {@code null} method for chaining)
* @throws NullPointerException if the map is {@code null}
* @throws IllegalArgumentException if the map is empty
* @see #notEmpty(Object[])
*/
@ -349,7 +349,7 @@ public static <T extends Collection<?>> T notEmpty(T collection) {
}
/**
* <p>Validate that the specified argument map is neither <code>null</code>
* <p>Validate that the specified argument map is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception.
*
* <pre>Validate.notEmpty(myMap);</pre>
@ -359,8 +359,8 @@ public static <T extends Collection<?>> T notEmpty(T collection) {
*
* @param <T> the map type
* @param map the map to check, validated not null by this method
* @return the validated map (never <code>null</code> method for chaining)
* @throws NullPointerException if the map is <code>null</code>
* @return the validated map (never {@code null} method for chaining)
* @throws NullPointerException if the map is {@code null}
* @throws IllegalArgumentException if the map is empty
* @see #notEmpty(Map, String, Object...)
*/
@ -373,7 +373,7 @@ public static <T extends Collection<?>> T notEmpty(T collection) {
/**
* <p>Validate that the specified argument character sequence is
* neither <code>null</code> nor a length of zero (no characters);
* neither {@code null} nor a length of zero (no characters);
* otherwise throwing an exception with the specified message.
*
* <pre>Validate.notEmpty(myString, "The string must not be empty");</pre>
@ -382,8 +382,8 @@ public static <T extends Collection<?>> T notEmpty(T collection) {
* @param chars the character sequence to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated character sequence (never <code>null</code> method for chaining)
* @throws NullPointerException if the character sequence is <code>null</code>
* @return the validated character sequence (never {@code null} method for chaining)
* @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is empty
* @see #notEmpty(CharSequence)
*/
@ -399,7 +399,7 @@ public static <T extends CharSequence> T notEmpty(T chars, String message, Objec
/**
* <p>Validate that the specified argument character sequence is
* neither <code>null</code> nor a length of zero (no characters);
* neither {@code null} nor a length of zero (no characters);
* otherwise throwing an exception with the specified message.
*
* <pre>Validate.notEmpty(myString);</pre>
@ -409,8 +409,8 @@ public static <T extends CharSequence> T notEmpty(T chars, String message, Objec
*
* @param <T> the character sequence type
* @param chars the character sequence to check, validated not null by this method
* @return the validated character sequence (never <code>null</code> method for chaining)
* @throws NullPointerException if the character sequence is <code>null</code>
* @return the validated character sequence (never {@code null} method for chaining)
* @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is empty
* @see #notEmpty(CharSequence, String, Object...)
*/
@ -423,7 +423,7 @@ public static <T extends CharSequence> T notEmpty(T chars) {
/**
* <p>Validate that the specified argument character sequence is
* neither <code>null</code>, a length of zero (no characters), empty
* neither {@code null}, a length of zero (no characters), empty
* nor whitespace; otherwise throwing an exception with the specified
* message.
*
@ -433,8 +433,8 @@ public static <T extends CharSequence> T notEmpty(T chars) {
* @param chars the character sequence to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated character sequence (never <code>null</code> method for chaining)
* @throws NullPointerException if the character sequence is <code>null</code>
* @return the validated character sequence (never {@code null} method for chaining)
* @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is blank
* @see #notBlank(CharSequence)
*/
@ -450,7 +450,7 @@ public static <T extends CharSequence> T notBlank(T chars, String message, Objec
/**
* <p>Validate that the specified argument character sequence is
* neither <code>null</code>, a length of zero (no characters), empty
* neither {@code null}, a length of zero (no characters), empty
* nor whitespace; otherwise throwing an exception.
*
* <pre>Validate.notBlank(myString);</pre>
@ -460,8 +460,8 @@ public static <T extends CharSequence> T notBlank(T chars, String message, Objec
*
* @param <T> the character sequence type
* @param chars the character sequence to check, validated not null by this method
* @return the validated character sequence (never <code>null</code> method for chaining)
* @throws NullPointerException if the character sequence is <code>null</code>
* @return the validated character sequence (never {@code null} method for chaining)
* @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is blank
* @see #notBlank(CharSequence, String, Object...)
*/
@ -474,25 +474,25 @@ public static <T extends CharSequence> T notBlank(T chars) {
/**
* <p>Validate that the specified argument array is neither
* <code>null</code> nor contains any elements that are <code>null</code>;
* {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception with the specified message.
*
* <pre>Validate.noNullElements(myArray, "The array contain null at position %d");</pre>
*
* <p>If the array is <code>null</code>, then the message in the exception
* <p>If the array is {@code null}, then the message in the exception
* is &quot;The validated object is null&quot;.</p>
*
* <p>If the array has a <code>null</code> element, then the iteration
* index of the invalid element is appended to the <code>values</code>
* <p>If the array has a {@code null} element, then the iteration
* index of the invalid element is appended to the {@code values}
* argument.</p>
*
* @param <T> the array type
* @param array the array to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated array (never <code>null</code> method for chaining)
* @throws NullPointerException if the array is <code>null</code>
* @throws IllegalArgumentException if an element is <code>null</code>
* @return the validated array (never {@code null} method for chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Object[])
*/
public static <T> T[] noNullElements(T[] array, String message, Object... values) {
@ -508,23 +508,23 @@ public static <T> T[] noNullElements(T[] array, String message, Object... values
/**
* <p>Validate that the specified argument array is neither
* <code>null</code> nor contains any elements that are <code>null</code>;
* {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception.
*
* <pre>Validate.noNullElements(myArray);</pre>
*
* <p>If the array is <code>null</code>, then the message in the exception
* <p>If the array is {@code null}, then the message in the exception
* is &quot;The validated object is null&quot;.</p>
*
* <p>If the array has a <code>null</code> element, then the message in the
* <p>If the array has a {@code null} element, then the message in the
* exception is &quot;The validated array contains null element at index:
* &quot followed by the index.</p>
*
* @param <T> the array type
* @param array the array to check, validated not null by this method
* @return the validated array (never <code>null</code> method for chaining)
* @throws NullPointerException if the array is <code>null</code>
* @throws IllegalArgumentException if an element is <code>null</code>
* @return the validated array (never {@code null} method for chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Object[], String, Object...)
*/
public static <T> T[] noNullElements(T[] array) {
@ -536,25 +536,25 @@ public static <T> T[] noNullElements(T[] array) {
/**
* <p>Validate that the specified argument iterable is neither
* <code>null</code> nor contains any elements that are <code>null</code>;
* {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception with the specified message.
*
* <pre>Validate.noNullElements(myCollection, "The collection contains null at position %d");</pre>
*
* <p>If the iterable is <code>null</code>, then the message in the exception
* <p>If the iterable is {@code null}, then the message in the exception
* is &quot;The validated object is null&quot;.</p>
*
* <p>If the iterable has a <code>null</code> element, then the iteration
* index of the invalid element is appended to the <code>values</code>
* <p>If the iterable has a {@code null} element, then the iteration
* index of the invalid element is appended to the {@code values}
* argument.</p>
*
* @param <T> the iterable type
* @param iterable the iterable to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated iterable (never <code>null</code> method for chaining)
* @throws NullPointerException if the array is <code>null</code>
* @throws IllegalArgumentException if an element is <code>null</code>
* @return the validated iterable (never {@code null} method for chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Iterable)
*/
public static <T extends Iterable<?>> T noNullElements(T iterable, String message, Object... values) {
@ -571,23 +571,23 @@ public static <T extends Iterable<?>> T noNullElements(T iterable, String messag
/**
* <p>Validate that the specified argument iterable is neither
* <code>null</code> nor contains any elements that are <code>null</code>;
* {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception.
*
* <pre>Validate.noNullElements(myCollection);</pre>
*
* <p>If the iterable is <code>null</code>, then the message in the exception
* <p>If the iterable is {@code null}, then the message in the exception
* is &quot;The validated object is null&quot;.</p>
*
* <p>If the array has a <code>null</code> element, then the message in the
* <p>If the array has a {@code null} element, then the message in the
* exception is &quot;The validated iterable contains null element at index:
* &quot followed by the index.</p>
*
* @param <T> the iterable type
* @param iterable the iterable to check, validated not null by this method
* @return the validated iterable (never <code>null</code> method for chaining)
* @throws NullPointerException if the array is <code>null</code>
* @throws IllegalArgumentException if an element is <code>null</code>
* @return the validated iterable (never {@code null} method for chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Iterable, String, Object...)
*/
public static <T extends Iterable<?>> T noNullElements(T iterable) {
@ -603,7 +603,7 @@ public static <T extends Iterable<?>> T noNullElements(T iterable) {
*
* <pre>Validate.validIndex(myArray, 2, "The array index is invalid: ");</pre>
*
* <p>If the array is <code>null</code>, then the message of the exception
* <p>If the array is {@code null}, then the message of the exception
* is &quot;The validated object is null&quot;.</p>
*
* @param <T> the array type
@ -611,8 +611,8 @@ public static <T extends Iterable<?>> T noNullElements(T iterable) {
* @param index the index to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated array (never <code>null</code> for method chaining)
* @throws NullPointerException if the array is <code>null</code>
* @return the validated array (never {@code null} for method chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Object[], int)
*/
@ -630,7 +630,7 @@ public static <T> T[] validIndex(T[] array, int index, String message, Object...
*
* <pre>Validate.validIndex(myArray, 2);</pre>
*
* <p>If the array is <code>null</code>, then the message of the exception
* <p>If the array is {@code null}, then the message of the exception
* is &quot;The validated object is null&quot;.</p>
*
* <p>If the index is invalid, then the message of the exception is
@ -640,8 +640,8 @@ public static <T> T[] validIndex(T[] array, int index, String message, Object...
* @param <T> the array type
* @param array the array to check, validated not null by this method
* @param index the index to check
* @return the validated array (never <code>null</code> for method chaining)
* @throws NullPointerException if the array is <code>null</code>
* @return the validated array (never {@code null} for method chaining)
* @throws NullPointerException if the array is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Object[], int, String, Object...)
*/
@ -658,7 +658,7 @@ public static <T> T[] validIndex(T[] array, int index) {
*
* <pre>Validate.validIndex(myCollection, 2, "The collection index is invalid: ");</pre>
*
* <p>If the collection is <code>null</code>, then the message of the
* <p>If the collection is {@code null}, then the message of the
* exception is &quot;The validated object is null&quot;.</p>
*
* @param <T> the collection type
@ -666,8 +666,8 @@ public static <T> T[] validIndex(T[] array, int index) {
* @param index the index to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated collection (never <code>null</code> for chaining)
* @throws NullPointerException if the collection is <code>null</code>
* @return the validated collection (never {@code null} for chaining)
* @throws NullPointerException if the collection is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Collection, int)
*/
@ -692,8 +692,8 @@ public static <T extends Collection<?>> T validIndex(T collection, int index, St
* @param <T> the collection type
* @param collection the collection to check, validated not null by this method
* @param index the index to check
* @return the validated collection (never <code>null</code> for method chaining)
* @throws NullPointerException if the collection is <code>null</code>
* @return the validated collection (never {@code null} for method chaining)
* @throws NullPointerException if the collection is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Collection, int, String, Object...)
*/
@ -711,7 +711,7 @@ public static <T extends Collection<?>> T validIndex(T collection, int index) {
*
* <pre>Validate.validIndex(myStr, 2, "The string index is invalid: ");</pre>
*
* <p>If the character sequence is <code>null</code>, then the message
* <p>If the character sequence is {@code null}, then the message
* of the exception is &quot;The validated object is null&quot;.</p>
*
* @param <T> the character sequence type
@ -719,8 +719,8 @@ public static <T extends Collection<?>> T validIndex(T collection, int index) {
* @param index the index to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @return the validated character sequence (never <code>null</code> for method chaining)
* @throws NullPointerException if the character sequence is <code>null</code>
* @return the validated character sequence (never {@code null} for method chaining)
* @throws NullPointerException if the character sequence is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(CharSequence, int)
*/
@ -738,7 +738,7 @@ public static <T extends CharSequence> T validIndex(T chars, int index, String m
*
* <pre>Validate.validIndex(myStr, 2);</pre>
*
* <p>If the character sequence is <code>null</code>, then the message
* <p>If the character sequence is {@code null}, then the message
* of the exception is &quot;The validated object is
* null&quot;.</p>
*
@ -749,8 +749,8 @@ public static <T extends CharSequence> T validIndex(T chars, int index, String m
* @param <T> the character sequence type
* @param chars the character sequence to check, validated not null by this method
* @param index the index to check
* @return the validated character sequence (never <code>null</code> for method chaining)
* @throws NullPointerException if the character sequence is <code>null</code>
* @return the validated character sequence (never {@code null} for method chaining)
* @throws NullPointerException if the character sequence is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(CharSequence, int, String, Object...)
*/
@ -762,7 +762,7 @@ public static <T extends CharSequence> T validIndex(T chars, int index) {
//---------------------------------------------------------------------------------
/**
* <p>Validate that the stateful condition is <code>true</code>; otherwise
* <p>Validate that the stateful condition is {@code true}; otherwise
* throwing an exception. This method is useful when validating according
* to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.</p>
@ -775,7 +775,7 @@ public static <T extends CharSequence> T validIndex(T chars, int index) {
* false&quot;.</p>
*
* @param expression the boolean expression to check
* @throws IllegalStateException if expression is <code>false</code>
* @throws IllegalStateException if expression is {@code false}
* @see #validState(boolean, String, Object...)
*/
public static void validState(boolean expression) {
@ -785,7 +785,7 @@ public static void validState(boolean expression) {
}
/**
* <p>Validate that the stateful condition is <code>true</code>; otherwise
* <p>Validate that the stateful condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.</p>
@ -795,7 +795,7 @@ public static void validState(boolean expression) {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
* @throws IllegalStateException if expression is <code>false</code>
* @throws IllegalStateException if expression is {@code false}
* @see #validState(boolean)
*/
public static void validState(boolean expression, String message, Object... values) {

View File

@ -32,7 +32,7 @@
*
* <p>
* It is a recommended practice that the methods supplied to configure the
* object or result being built return a reference to <code>this</code> so that
* object or result being built return a reference to {@code this} so that
* method calls can be chained together.
* </p>
*