org.japano.action
Class RegExValidator

java.lang.Object
  extended by org.japano.action.RegExValidator
All Implemented Interfaces:
java.io.Serializable, Validator

public class RegExValidator
extends java.lang.Object
implements Validator

Validates a HTTP parameter with a regular expression.

Version:
$Id: RegExValidator.java,v 1.2 2005/09/27 21:30:50 fforw Exp $ SourceForge.net Logo
Author:
Sven Helmberger ( sven dot helmberger at gmx dot de )
See Also:
Serialized Form

Constructor Summary
RegExValidator(java.lang.String regex)
           
 
Method Summary
 java.lang.String toString()
           
 java.lang.String validate(java.lang.String name, java.lang.String value)
          Validates the value and returns it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegExValidator

public RegExValidator(java.lang.String regex)
Method Detail

validate

public java.lang.String validate(java.lang.String name,
                                 java.lang.String value)
                          throws InvalidParameterException
Description copied from interface: Validator
Validates the value and returns it. The validator may modify the value to correct simple errors.

Specified by:
validate in interface Validator
Parameters:
name - parameter name
value - parameter value to validate.
Returns:
the value which may be modified.
Throws:
InvalidParameterException - if the value is invalid.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object