|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.scooterframework.common.validation.Validators
com.scooterframework.web.controller.ActionValidators
public class ActionValidators
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionValidators()
Method Detail |
---|
protected ValidationResults getValidationResults()
getValidationResults
in class Validators
protected java.lang.Object getData(java.lang.String key)
getData
in class Validators
key
- a key string representing either a parameter name or a request
attribute name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |