org.apache.turbine.services.intake.validator
Interface Validator

All Known Implementing Classes:
DefaultValidator

public interface Validator

Validator api.

Version:
$Id$
Author:
Method Summary
 void assertValidity(java.lang.String testValue)
          Determine whether a testValue meets the criteria specified in the constraints defined for this validator
 java.lang.String getMessage()
          Get the last error message resulting from invalid input.
 void init(java.util.Map inputParameters)
          Extract the relevant parameters from the constraints listed in tags within the intake.xml file.
 boolean isValid(java.lang.String testValue)
          Determine whether a testValue meets the criteria specified in the constraints defined for this validator
 

Method Detail

init

public void init(java.util.Map inputParameters)
          throws TurbineException
Extract the relevant parameters from the constraints listed in tags within the intake.xml file.
Parameters:
inputParameters - a Map of InputParam's containing constraints on the input.
Throws:
TurbineException - if an error occurs

isValid

public boolean isValid(java.lang.String testValue)
Determine whether a testValue meets the criteria specified in the constraints defined for this validator
Parameters:
testValue - a String to be tested
Returns:
true if valid, false otherwise

assertValidity

public void assertValidity(java.lang.String testValue)
                    throws ValidationException
Determine whether a testValue meets the criteria specified in the constraints defined for this validator
Parameters:
testValue - a String to be tested
Throws:
ValidationException - containing an error message if the testValue did not pass the validation tests.

getMessage

public java.lang.String getMessage()
Get the last error message resulting from invalid input.
Returns:
a String message, or the empty String "".


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.