org.jwarp.service.param
Class BasicValidator
java.lang.Object
|
+--org.jwarp.service.param.AValidator
|
+--org.jwarp.service.param.BasicValidator
- All Implemented Interfaces:
- IConfigurable, IValidator
- public class BasicValidator
- extends AValidator
A validator for strings with length check
- Version:
- 1.0
- Author:
- Anatole Tresch, Martin Schaefer
|
Field Summary |
(package private) java.lang.String |
type
|
|
Constructor Summary |
BasicValidator(java.lang.String type)
A Constructor (1/2): sets min and max length |
BasicValidator(java.lang.String type,
boolean required,
boolean mayBeEmpty)
A Constructor (1/2): sets min and max length |
|
Method Summary |
void |
configure(org.jdom.Element config)
Pass the Configuration to the Configurable
class. |
java.lang.String |
getValidationClass()
Returns the class name of the class being validated. |
void |
validate(java.lang.Object value)
The validate function Checks for a string with size in given range |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
java.lang.String type
BasicValidator
public BasicValidator(java.lang.String type,
boolean required,
boolean mayBeEmpty)
- A Constructor (1/2): sets min and max length
- Parameters:
min - Minimal lengthmax - Maximal length
BasicValidator
public BasicValidator(java.lang.String type)
- A Constructor (1/2): sets min and max length
- Parameters:
min - Minimal lengthmax - Maximal length
configure
public void configure(org.jdom.Element config)
throws ConfigurationException
- Description copied from interface:
IConfigurable
- Pass the
Configuration to the Configurable
class. This method must always be called after the constructor and before any other method.- Following copied from interface:
org.jwarp.service.configuration.IConfigurable
- Parameters:
configuration - the class configurations.
validate
public void validate(java.lang.Object value)
throws ParameterException
- The validate function
Checks for a string with size in given range
- Overrides:
validate in class AValidator
- Parameters:
contens - The paramter content to be checked- Returns:
- false if check fails
getValidationClass
public java.lang.String getValidationClass()
- Returns the class name of the class being validated.
- Returns:
- the full class name