3
Copyright 2003-2004 The Apache Software Foundation
5
Licensed under the Apache License, Version 2.0 (the "License");
6
you may not use this file except in compliance with the License.
7
You may obtain a copy of the License at
9
http://www.apache.org/licenses/LICENSE-2.0
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
21
<title>Commons</title>
26
<section name="Introduction">
29
A common issue when receiving data either electronically or from
30
user input is verifying the integrity of the data. This work is
31
repetitive and becomes even more complicated when different sets
32
of validation rules need to be applied to the same set of data based
33
on locale. Error messages may also vary by locale.
34
This package addresses some of these issues to
35
speed development and maintenance of validation rules.
39
In order to use the Validator, the following basic steps are required:
42
Create a new instance of the
43
<code>org.apache.commons.validator.Validator</code> class. Currently
44
Validator instances may be safely reused if the current
45
ValidatorResources are the same, as long as you have completed any
46
previous validation, and you do not try to utilize a particular
47
Validator instance from more than one thread at a time.
50
Add any resources needed to perform the validations, such as the
54
Call the validate method on
55
<code>org.apache.commons.validator.Validator</code>.
61
For more information, see the <a href="apidocs/index.html">JavaDocs</a>.
66
<section name="Features">
67
<p>Validator provides two distinct sets of functionality:</p>
69
<li>A configurable (typically XML) validation engine</li>
70
<li>Reusable "primitive" validation methods</li>
74
Your validation methods are plugged into the engine and
75
executed against your data. Often, these methods use
76
resources specific to one application or framework so Commons
77
Validator doesn't directly provide pluggable validator actions.
78
However, it does have a set of common validation methods
79
(email addresses, dates, URLs, etc.) that help in creating