diff --git a/src/example/org/apache/commons/validator/example/ValidateBean.java b/src/example/org/apache/commons/validator/example/ValidateBean.java index 67c648318..696b6d8c2 100644 --- a/src/example/org/apache/commons/validator/example/ValidateBean.java +++ b/src/example/org/apache/commons/validator/example/ValidateBean.java @@ -16,7 +16,7 @@ */ package org.apache.commons.validator.example; -/** +/** * A simple bean to use with the Validator Example. */ public class ValidateBean { @@ -26,31 +26,31 @@ public class ValidateBean { public void setLastName(String lastName) { this.lastName = lastName; } - + public void setFirstName(String firstName) { this.firstName = firstName; } - + public void setStreet1(String street1) { this.street1 = street1; } - + public void setStreet2(String street2) { this.street2 = street2; } - + public void setCity(String city) { this.city = city; } - + public void setState(String state) { this.state = state; } - + public void setPostalCode(String postalCode) { this.postalCode = postalCode; } - + public void setAge(String age) { this.age = age; } @@ -58,31 +58,31 @@ public void setAge(String age) { public String getLastName() { return this.lastName; } - + public String getFirstName() { return this.firstName; } - + public String getStreet1() { return this.street1; } - + public String getStreet2() { return this.street2; } - + public String getCity() { return this.city; } - + public String getState() { return this.state; } - + public String getPostalCode() { return this.postalCode; } - + public String getAge() { return this.age; } diff --git a/src/example/org/apache/commons/validator/example/ValidateExample.java b/src/example/org/apache/commons/validator/example/ValidateExample.java index 74992b60a..b53aaecb4 100644 --- a/src/example/org/apache/commons/validator/example/ValidateExample.java +++ b/src/example/org/apache/commons/validator/example/ValidateExample.java @@ -33,8 +33,8 @@ import org.apache.commons.validator.ValidatorResults; import org.xml.sax.SAXException; -/** - *
A simple example of setting up and using the Validator.
+/** + *A simple example of setting up and using the Validator.
* * This simple example shows all the steps needed to set up and use * the Validator. Note that in most cases, some kind of framework @@ -46,8 +46,8 @@ public class ValidateExample { /** - * We need a resource bundle to get our field names and errors messages - * from. Note that this is not strictly required to make the Validator + * We need a resource bundle to get our field names and errors messages + * from. Note that this is not strictly required to make the Validator * work, but is a good coding practice. */ private static ResourceBundle apps = @@ -60,12 +60,12 @@ public class ValidateExample { */ public static void main(String[] args) throws ValidatorException, IOException, SAXException { - + InputStream in = null; ValidatorResources resources = null; - + try { - + // Create a new instance of a ValidatorResource, then get a stream // handle on the XML file with the actions in it, and initialize the // resources from it. This would normally be done by a servlet @@ -73,33 +73,33 @@ public static void main(String[] args) // routine. in = ValidateExample.class.getResourceAsStream("validator-example.xml"); resources = new ValidatorResources(in); - + } finally { // Make sure we close the input stream. if (in != null) { in.close(); } } - + // Create a test bean to validate against. ValidateBean bean = new ValidateBean(); - + // Create a validator with the ValidateBean actions for the bean // we're interested in. Validator validator = new Validator(resources, "ValidateBean"); - + // Tell the validator which bean to validate against. validator.setParameter(Validator.BEAN_PARAM, bean); - + ValidatorResults results = null; - + // Run the validation actions against the bean. Since all of the properties // are null, we expect them all to error out except for street2, which has // no validations (it's an optional property) - + results = validator.validate(); printResults(bean, results, resources); - + // Now set all the required properties, but make the age a non-integer. // You'll notice that age will pass the required test, but fail the int // test. @@ -112,12 +112,12 @@ public static void main(String[] args) bean.setAge("Too Old"); results = validator.validate(); printResults(bean, results, resources); - + // Now only report failed fields validator.setOnlyReturnErrors(true); results = validator.validate(); printResults(bean, results, resources); - + // Now everything should pass. validator.setOnlyReturnErrors(false); bean.setAge("123"); @@ -132,7 +132,7 @@ public static void printResults( ValidateBean bean, ValidatorResults results, ValidatorResources resources) { - + boolean success = true; // Start by getting the form for the current locale and Bean. diff --git a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java index d34544229..c93b7b91e 100644 --- a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java +++ b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java @@ -143,7 +143,7 @@ public RegexValidator getRegexValidator() { * Note: the IBAN PDF registry file implies that IBANs can contain lower-case letters. * However, several other documents state that IBANs must be upper-case only. * [See the comment block following this array.] - * + * * In the Regexes below, only upper-case is used. */ private static final Validator[] DEFAULT_VALIDATORS = { //