com.scooterframework.web.controller
Class ActionValidators

java.lang.Object
  extended by com.scooterframework.common.validation.Validators
      extended by com.scooterframework.web.controller.ActionValidators

public class ActionValidators
extends Validators

ActionValidators contains validation methods to validate inputs to a controller.

 Examples:
      public class PostsController extends ApplicationController {
            public void myMethod() {
                //validates that "record_id" is passed in as a http request parameter
                ActionControl.validators().validatesPresenceOf("record_id");

                //validates that the length of the "name" value is not longer than 30 chars.
                ActionControl.validators().validatesLengthMaximum("name", 30);

                //display all validation results
                System.out.println(ActionControl.currentValidationResults());
            }
        }
 


Field Summary
 
Fields inherited from class com.scooterframework.common.validation.Validators
ACCEPTED, CANNOT_BE_BLANK, CANNOT_BE_NULL, CONFIRMATION, EMAIL_PATTERN, EXCEEDING_MAXIMUM, EXCLUSION, INCLUSION, IS_EMAIL, IS_EQUALTO, IS_INSIDE, IS_LARGERTHAN, IS_LARGERTHAN_OR_EQUALTO, IS_LESSTHAN, IS_LESSTHAN_OR_EQUALTO, IS_UNIQUE, IS_WITHIN, NOT_A_NUMBER, OUTOF_RANGE, TOO_LONG, TOO_SHORT, WRONG_LENGTH
 
Constructor Summary
ActionValidators()
           
 
Method Summary
protected  java.lang.Object getData(java.lang.String key)
          Returns a value stored in either parameter scope or request scope.
protected  ValidationResults getValidationResults()
          Returns validation results.
 
Methods inherited from class com.scooterframework.common.validation.Validators
validatesAcceptanceOf, validatesAcceptanceOf, validatesAcceptanceOf, validatesConfirmationOf, validatesConfirmationOf, validatesConfirmationOf, validatesConfirmationOf, validatesExclusionOf, validatesExclusionOf, validatesExclusionOf, validatesInclusionOf, validatesInclusionOf, validatesInclusionOf, validatesIsEmail, validatesIsEmail, validatesIsNumber, validatesIsNumber, validatesLengthInRangeOf, validatesLengthInRangeOf, validatesLengthMaximum, validatesLengthMaximum, validatesLengthMinimum, validatesLengthMinimum, validatesLengthOf, validatesLengthOf, validatesNotNull, validatesNotNull, validatesNumberIsEqualTo, validatesNumberIsEqualTo, validatesNumberIsInsideRangeOf, validatesNumberIsInsideRangeOf, validatesNumberIsLargerThan, validatesNumberIsLargerThan, validatesNumberIsLargerThanOrEqualTo, validatesNumberIsLargerThanOrEqualTo, validatesNumberIsLowerThan, validatesNumberIsLowerThan, validatesNumberIsLowerThanOrEqualTo, validatesNumberIsLowerThanOrEqualTo, validatesNumberIsWithinRangeOf, validatesNumberIsWithinRangeOf, validatesNumberMaximum, validatesNumberMaximum, validatesPresenceOf, validatesPresenceOf, validatesPresenceOf, validatesPresenceOf, validatesUniqenessOf, validatesUniqenessOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionValidators

public ActionValidators()
Method Detail

getValidationResults

protected ValidationResults getValidationResults()
Returns validation results.

Specified by:
getValidationResults in class Validators
Returns:
validation results

getData

protected java.lang.Object getData(java.lang.String key)
Returns a value stored in either parameter scope or request scope.

Specified by:
getData in class Validators
Parameters:
key - a key string representing either a parameter name or a request attribute name.
Returns:
value