You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2012/01/05 18:45:52 UTC
svn commit: r1227719 [1/3] - in
/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator:
./ routines/ routines/checkdigit/ util/
Author: simonetripodi
Date: Thu Jan 5 17:45:51 2012
New Revision: 1227719
URL: http://svn.apache.org/viewvc?rev=1227719&view=rev
Log:
fixed findbugs violation: org.apache.commons.validator.* is Serializable; consider declaring a serialVersionUID
Modified:
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Arg.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Form.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/FormSet.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericTypeValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Msg.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/UrlValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Validator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorAction.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorException.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResources.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResult.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResults.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractFormatValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractNumberValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigDecimalValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigIntegerValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ByteValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CalendarValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CurrencyValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DateValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DoubleValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/FloatValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IntegerValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/LongValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/PercentValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/RegexValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ShortValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/TimeValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/CheckDigitException.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigit.java
commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/util/Flags.java
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Arg.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Arg.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Arg.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Arg.java Thu Jan 5 17:45:51 2012
@@ -37,6 +37,8 @@ import java.io.Serializable;
*/
public class Arg implements Cloneable, Serializable {
+ private static final long serialVersionUID = -8922606779669839294L;
+
/**
* The resource bundle name that this Arg's <code>key</code> should be
* resolved in (optional).
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java Thu Jan 5 17:45:51 2012
@@ -47,6 +47,8 @@ import org.apache.commons.validator.util
*/
public class Field implements Cloneable, Serializable {
+ private static final long serialVersionUID = -8502647722530192185L;
+
/**
* This is the value that will be used as a key if the <code>Arg</code>
* name field has no value.
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Form.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Form.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Form.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Form.java Thu Jan 5 17:45:51 2012
@@ -39,6 +39,8 @@ import org.apache.commons.collections.Fa
*/
public class Form implements Serializable {
+ private static final long serialVersionUID = 6445211789563796371L;
+
/** The name/key the set of validation rules is stored under. */
protected String name = null;
@@ -244,7 +246,7 @@ public class Form implements Serializabl
throws ValidatorException {
return validate(params, actions, page, null);
}
-
+
/**
* Validate all Fields in this Form on the given page and below.
*
@@ -268,12 +270,12 @@ public class Form implements Serializabl
// Only validate a single field if specified
if (fieldName != null) {
Field field = (Field) this.hFields.get(fieldName);
-
+
if (field == null) {
throw new ValidatorException("Unknown field "+fieldName+" in form "+getName());
}
params.put(Validator.FIELD_PARAM, field);
-
+
if (field.getPage() <= page) {
results.merge(field.validate(params, actions));
}
@@ -281,9 +283,9 @@ public class Form implements Serializabl
Iterator fields = this.lFields.iterator();
while (fields.hasNext()) {
Field field = (Field) fields.next();
-
+
params.put(Validator.FIELD_PARAM, field);
-
+
if (field.getPage() <= page) {
results.merge(field.validate(params, actions));
}
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/FormSet.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/FormSet.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/FormSet.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/FormSet.java Thu Jan 5 17:45:51 2012
@@ -35,6 +35,8 @@ import org.apache.commons.logging.LogFac
*/
public class FormSet implements Serializable {
+ private static final long serialVersionUID = -8936513232763306055L;
+
/** Logging */
private transient Log log = LogFactory.getLog(FormSet.class);
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericTypeValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericTypeValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericTypeValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericTypeValidator.java Thu Jan 5 17:45:51 2012
@@ -35,6 +35,8 @@ import org.apache.commons.logging.LogFac
*/
public class GenericTypeValidator implements Serializable {
+ private static final long serialVersionUID = 5487162314134261703L;
+
/**
* Checks if the value can safely be converted to a byte primitive.
*
@@ -375,9 +377,9 @@ public class GenericTypeValidator implem
DateFormat formatterShort = null;
DateFormat formatterDefault = null;
if (locale != null) {
- formatterShort =
+ formatterShort =
DateFormat.getDateInstance(DateFormat.SHORT, locale);
- formatterDefault =
+ formatterDefault =
DateFormat.getDateInstance(DateFormat.DEFAULT, locale);
} else {
formatterShort =
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/GenericValidator.java Thu Jan 5 17:45:51 2012
@@ -32,6 +32,8 @@ import org.apache.commons.validator.rout
*/
public class GenericValidator implements Serializable {
+ private static final long serialVersionUID = -7212095066891517618L;
+
/**
* UrlValidator used in wrapper method.
*/
@@ -44,7 +46,7 @@ public class GenericValidator implements
new CreditCardValidator();
/**
- * <p>Checks if the field isn't null and length of the field is greater
+ * <p>Checks if the field isn't null and length of the field is greater
* than zero not including whitespace.</p>
*
* @param value The value validation is being performed on.
@@ -135,7 +137,7 @@ public class GenericValidator implements
* is set to <code>false</code> for all.</p>
*
* @param value The value validation is being performed on.
- * @param locale The locale to use for the date format, defaults to the
+ * @param locale The locale to use for the date format, defaults to the
* system default if null.
* @return true if the value can be converted to a Date.
*/
@@ -339,7 +341,7 @@ public class GenericValidator implements
}
return ((nCount * lineEndLength) - (rCount + nCount));
}
-
+
// See http://issues.apache.org/bugzilla/show_bug.cgi?id=29015 WRT the "value" methods
/**
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Msg.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Msg.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Msg.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Msg.java Thu Jan 5 17:45:51 2012
@@ -28,6 +28,8 @@ import java.io.Serializable;
*/
public class Msg implements Cloneable, Serializable {
+ private static final long serialVersionUID = 5690015734364127124L;
+
/**
* The resource bundle name that this Msg's <code>key</code> should be
* resolved in (optional).
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/UrlValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/UrlValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/UrlValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/UrlValidator.java Thu Jan 5 17:45:51 2012
@@ -76,8 +76,10 @@ import org.apache.commons.validator.util
*/
public class UrlValidator implements Serializable {
+ private static final long serialVersionUID = 24137157400029593L;
+
/**
- * Allows all validly formatted schemes to pass validation instead of
+ * Allows all validly formatted schemes to pass validation instead of
* supplying a set of valid schemes.
*/
public static final int ALLOW_ALL_SCHEMES = 1 << 0;
@@ -313,7 +315,7 @@ public class UrlValidator implements Ser
InetAddressValidator inetAddressValidator =
InetAddressValidator.getInstance();
- Matcher authorityMatcher = AUTHORITY_PATTERN.matcher(authority);
+ Matcher authorityMatcher = AUTHORITY_PATTERN.matcher(authority);
if (!authorityMatcher.matches()) {
return false;
}
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Validator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Validator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Validator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Validator.java Thu Jan 5 17:45:51 2012
@@ -30,6 +30,8 @@ import java.util.Map;
*/
public class Validator implements Serializable {
+ private static final long serialVersionUID = -7119418755208731611L;
+
/**
* Resources key the JavaBean is stored to perform validation on.
*/
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorAction.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorAction.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorAction.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorAction.java Thu Jan 5 17:45:51 2012
@@ -36,7 +36,7 @@ import org.apache.commons.validator.util
/**
* Contains the information to dynamically create and run a validation
- * method. This is the class representation of a pluggable validator that can
+ * method. This is the class representation of a pluggable validator that can
* be defined in an xml file with the <validator> element.
*
* <strong>Note</strong>: The validation method is assumed to be thread safe.
@@ -44,7 +44,9 @@ import org.apache.commons.validator.util
* @version $Revision$ $Date$
*/
public class ValidatorAction implements Serializable {
-
+
+ private static final long serialVersionUID = 1339713700053204597L;
+
/**
* Logger.
*/
@@ -60,7 +62,7 @@ public class ValidatorAction implements
* the validation method associated with this action.
*/
private String classname = null;
-
+
/**
* The Class object loaded from the classname.
*/
@@ -71,7 +73,7 @@ public class ValidatorAction implements
* must be thread safe.
*/
private String method = null;
-
+
/**
* The Method object loaded from the method name.
*/
@@ -80,7 +82,7 @@ public class ValidatorAction implements
/**
* <p>
* The method signature of the validation method. This should be a comma
- * delimited list of the full class names of each parameter in the correct
+ * delimited list of the full class names of each parameter in the correct
* order that the method takes.
* </p>
* <p>
@@ -97,15 +99,15 @@ public class ValidatorAction implements
+ Validator.VALIDATOR_ACTION_PARAM
+ ","
+ Validator.FIELD_PARAM;
-
+
/**
* The Class objects for each entry in methodParameterList.
- */
+ */
private Class[] parameterClasses = null;
/**
- * The other <code>ValidatorAction</code>s that this one depends on. If
- * any errors occur in an action that this one depends on, this action will
+ * The other <code>ValidatorAction</code>s that this one depends on. If
+ * any errors occur in an action that this one depends on, this action will
* not be processsed.
*/
private String depends = null;
@@ -116,7 +118,7 @@ public class ValidatorAction implements
private String msg = null;
/**
- * An optional field to contain the name to be used if JavaScript is
+ * An optional field to contain the name to be used if JavaScript is
* generated.
*/
private String jsFunctionName = null;
@@ -134,8 +136,8 @@ public class ValidatorAction implements
private String javascript = null;
/**
- * If the java method matching the correct signature isn't static, the
- * instance is stored in the action. This assumes the method is thread
+ * If the java method matching the correct signature isn't static, the
+ * instance is stored in the action. This assumes the method is thread
* safe.
*/
private Object instance = null;
@@ -150,7 +152,7 @@ public class ValidatorAction implements
private List dependencyList = Collections.synchronizedList(new ArrayList());
/**
- * An internal List representation of all the validation method's
+ * An internal List representation of all the validation method's
* parameters defined in the methodParams String.
*/
private List methodParameterList = new ArrayList();
@@ -231,7 +233,7 @@ public class ValidatorAction implements
}
/**
- * Gets the dependencies of the validator action as a comma separated list
+ * Gets the dependencies of the validator action as a comma separated list
* of validator names.
* @return The validator action's dependencies.
*/
@@ -301,7 +303,7 @@ public class ValidatorAction implements
* Attempting to call both <code>setJsFunction</code> and <code>setJavascript</code>
* will result in an <code>IllegalStateException</code> being thrown. </p>
* <p>
- * If <strong>neither</strong> setJsFunction or setJavascript is set then
+ * If <strong>neither</strong> setJsFunction or setJavascript is set then
* validator will attempt to load the default javascript definition.
* </p>
* <pre>
@@ -359,13 +361,13 @@ public class ValidatorAction implements
/**
* Load the javascript function specified by the given path. For this
- * implementation, the <code>jsFunction</code> property should contain a
- * fully qualified package and script name, separated by periods, to be
+ * implementation, the <code>jsFunction</code> property should contain a
+ * fully qualified package and script name, separated by periods, to be
* loaded from the class loader that created this instance.
*
- * TODO if the path begins with a '/' the path will be intepreted as
- * absolute, and remain unchanged. If this fails then it will attempt to
- * treat the path as a file path. It is assumed the script ends with a
+ * TODO if the path begins with a '/' the path will be intepreted as
+ * absolute, and remain unchanged. If this fails then it will attempt to
+ * treat the path as a file path. It is assumed the script ends with a
* '.js'.
*/
protected synchronized void loadJavascriptFunction() {
@@ -435,13 +437,13 @@ public class ValidatorAction implements
getLog().error("Error closing stream to javascript file.", e);
}
}
-
+
String function = buffer.toString();
return function.equals("") ? null : function;
}
/**
- * @return A filename suitable for passing to a
+ * @return A filename suitable for passing to a
* ClassLoader.getResourceAsStream() method.
*/
private String formatJavascriptFileName() {
@@ -504,9 +506,9 @@ public class ValidatorAction implements
return results.toString();
}
-
+
/**
- * Dynamically runs the validation method for this validator and returns
+ * Dynamically runs the validation method for this validator and returns
* true if the data is valid.
* @param field
* @param params A Map of class names to parameter values.
@@ -534,7 +536,7 @@ public class ValidatorAction implements
}
Object[] paramValues = this.getParameterValues(params);
-
+
if (field.isIndexed()) {
this.handleIndexedField(field, pos, paramValues);
}
@@ -586,7 +588,7 @@ public class ValidatorAction implements
return true;
}
-
+
/**
* Load the Method object for the configured validation method name.
* @throws ValidatorException
@@ -595,40 +597,40 @@ public class ValidatorAction implements
if (this.validationMethod != null) {
return;
}
-
+
try {
this.validationMethod =
this.validationClass.getMethod(this.method, this.parameterClasses);
-
+
} catch (NoSuchMethodException e) {
- throw new ValidatorException("No such validation method: " +
+ throw new ValidatorException("No such validation method: " +
e.getMessage());
}
}
-
+
/**
* Load the Class object for the configured validation class name.
* @param loader The ClassLoader used to load the Class object.
* @throws ValidatorException
*/
- private void loadValidationClass(ClassLoader loader)
+ private void loadValidationClass(ClassLoader loader)
throws ValidatorException {
-
+
if (this.validationClass != null) {
return;
}
-
+
try {
this.validationClass = loader.loadClass(this.classname);
} catch (ClassNotFoundException e) {
throw new ValidatorException(e.toString());
}
}
-
+
/**
* Converts a List of parameter class names into their Class objects.
- * Stores the output in {@link parameterClasses}. This
- * array is in the same order as the given List and is suitable for passing
+ * Stores the output in {@link parameterClasses}. This
+ * array is in the same order as the given List and is suitable for passing
* to the validation method.
* @throws ValidatorException if a class cannot be loaded.
*/
@@ -638,7 +640,7 @@ public class ValidatorAction implements
if (this.parameterClasses != null) {
return;
}
-
+
Class[] parameterClasses = new Class[this.methodParameterList.size()];
for (int i = 0; i < this.methodParameterList.size(); i++) {
@@ -646,7 +648,7 @@ public class ValidatorAction implements
try {
parameterClasses[i] = loader.loadClass(paramClassName);
-
+
} catch (ClassNotFoundException e) {
throw new ValidatorException(e.getMessage());
}
@@ -654,13 +656,13 @@ public class ValidatorAction implements
this.parameterClasses = parameterClasses;
}
-
+
/**
- * Converts a List of parameter class names into their values contained in
+ * Converts a List of parameter class names into their values contained in
* the parameters Map.
* @param params A Map of class names to parameter values.
- * @return An array containing the value object for each parameter. This
- * array is in the same order as the given List and is suitable for passing
+ * @return An array containing the value object for each parameter. This
+ * array is in the same order as the given List and is suitable for passing
* to the validation method.
*/
private Object[] getParameterValues(Map params) {
@@ -674,9 +676,9 @@ public class ValidatorAction implements
return paramValue;
}
-
+
/**
- * Return an instance of the validation class or null if the validation
+ * Return an instance of the validation class or null if the validation
* method is static so does not require an instance to be executed.
*/
private Object getValidationClassInstance() throws ValidatorException {
@@ -710,7 +712,7 @@ public class ValidatorAction implements
return this.instance;
}
-
+
/**
* Modifies the paramValue array with indexed fields.
*
@@ -740,10 +742,10 @@ public class ValidatorAction implements
paramValues[fieldIndex] = indexedField;
}
-
+
/**
- * If the result object is a <code>Boolean</code>, it will return its
- * value. If not it will return <code>false</code> if the object is
+ * If the result object is a <code>Boolean</code>, it will return its
+ * value. If not it will return <code>false</code> if the object is
* <code>null</code> and <code>true</code> if it isn't.
*/
private boolean isValid(Object result) {
@@ -763,9 +765,9 @@ public class ValidatorAction implements
Validator v = (Validator) params.get(Validator.VALIDATOR_PARAM);
return v.getClassLoader();
}
-
+
/**
- * Returns the onlyReturnErrors setting in the Validator contained in the
+ * Returns the onlyReturnErrors setting in the Validator contained in the
* parameter Map.
*/
private boolean onlyReturnErrors(Map params) {
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorException.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorException.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorException.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorException.java Thu Jan 5 17:45:51 2012
@@ -17,14 +17,16 @@
package org.apache.commons.validator;
/**
- * The base exception for the Validator Framework. All other
- * <code>Exception</code>s thrown during calls to
+ * The base exception for the Validator Framework. All other
+ * <code>Exception</code>s thrown during calls to
* <code>Validator.validate()</code> are considered errors.
*
* @version $Revision$ $Date$
*/
public class ValidatorException extends Exception {
+ private static final long serialVersionUID = 1025759372615616964L;
+
/**
* Constructs an Exception with no specified detail message.
*/
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResources.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResources.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResources.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResources.java Thu Jan 5 17:45:51 2012
@@ -54,6 +54,8 @@ import org.xml.sax.Attributes;
*/
public class ValidatorResources implements Serializable {
+ private static final long serialVersionUID = -8203745881446239554L;
+
/** Name of the digester validator rules file */
private static final String VALIDATOR_RULES = "digester-rules.xml";
@@ -113,13 +115,13 @@ public class ValidatorResources implemen
public ValidatorResources() {
super();
}
-
+
/**
* This is the default <code>FormSet</code> (without locale). (We probably don't need
* the defaultLocale anymore.)
*/
protected FormSet defaultFormSet;
-
+
/**
* Create a ValidatorResources object from an InputStream.
*
@@ -163,11 +165,11 @@ public class ValidatorResources implemen
this.process();
}
-
+
/**
* Create a ValidatorResources object from an uri
*
- * @param uri The location of a validation.xml configuration file.
+ * @param uri The location of a validation.xml configuration file.
* @throws IOException
* @throws SAXException if the validation XML files are not valid or well
* formed.
@@ -201,7 +203,7 @@ public class ValidatorResources implemen
}
this.process();
- }
+ }
/**
* Create a ValidatorResources object from a URL.
@@ -274,7 +276,7 @@ public class ValidatorResources implemen
return digester;
}
- private static final String ARGS_PATTERN
+ private static final String ARGS_PATTERN
= "form-validation/formset/form/field/arg";
/**
@@ -287,7 +289,7 @@ public class ValidatorResources implemen
// Create a new rule to process args elements
Rule rule = new Rule() {
- public void begin(String namespace, String name,
+ public void begin(String namespace, String name,
Attributes attributes) throws Exception {
// Create the Arg
Arg arg = new Arg();
@@ -299,7 +301,7 @@ public class ValidatorResources implemen
try {
arg.setPosition(Integer.parseInt(name.substring(3)));
} catch (Exception ex) {
- getLog().error("Error parsing Arg position: "
+ getLog().error("Error parsing Arg position: "
+ name + " " + arg + " " + ex);
}
@@ -527,7 +529,7 @@ public class ValidatorResources implemen
this.processForms();
}
-
+
/**
* <p>Process the <code>Form</code> objects. This clones the <code>Field</code>s
* that don't exist in a <code>FormSet</code> compared to its parent
@@ -560,7 +562,7 @@ public class ValidatorResources implemen
* has a direct parent in the formSet with locale en_UK. If it doesn't
* exist, find the formSet with locale en, if no found get the
* defaultFormSet.
- *
+ *
* @param fs
* the formSet we want to get the parent from
* @return fs's parent
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResult.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResult.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResult.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResult.java Thu Jan 5 17:45:51 2012
@@ -30,6 +30,8 @@ import java.util.Iterator;
*/
public class ValidatorResult implements Serializable {
+ private static final long serialVersionUID = -3713364681647250531L;
+
/**
* Map of results. The key is the name of the <code>ValidatorAction</code>
* and the value is whether or not this field passed or not.
@@ -131,6 +133,9 @@ public class ValidatorResult implements
* Contains the status of the validation.
*/
protected static class ResultStatus implements Serializable {
+
+ private static final long serialVersionUID = 4076665918535320007L;
+
private boolean valid = false;
private Object result = null;
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResults.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResults.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResults.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/ValidatorResults.java Thu Jan 5 17:45:51 2012
@@ -24,13 +24,15 @@ import java.util.Map;
import java.util.Set;
/**
- * This contains the results of a set of validation rules processed
+ * This contains the results of a set of validation rules processed
* on a JavaBean.
*
* @version $Revision$ $Date$
*/
public class ValidatorResults implements Serializable {
+ private static final long serialVersionUID = -2709911078904924839L;
+
/**
* Map of validation results.
*/
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractCalendarValidator.java Thu Jan 5 17:45:51 2012
@@ -26,24 +26,26 @@ import java.util.TimeZone;
/**
* <p>Abstract class for Date/Time/Calendar validation.</p>
- *
+ *
* <p>This is a <i>base</i> class for building Date / Time
* Validators using format parsing.</p>
- *
+ *
* @version $Revision$ $Date$
* @since Validator 1.3.0
*/
public abstract class AbstractCalendarValidator extends AbstractFormatValidator {
+ private static final long serialVersionUID = -1410008585975827379L;
+
private final int dateStyle;
private final int timeStyle;
/**
- * Construct an instance with the specified <i>strict</i>,
+ * Construct an instance with the specified <i>strict</i>,
* <i>time</i> and <i>date</i> style parameters.
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
* @param dateStyle the date style to use for Locale validation.
* @param timeStyle the time style to use for Locale validation.
@@ -55,8 +57,8 @@ public abstract class AbstractCalendarVa
}
/**
- * <p>Validate using the specified <code>Locale</code>.
- *
+ * <p>Validate using the specified <code>Locale</code>.
+ *
* @param value The value validation is being performed on.
* @param pattern The pattern used to format the value.
* @param locale The locale to use for the Format, defaults to the default
@@ -109,8 +111,8 @@ public abstract class AbstractCalendarVa
}
/**
- * <p>Format an object using the specified pattern and/or
- * <code>Locale</code>.
+ * <p>Format an object using the specified pattern and/or
+ * <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to format the value.
@@ -122,8 +124,8 @@ public abstract class AbstractCalendarVa
}
/**
- * <p>Format an object using the specified pattern and/or
- * <code>Locale</code>.
+ * <p>Format an object using the specified pattern and/or
+ * <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to format the value.
@@ -144,7 +146,7 @@ public abstract class AbstractCalendarVa
/**
* <p>Format a value with the specified <code>DateFormat</code>.</p>
- *
+ *
* @param value The value to be formatted.
* @param formatter The Format to use.
* @return The formatted value.
@@ -153,7 +155,7 @@ public abstract class AbstractCalendarVa
if (value == null) {
return null;
} else if (value instanceof Calendar) {
- value = ((Calendar)value).getTime();
+ value = ((Calendar)value).getTime();
}
return formatter.format(value);
}
@@ -183,9 +185,9 @@ public abstract class AbstractCalendarVa
}
/**
- * <p>Process the parsed value, performing any further validation
+ * <p>Process the parsed value, performing any further validation
* and type conversion required.</p>
- *
+ *
* @param value The parsed object created.
* @param formatter The Format used to parse the value with.
* @return The parsed value converted to the appropriate type
@@ -196,7 +198,7 @@ public abstract class AbstractCalendarVa
/**
* <p>Returns a <code>DateFormat</code> for the specified <i>pattern</i>
* and/or <code>Locale</code>.</p>
- *
+ *
* @param pattern The pattern used to validate the value against or
* <code>null</code> to use the default for the <code>Locale</code>.
* @param locale The locale to use for the currency format, system default if null.
@@ -219,14 +221,14 @@ public abstract class AbstractCalendarVa
/**
* <p>Returns a <code>DateFormat</code> for the specified Locale.</p>
- *
+ *
* @param locale The locale a <code>DateFormat</code> is required for,
* system default if null.
* @return The <code>DateFormat</code> to created.
*/
protected Format getFormat(Locale locale) {
- DateFormat formatter = null;
+ DateFormat formatter = null;
if (dateStyle >= 0 && timeStyle >= 0) {
if (locale == null) {
formatter = DateFormat.getDateTimeInstance(dateStyle, timeStyle);
@@ -255,14 +257,14 @@ public abstract class AbstractCalendarVa
/**
* <p>Compares a calendar value to another, indicating whether it is
* equal, less then or more than at a specified level.</p>
- *
+ *
* @param value The Calendar value.
* @param compare The <code>Calendar</code> to check the value against.
* @param field The field <i>level</i> to compare to - e.g. specifying
* <code>Calendar.MONTH</code> will compare the year and month
- * portions of the calendar.
+ * portions of the calendar.
* @return Zero if the first value is equal to the second, -1
- * if it is less than the second or +1 if it is greater than the second.
+ * if it is less than the second or +1 if it is greater than the second.
*/
protected int compare(Calendar value, Calendar compare, int field) {
@@ -297,7 +299,7 @@ public abstract class AbstractCalendarVa
// Compare Date
result = calculateCompareResult(value, compare, Calendar.DATE);
- if (result != 0 || (field == Calendar.DATE ||
+ if (result != 0 || (field == Calendar.DATE ||
field == Calendar.DAY_OF_WEEK ||
field == Calendar.DAY_OF_WEEK_IN_MONTH)) {
return result;
@@ -311,14 +313,14 @@ public abstract class AbstractCalendarVa
/**
* <p>Compares a calendar time value to another, indicating whether it is
* equal, less then or more than at a specified level.</p>
- *
+ *
* @param value The Calendar value.
* @param compare The <code>Calendar</code> to check the value against.
* @param field The field <i>level</i> to compare to - e.g. specifying
* <code>Calendar.MINUTE</code> will compare the hours and minutes
- * portions of the calendar.
+ * portions of the calendar.
* @return Zero if the first value is equal to the second, -1
- * if it is less than the second or +1 if it is greater than the second.
+ * if it is less than the second or +1 if it is greater than the second.
*/
protected int compareTime(Calendar value, Calendar compare, int field) {
@@ -354,12 +356,12 @@ public abstract class AbstractCalendarVa
/**
* <p>Compares a calendar's quarter value to another, indicating whether it is
* equal, less then or more than the specified quarter.</p>
- *
+ *
* @param value The Calendar value.
* @param compare The <code>Calendar</code> to check the value against.
* @param monthOfFirstQuarter The month that the first quarter starts.
* @return Zero if the first quarter is equal to the second, -1
- * if it is less than the second or +1 if it is greater than the second.
+ * if it is less than the second or +1 if it is greater than the second.
*/
protected int compareQuarters(Calendar value, Calendar compare, int monthOfFirstQuarter) {
int valueQuarter = calculateQuarter(value, monthOfFirstQuarter);
@@ -375,7 +377,7 @@ public abstract class AbstractCalendarVa
/**
* <p>Calculate the quarter for the specified Calendar.</p>
- *
+ *
* @param calendar The Calendar value.
* @param monthOfFirstQuarter The month that the first quarter starts.
* @return The calculated quarter.
@@ -400,12 +402,12 @@ public abstract class AbstractCalendarVa
* <p>Compares the field from two calendars indicating whether the field for the
* first calendar is equal to, less than or greater than the field from the
* second calendar.
- *
+ *
* @param value The Calendar value.
* @param compare The <code>Calendar</code> to check the value against.
* @param field The field to compare for the calendars.
* @return Zero if the first calendar's field is equal to the seconds, -1
- * if it is less than the seconds or +1 if it is greater than the seconds.
+ * if it is less than the seconds or +1 if it is greater than the seconds.
*/
private int calculateCompareResult(Calendar value, Calendar compare, int field) {
int difference = value.get(field) - compare.get(field);
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractFormatValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractFormatValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractFormatValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractFormatValidator.java Thu Jan 5 17:45:51 2012
@@ -26,18 +26,20 @@ import java.io.Serializable;
*
* <p>This is a <i>base</i> class for building Date and Number
* Validators using format parsing.</p>
- *
+ *
* @version $Revision$ $Date$
* @since Validator 1.3.0
*/
public abstract class AbstractFormatValidator implements Serializable {
+ private static final long serialVersionUID = -4690687565200568258L;
+
private final boolean strict;
/**
* Construct an instance with the specified strict setting.
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
*/
public AbstractFormatValidator(boolean strict) {
@@ -47,7 +49,7 @@ public abstract class AbstractFormatVali
/**
* <p>Indicates whether validated values should adhere
* strictly to the <code>Format</code> used.</p>
- *
+ *
* <p>Typically implementations of <code>Format</code>
* ignore invalid characters at the end of the value
* and just stop parsing. For example parsing a date
@@ -57,7 +59,7 @@ public abstract class AbstractFormatVali
* to <code>false</code>, whereas setting <code>strict</code>
* to <code>true</code> will cause this value to fail
* validation.</p>
- *
+ *
* @return <code>true</code> if strict <code>Format</code>
* parsing should be used.
*/
@@ -66,8 +68,8 @@ public abstract class AbstractFormatVali
}
/**
- * <p>Validate using the default <code>Locale</code>.
- *
+ * <p>Validate using the default <code>Locale</code>.
+ *
* @param value The value validation is being performed on.
* @return <code>true</code> if the value is valid.
*/
@@ -76,8 +78,8 @@ public abstract class AbstractFormatVali
}
/**
- * <p>Validate using the specified <i>pattern</i>.
- *
+ * <p>Validate using the specified <i>pattern</i>.
+ *
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against.
* @return <code>true</code> if the value is valid.
@@ -87,8 +89,8 @@ public abstract class AbstractFormatVali
}
/**
- * <p>Validate using the specified <code>Locale</code>.
- *
+ * <p>Validate using the specified <code>Locale</code>.
+ *
* @param value The value validation is being performed on.
* @param locale The locale to use for the Format, defaults to the default
* @return <code>true</code> if the value is valid.
@@ -98,8 +100,8 @@ public abstract class AbstractFormatVali
}
/**
- * <p>Validate using the specified pattern and/or <code>Locale</code>.
- *
+ * <p>Validate using the specified pattern and/or <code>Locale</code>.
+ *
* @param value The value validation is being performed on.
* @param pattern The pattern used to format the value.
* @param locale The locale to use for the Format, defaults to the default
@@ -143,8 +145,8 @@ public abstract class AbstractFormatVali
}
/**
- * <p>Format an object using the specified pattern and/or
- * <code>Locale</code>.
+ * <p>Format an object using the specified pattern and/or
+ * <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to format the value.
@@ -158,7 +160,7 @@ public abstract class AbstractFormatVali
/**
* <p>Format a value with the specified <code>Format</code>.</p>
- *
+ *
* @param value The value to be formatted.
* @param formatter The Format to use.
* @return The formatted value.
@@ -169,7 +171,7 @@ public abstract class AbstractFormatVali
/**
* <p>Parse the value with the specified <code>Format</code>.</p>
- *
+ *
* @param value The value to be parsed.
* @param formatter The Format to parse the value with.
* @return The parsed value if valid or <code>null</code> if invalid.
@@ -195,9 +197,9 @@ public abstract class AbstractFormatVali
}
/**
- * <p>Process the parsed value, performing any further validation
+ * <p>Process the parsed value, performing any further validation
* and type conversion required.</p>
- *
+ *
* @param value The parsed object created.
* @param formatter The Format used to parse the value with.
* @return The parsed value converted to the appropriate type
@@ -208,7 +210,7 @@ public abstract class AbstractFormatVali
/**
* <p>Returns a <code>Format</code> for the specified <i>pattern</i>
* and/or <code>Locale</code>.</p>
- *
+ *
* @param pattern The pattern used to validate the value against or
* <code>null</code> to use the default for the <code>Locale</code>.
* @param locale The locale to use for the currency format, system default if null.
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractNumberValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractNumberValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractNumberValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/AbstractNumberValidator.java Thu Jan 5 17:45:51 2012
@@ -27,12 +27,14 @@ import java.util.Locale;
*
* <p>This is a <i>base</i> class for building Number
* Validators using format parsing.</p>
- *
+ *
* @version $Revision$ $Date$
* @since Validator 1.3.0
*/
public abstract class AbstractNumberValidator extends AbstractFormatValidator {
-
+
+ private static final long serialVersionUID = -3088817875906765463L;
+
/** Standard <code>NumberFormat</code> type */
public static final int STANDARD_FORMAT = 0;
@@ -48,8 +50,8 @@ public abstract class AbstractNumberVali
/**
* Construct an instance with specified <i>strict</i>
* and <i>decimal</i> parameters.
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
* @param formatType The <code>NumberFormat</code> type to
* create for validation, default is STANDARD_FORMAT.
@@ -65,7 +67,7 @@ public abstract class AbstractNumberVali
/**
* <p>Indicates whether the number being validated is
* a decimal or integer.</p>
- *
+ *
* @return <code>true</code> if decimals are allowed
* or <code>false</code> if the number is an integer.
*/
@@ -76,7 +78,7 @@ public abstract class AbstractNumberVali
/**
* <p>Indicates the type of <code>NumberFormat</code> created
* by this validator instance.</p>
- *
+ *
* @return the format type created.
*/
public int getFormatType() {
@@ -85,7 +87,7 @@ public abstract class AbstractNumberVali
/**
* <p>Validate using the specified <code>Locale</code>.</p>
- *
+ *
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against, or the
* default for the <code>Locale</code> if <code>null</code>.
@@ -99,7 +101,7 @@ public abstract class AbstractNumberVali
/**
* Check if the value is within a specified range.
- *
+ *
* @param value The value validation is being performed on.
* @param min The minimum value of the range.
* @param max The maximum value of the range.
@@ -112,7 +114,7 @@ public abstract class AbstractNumberVali
/**
* Check if the value is greater than or equal to a minimum.
- *
+ *
* @param value The value validation is being performed on.
* @param min The minimum value.
* @return <code>true</code> if the value is greater than
@@ -128,7 +130,7 @@ public abstract class AbstractNumberVali
/**
* Check if the value is less than or equal to a maximum.
- *
+ *
* @param value The value validation is being performed on.
* @param max The maximum value.
* @return <code>true</code> if the value is less than
@@ -163,9 +165,9 @@ public abstract class AbstractNumberVali
}
/**
- * <p>Process the parsed value, performing any further validation
+ * <p>Process the parsed value, performing any further validation
* and type conversion required.</p>
- *
+ *
* @param value The parsed object created.
* @param formatter The Format used to parse the value with.
* @return The parsed value converted to the appropriate type
@@ -176,7 +178,7 @@ public abstract class AbstractNumberVali
/**
* <p>Returns a <code>NumberFormat</code> for the specified <i>pattern</i>
* and/or <code>Locale</code>.</p>
- *
+ *
* @param pattern The pattern used to validate the value against or
* <code>null</code> to use the default for the <code>Locale</code>.
* @param locale The locale to use for the currency format, system default if null.
@@ -203,8 +205,8 @@ public abstract class AbstractNumberVali
/**
* <p>Returns the <i>multiplier</i> of the <code>NumberFormat</code>.</p>
- *
- * @param format The <code>NumberFormat</code> to determine the
+ *
+ * @param format The <code>NumberFormat</code> to determine the
* multiplier of.
* @return The multiplying factor for the format..
*/
@@ -236,7 +238,7 @@ public abstract class AbstractNumberVali
/**
* <p>Returns a <code>NumberFormat</code> for the specified Locale.</p>
- *
+ *
* @param locale The locale a <code>NumberFormat</code> is required for,
* system default if null.
* @return The <code>NumberFormat</code> to created.
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigDecimalValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigDecimalValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigDecimalValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigDecimalValidator.java Thu Jan 5 17:45:51 2012
@@ -34,13 +34,13 @@ import java.util.Locale;
* <li>using the default format for a specified <code>Locale</code></li>
* <li>using a specified pattern with a specified <code>Locale</code></li>
* </ul>
- *
+ *
* <p>Use one of the <code>isValid()</code> methods to just validate or
* one of the <code>validate()</code> methods to validate and receive a
* <i>converted</i> <code>BigDecimal</code> value.</p>
- *
+ *
* <p>Fraction/decimal values are automatically trimmed to the appropriate length.</p>
- *
+ *
* <p>Once a value has been sucessfully converted the following
* methods can be used to perform minimum, maximum and range checks:</p>
* <ul>
@@ -51,10 +51,10 @@ import java.util.Locale;
* <li><code>isInRange()</code> checks whether the value is within
* a specified range of values.</li>
* </ul>
- *
- * <p>So that the same mechanism used for parsing an <i>input</i> value
+ *
+ * <p>So that the same mechanism used for parsing an <i>input</i> value
* for validation can be used to format <i>output</i>, corresponding
- * <code>format()</code> methods are also provided. That is you can
+ * <code>format()</code> methods are also provided. That is you can
* format either:</p>
* <ul>
* <li>using the default format for the default <code>Locale</code></li>
@@ -62,12 +62,14 @@ import java.util.Locale;
* <li>using the default format for a specified <code>Locale</code></li>
* <li>using a specified pattern with a specified <code>Locale</code></li>
* </ul>
- *
+ *
* @version $Revision$ $Date$
* @since Validator 1.3.0
*/
public class BigDecimalValidator extends AbstractNumberValidator {
+ private static final long serialVersionUID = -670320911490506772L;
+
private static final BigDecimalValidator VALIDATOR = new BigDecimalValidator();
/**
@@ -87,8 +89,8 @@ public class BigDecimalValidator extends
/**
* <p>Construct an instance with the specified strict setting.</p>
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
*/
public BigDecimalValidator(boolean strict) {
@@ -98,7 +100,7 @@ public class BigDecimalValidator extends
/**
* <p>Construct an instance with the specified strict setting
* and format type.</p>
- *
+ *
* <p>The <code>formatType</code> specified what type of
* <code>NumberFormat</code> is created - valid types
* are:</p>
@@ -110,22 +112,22 @@ public class BigDecimalValidator extends
* <li>AbstractNumberValidator.PERCENT_FORMAT -to create
* <i>percent</i> number formats (the default).</li>
* </ul>
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
* @param formatType The <code>NumberFormat</code> type to
* create for validation, default is STANDARD_FORMAT.
* @param allowFractions <code>true</code> if fractions are
* allowed or <code>false</code> if integers only.
*/
- protected BigDecimalValidator(boolean strict, int formatType,
+ protected BigDecimalValidator(boolean strict, int formatType,
boolean allowFractions) {
super(strict, formatType, allowFractions);
}
/**
* <p>Validate/convert a <code>BigDecimal</code> using the default
- * <code>Locale</code>.
+ * <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @return The parsed <code>BigDecimal</code> if valid or <code>null</code>
@@ -137,7 +139,7 @@ public class BigDecimalValidator extends
/**
* <p>Validate/convert a <code>BigDecimal</code> using the
- * specified <i>pattern</i>.
+ * specified <i>pattern</i>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against, or the
@@ -150,7 +152,7 @@ public class BigDecimalValidator extends
/**
* <p>Validate/convert a <code>BigDecimal</code> using the
- * specified <code>Locale</code>.
+ * specified <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param locale The locale to use for the number format, system default if null.
@@ -162,7 +164,7 @@ public class BigDecimalValidator extends
/**
* <p>Validate/convert a <code>BigDecimal</code> using the
- * specified pattern and/ or <code>Locale</code>.
+ * specified pattern and/ or <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against, or the
@@ -176,7 +178,7 @@ public class BigDecimalValidator extends
/**
* Check if the value is within a specified range.
- *
+ *
* @param value The <code>Number</code> value to check.
* @param min The minimum value of the range.
* @param max The maximum value of the range.
@@ -189,7 +191,7 @@ public class BigDecimalValidator extends
/**
* Check if the value is greater than or equal to a minimum.
- *
+ *
* @param value The value validation is being performed on.
* @param min The minimum value.
* @return <code>true</code> if the value is greater than
@@ -201,7 +203,7 @@ public class BigDecimalValidator extends
/**
* Check if the value is less than or equal to a maximum.
- *
+ *
* @param value The value validation is being performed on.
* @param max The maximum value.
* @return <code>true</code> if the value is less than
@@ -213,10 +215,10 @@ public class BigDecimalValidator extends
/**
* Convert the parsed value to a <code>BigDecimal</code>.
- *
+ *
* @param value The parsed <code>Number</code> object created.
* @param formatter The Format used to parse the value with.
- * @return The parsed <code>Number</code> converted to a
+ * @return The parsed <code>Number</code> converted to a
* <code>BigDecimal</code>.
*/
protected Object processParsedValue(Object value, Format formatter) {
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigIntegerValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigIntegerValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigIntegerValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/BigIntegerValidator.java Thu Jan 5 17:45:51 2012
@@ -33,11 +33,11 @@ import java.util.Locale;
* <li>using the default format for a specified <code>Locale</code></li>
* <li>using a specified pattern with a specified <code>Locale</code></li>
* </ul>
- *
+ *
* <p>Use one of the <code>isValid()</code> methods to just validate or
* one of the <code>validate()</code> methods to validate and receive a
* <i>converted</i> <code>BigInteger</code> value.</p>
- *
+ *
* <p>Once a value has been sucessfully converted the following
* methods can be used to perform minimum, maximum and range checks:</p>
* <ul>
@@ -48,10 +48,10 @@ import java.util.Locale;
* <li><code>isInRange()</code> checks whether the value is within
* a specified range of values.</li>
* </ul>
- *
- * <p>So that the same mechanism used for parsing an <i>input</i> value
+ *
+ * <p>So that the same mechanism used for parsing an <i>input</i> value
* for validation can be used to format <i>output</i>, corresponding
- * <code>format()</code> methods are also provided. That is you can
+ * <code>format()</code> methods are also provided. That is you can
* format either:</p>
* <ul>
* <li>using the default format for the default <code>Locale</code></li>
@@ -65,6 +65,8 @@ import java.util.Locale;
*/
public class BigIntegerValidator extends AbstractNumberValidator {
+ private static final long serialVersionUID = 6713144356347139988L;
+
private static final BigIntegerValidator VALIDATOR = new BigIntegerValidator();
/**
@@ -85,7 +87,7 @@ public class BigIntegerValidator extends
/**
* <p>Construct an instance with the specified strict setting
* and format type.</p>
- *
+ *
* <p>The <code>formatType</code> specified what type of
* <code>NumberFormat</code> is created - valid types
* are:</p>
@@ -97,8 +99,8 @@ public class BigIntegerValidator extends
* <li>AbstractNumberValidator.PERCENT_FORMAT -to create
* <i>percent</i> number formats (the default).</li>
* </ul>
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
* @param formatType The <code>NumberFormat</code> type to
* create for validation, default is STANDARD_FORMAT.
@@ -109,7 +111,7 @@ public class BigIntegerValidator extends
/**
* <p>Validate/convert a <code>BigInteger</code> using the default
- * <code>Locale</code>.
+ * <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @return The parsed <code>BigInteger</code> if valid or <code>null</code>
@@ -121,7 +123,7 @@ public class BigIntegerValidator extends
/**
* <p>Validate/convert a <code>BigInteger</code> using the
- * specified <i>pattern</i>.
+ * specified <i>pattern</i>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against.
@@ -133,7 +135,7 @@ public class BigIntegerValidator extends
/**
* <p>Validate/convert a <code>BigInteger</code> using the
- * specified <code>Locale</code>.
+ * specified <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param locale The locale to use for the number format, system default if null.
@@ -145,7 +147,7 @@ public class BigIntegerValidator extends
/**
* <p>Validate/convert a <code>BigInteger</code> using the
- * specified pattern and/ or <code>Locale</code>.
+ * specified pattern and/ or <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against, or the
@@ -159,7 +161,7 @@ public class BigIntegerValidator extends
/**
* Check if the value is within a specified range.
- *
+ *
* @param value The <code>Number</code> value to check.
* @param min The minimum value of the range.
* @param max The maximum value of the range.
@@ -172,7 +174,7 @@ public class BigIntegerValidator extends
/**
* Check if the value is greater than or equal to a minimum.
- *
+ *
* @param value The value validation is being performed on.
* @param min The minimum value.
* @return <code>true</code> if the value is greater than
@@ -184,7 +186,7 @@ public class BigIntegerValidator extends
/**
* Check if the value is less than or equal to a maximum.
- *
+ *
* @param value The value validation is being performed on.
* @param max The maximum value.
* @return <code>true</code> if the value is less than
@@ -196,10 +198,10 @@ public class BigIntegerValidator extends
/**
* Convert the parsed value to a <code>BigInteger</code>.
- *
+ *
* @param value The parsed <code>Number</code> object created.
* @param formatter The Format used to parse the value with.
- * @return The parsed <code>Number</code> converted to a
+ * @return The parsed <code>Number</code> converted to a
* <code>BigInteger</code>.
*/
protected Object processParsedValue(Object value, Format formatter) {
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ByteValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ByteValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ByteValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ByteValidator.java Thu Jan 5 17:45:51 2012
@@ -32,11 +32,11 @@ import java.util.Locale;
* <li>using the default format for a specified <code>Locale</code></li>
* <li>using a specified pattern with a specified <code>Locale</code></li>
* </ul>
- *
+ *
* <p>Use one of the <code>isValid()</code> methods to just validate or
* one of the <code>validate()</code> methods to validate and receive a
* <i>converted</i> <code>Byte</code> value.</p>
- *
+ *
* <p>Once a value has been sucessfully converted the following
* methods can be used to perform minimum, maximum and range checks:</p>
* <ul>
@@ -47,10 +47,10 @@ import java.util.Locale;
* <li><code>isInRange()</code> checks whether the value is within
* a specified range of values.</li>
* </ul>
- *
- * <p>So that the same mechanism used for parsing an <i>input</i> value
+ *
+ * <p>So that the same mechanism used for parsing an <i>input</i> value
* for validation can be used to format <i>output</i>, corresponding
- * <code>format()</code> methods are also provided. That is you can
+ * <code>format()</code> methods are also provided. That is you can
* format either:</p>
* <ul>
* <li>using the default format for the default <code>Locale</code></li>
@@ -64,6 +64,8 @@ import java.util.Locale;
*/
public class ByteValidator extends AbstractNumberValidator {
+ private static final long serialVersionUID = 7001640945881854649L;
+
private static final ByteValidator VALIDATOR = new ByteValidator();
/**
@@ -84,7 +86,7 @@ public class ByteValidator extends Abstr
/**
* <p>Construct an instance with the specified strict setting
* and format type.</p>
- *
+ *
* <p>The <code>formatType</code> specified what type of
* <code>NumberFormat</code> is created - valid types
* are:</p>
@@ -96,8 +98,8 @@ public class ByteValidator extends Abstr
* <li>AbstractNumberValidator.PERCENT_FORMAT -to create
* <i>percent</i> number formats (the default).</li>
* </ul>
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
* @param formatType The <code>NumberFormat</code> type to
* create for validation, default is STANDARD_FORMAT.
@@ -108,7 +110,7 @@ public class ByteValidator extends Abstr
/**
* <p>Validate/convert a <code>Byte</code> using the default
- * <code>Locale</code>.
+ * <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @return The parsed <code>Byte</code> if valid or <code>null</code>
@@ -120,7 +122,7 @@ public class ByteValidator extends Abstr
/**
* <p>Validate/convert a <code>Byte</code> using the
- * specified <i>pattern</i>.
+ * specified <i>pattern</i>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against.
@@ -132,7 +134,7 @@ public class ByteValidator extends Abstr
/**
* <p>Validate/convert a <code>Byte</code> using the
- * specified <code>Locale</code>.
+ * specified <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param locale The locale to use for the number format, system default if null.
@@ -144,7 +146,7 @@ public class ByteValidator extends Abstr
/**
* <p>Validate/convert a <code>Byte</code> using the
- * specified pattern and/ or <code>Locale</code>.
+ * specified pattern and/ or <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against, or the
@@ -158,7 +160,7 @@ public class ByteValidator extends Abstr
/**
* Check if the value is within a specified range.
- *
+ *
* @param value The <code>Number</code> value to check.
* @param min The minimum value of the range.
* @param max The maximum value of the range.
@@ -171,7 +173,7 @@ public class ByteValidator extends Abstr
/**
* Check if the value is within a specified range.
- *
+ *
* @param value The <code>Number</code> value to check.
* @param min The minimum value of the range.
* @param max The maximum value of the range.
@@ -184,7 +186,7 @@ public class ByteValidator extends Abstr
/**
* Check if the value is greater than or equal to a minimum.
- *
+ *
* @param value The value validation is being performed on.
* @param min The minimum value.
* @return <code>true</code> if the value is greater than
@@ -196,7 +198,7 @@ public class ByteValidator extends Abstr
/**
* Check if the value is greater than or equal to a minimum.
- *
+ *
* @param value The value validation is being performed on.
* @param min The minimum value.
* @return <code>true</code> if the value is greater than
@@ -208,7 +210,7 @@ public class ByteValidator extends Abstr
/**
* Check if the value is less than or equal to a maximum.
- *
+ *
* @param value The value validation is being performed on.
* @param max The maximum value.
* @return <code>true</code> if the value is less than
@@ -220,7 +222,7 @@ public class ByteValidator extends Abstr
/**
* Check if the value is less than or equal to a maximum.
- *
+ *
* @param value The value validation is being performed on.
* @param max The maximum value.
* @return <code>true</code> if the value is less than
@@ -233,17 +235,17 @@ public class ByteValidator extends Abstr
/**
* <p>Perform further validation and convert the <code>Number</code> to
* a <code>Byte</code>.</p>
- *
+ *
* @param value The parsed <code>Number</code> object created.
* @param formatter The Format used to parse the value with.
- * @return The parsed <code>Number</code> converted to a
+ * @return The parsed <code>Number</code> converted to a
* <code>Byte</code> if valid or <code>null</code> if invalid.
*/
protected Object processParsedValue(Object value, Format formatter) {
long longValue = ((Number)value).longValue();
- if (longValue < Byte.MIN_VALUE ||
+ if (longValue < Byte.MIN_VALUE ||
longValue > Byte.MAX_VALUE) {
return null;
} else {
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CalendarValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CalendarValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CalendarValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CalendarValidator.java Thu Jan 5 17:45:51 2012
@@ -26,7 +26,7 @@ import java.util.TimeZone;
* <p><b>Calendar Validation</b> and Conversion routines (<code>java.util.Calendar</code>).</p>
*
* <p>This validator provides a number of methods for validating/converting
- * a <code>String</code> date value to a <code>java.util.Calendar</code> using
+ * a <code>String</code> date value to a <code>java.util.Calendar</code> using
* <code>java.text.DateFormat</code> to parse either:</p>
* <ul>
* <li>using the default format for the default <code>Locale</code></li>
@@ -34,10 +34,10 @@ import java.util.TimeZone;
* <li>using the default format for a specified <code>Locale</code></li>
* <li>using a specified pattern with a specified <code>Locale</code></li>
* </ul>
- *
- * <p>For each of the above mechanisms, conversion method (i.e the
+ *
+ * <p>For each of the above mechanisms, conversion method (i.e the
* <code>validate</code> methods) implementations are provided which
- * either use the default <code>TimeZone</code> or allow the
+ * either use the default <code>TimeZone</code> or allow the
* <code>TimeZone</code> to be specified.</p>
*
* <p>Use one of the <code>isValid()</code> methods to just validate or
@@ -47,18 +47,18 @@ import java.util.TimeZone;
* <p>Implementations of the <code>validate()</code> method are provided
* to create <code>Calendar</code> objects for different <i>time zones</i>
* if the system default is not appropriate.</p>
- *
+ *
* <p>Alternatively the CalendarValidator's <code>adjustToTimeZone()</code> method
* can be used to adjust the <code>TimeZone</code> of the <code>Calendar</code>
- * object afterwards.</p>
- *
+ * object afterwards.</p>
+ *
* <p>Once a value has been sucessfully converted the following
* methods can be used to perform various date comparison checks:</p>
* <ul>
* <li><code>compareDates()</code> compares the day, month and
* year of two calendars, returing 0, -1 or +1 indicating
* whether the first date is equal, before or after the second.</li>
- * <li><code>compareWeeks()</code> compares the week and
+ * <li><code>compareWeeks()</code> compares the week and
* year of two calendars, returing 0, -1 or +1 indicating
* whether the first week is equal, before or after the second.</li>
* <li><code>compareMonths()</code> compares the month and
@@ -67,26 +67,28 @@ import java.util.TimeZone;
* <li><code>compareQuarters()</code> compares the quarter and
* year of two calendars, returing 0, -1 or +1 indicating
* whether the first quarter is equal, before or after the second.</li>
- * <li><code>compareYears()</code> compares the
+ * <li><code>compareYears()</code> compares the
* year of two calendars, returing 0, -1 or +1 indicating
* whether the first year is equal, before or after the second.</li>
* </ul>
- *
- * <p>So that the same mechanism used for parsing an <i>input</i> value
+ *
+ * <p>So that the same mechanism used for parsing an <i>input</i> value
* for validation can be used to format <i>output</i>, corresponding
- * <code>format()</code> methods are also provided. That is you can
+ * <code>format()</code> methods are also provided. That is you can
* format either:</p>
* <ul>
* <li>using a specified pattern</li>
* <li>using the format for a specified <code>Locale</code></li>
* <li>using the format for the <i>default</i> <code>Locale</code></li>
* </ul>
- *
+ *
* @version $Revision$ $Date$
* @since Validator 1.3.0
*/
public class CalendarValidator extends AbstractCalendarValidator {
+ private static final long serialVersionUID = 9109652318762134167L;
+
private static final CalendarValidator VALIDATOR = new CalendarValidator();
/**
@@ -108,8 +110,8 @@ public class CalendarValidator extends A
/**
* Construct an instance with the specified <i>strict</i>
* and <i>date style</i> parameters.
- *
- * @param strict <code>true</code> if strict
+ *
+ * @param strict <code>true</code> if strict
* <code>Format</code> parsing should be used.
* @param dateStyle the date style to use for Locale validation.
*/
@@ -119,7 +121,7 @@ public class CalendarValidator extends A
/**
* <p>Validate/convert a <code>Calendar</code> using the default
- * <code>Locale</code> and <code>TimeZone</code>.
+ * <code>Locale</code> and <code>TimeZone</code>.
*
* @param value The value validation is being performed on.
* @return The parsed <code>Calendar</code> if valid or <code>null</code>
@@ -223,7 +225,7 @@ public class CalendarValidator extends A
/**
* <p>Adjusts a Calendar's value to a different TimeZone.</p>
- *
+ *
* @param value The value to adjust.
* @param timeZone The new time zone to use to adjust the Calendar to.
*/
@@ -243,7 +245,7 @@ public class CalendarValidator extends A
/**
* <p>Compare Dates (day, month and year - not time).</p>
- *
+ *
* @param value The <code>Calendar</code> value to check.
* @param compare The <code>Calendar</code> to compare the value to.
* @return Zero if the dates are equal, -1 if first
@@ -256,7 +258,7 @@ public class CalendarValidator extends A
/**
* <p>Compare Weeks (week and year).</p>
- *
+ *
* @param value The <code>Calendar</code> value to check.
* @param compare The <code>Calendar</code> to compare the value to.
* @return Zero if the weeks are equal, -1 if first
@@ -269,7 +271,7 @@ public class CalendarValidator extends A
/**
* <p>Compare Months (month and year).</p>
- *
+ *
* @param value The <code>Calendar</code> value to check.
* @param compare The <code>Calendar</code> to compare the value to.
* @return Zero if the months are equal, -1 if first
@@ -282,7 +284,7 @@ public class CalendarValidator extends A
/**
* <p>Compare Quarters (quarter and year).</p>
- *
+ *
* @param value The <code>Calendar</code> value to check.
* @param compare The <code>Calendar</code> to check the value against.
* @return Zero if the quarters are equal, -1 if first
@@ -295,7 +297,7 @@ public class CalendarValidator extends A
/**
* <p>Compare Quarters (quarter and year).</p>
- *
+ *
* @param value The <code>Calendar</code> value to check.
* @param compare The <code>Calendar</code> to compare the value to.
* @param monthOfFirstQuarter The month that the first quarter starts.
@@ -309,7 +311,7 @@ public class CalendarValidator extends A
/**
* <p>Compare Years.</p>
- *
+ *
* @param value The <code>Calendar</code> value to check.
* @param compare The <code>Calendar</code> to compare the value to.
* @return Zero if the years are equal, -1 if first
@@ -322,7 +324,7 @@ public class CalendarValidator extends A
/**
* <p>Convert the parsed <code>Date</code> to a <code>Calendar</code>.</p>
- *
+ *
* @param value The parsed <code>Date</code> object created.
* @param formatter The Format used to parse the value with.
* @return The parsed value converted to a <code>Calendar</code>.
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java Thu Jan 5 17:45:51 2012
@@ -50,6 +50,8 @@ import org.apache.commons.validator.rout
*/
public final class CodeValidator implements Serializable {
+ private static final long serialVersionUID = 446960910870938233L;
+
private final RegexValidator regexValidator;
private final int minLength;
private final int maxLength;
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1227719&r1=1227718&r2=1227719&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Thu Jan 5 17:45:51 2012
@@ -25,12 +25,12 @@ import java.util.ArrayList;
/**
* <p>Perform credit card validations.</p>
* <p>
- * By default, all supported card types are allowed. You can specify which
- * cards should pass validation by configuring the validation options. For
+ * By default, all supported card types are allowed. You can specify which
+ * cards should pass validation by configuring the validation options. For
* example,<br/><code>CreditCardValidator ccv = new CreditCardValidator(CreditCardValidator.AMEX + CreditCardValidator.VISA);</code>
* configures the validator to only pass American Express and Visa cards.
* If a card type is not directly supported by this class, you can implement
- * the CreditCardType interface and pass an instance into the
+ * the CreditCardType interface and pass an instance into the
* <code>addAllowedCardType</code> method.
* </p>
* For a similar implementation in Perl, reference Sean M. Burke's
@@ -43,6 +43,8 @@ import java.util.ArrayList;
*/
public class CreditCardValidator implements Serializable {
+ private static final long serialVersionUID = 5955978921148959496L;
+
/**
* Option specifying that no cards are allowed. This is useful if
* you want only custom card types to validate so you turn off the
@@ -80,7 +82,7 @@ public class CreditCardValidator impleme
* Option specifying that Diners cards are allowed.
*/
public static final long DINERS = 1 << 4;
-
+
/**
* The CreditCardTypes that are allowed to pass validation.
*/
@@ -119,7 +121,7 @@ public class CreditCardValidator impleme
/**
* Create a new CreditCardValidator with the specified options.
* @param options Pass in
- * CreditCardValidator.VISA + CreditCardValidator.AMEX to specify that
+ * CreditCardValidator.VISA + CreditCardValidator.AMEX to specify that
* those are the only valid card types.
*/
public CreditCardValidator(long options) {
@@ -199,7 +201,7 @@ public class CreditCardValidator impleme
}
/**
- * Tests whether the given flag is on. If the flag is not a power of 2
+ * Tests whether the given flag is on. If the flag is not a power of 2
* (ie. 3) this tests whether the combination of flags is on.
*
* @param options The options specified.