org.japano.action
Class ListValidator

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

public class ListValidator
extends java.lang.Object
implements Validator

Validates a http parameter against a list of valid values.

Version:
$Id: ListValidator.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
ListValidator()
           
 
Method Summary
 void setValidValues(java.util.List values)
          Sets the valid values for this ListValidator
 java.lang.String validate(java.lang.String name, java.lang.String value)
          Validates the given http parameter against the list of valid values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListValidator

public ListValidator()
Method Detail

setValidValues

public void setValidValues(java.util.List values)
Sets the valid values for this ListValidator

Parameters:
values - List which contains the legal values.

validate

public java.lang.String validate(java.lang.String name,
                                 java.lang.String value)
                          throws InvalidParameterException
Validates the given http parameter against the list of valid values.

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