|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.iscreen.BaseValidator
org.iscreen.validators.StringValidator
public class StringValidator
The StringValidator checks the length of the given value.
Field Summary | |
---|---|
protected java.lang.Integer |
maxLength
|
protected FailureMessage |
maxLengthFailure
|
protected java.lang.Integer |
minLength
|
protected FailureMessage |
minLengthFailure
|
protected FailureMessage |
nullFailure
|
Fields inherited from class org.iscreen.BaseValidator |
---|
defaultFailure |
Constructor Summary | |
---|---|
StringValidator()
Default constructor. |
Method Summary | |
---|---|
java.lang.Integer |
getMaxLength()
Retrieves the maximum required length for the string being validated. |
java.lang.Integer |
getMinLength()
Retrieves the minimum required length for the string being validated. |
void |
setMaxLength(java.lang.Integer length)
Sets the maximum required length for the string being validated. |
void |
setMaxLengthFailure(FailureMessage failure)
|
void |
setMinLength(java.lang.Integer length)
Sets the minimum required length for the string being validated. |
void |
setMinLengthFailure(FailureMessage failure)
|
void |
setNullFailure(FailureMessage failure)
|
void |
validate(ValidatorContext context,
java.lang.Object beanToValidate)
This is the method that's called to validate the "bean-to-validate." Use the passed in ValidatorContext to report validation failures, etc. |
Methods inherited from class org.iscreen.BaseValidator |
---|
constructBeanToValidate, getDefaultFailure, getStringValue, getValue, setDefaultFailure |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Integer minLength
protected java.lang.Integer maxLength
protected FailureMessage minLengthFailure
protected FailureMessage maxLengthFailure
protected FailureMessage nullFailure
Constructor Detail |
---|
public StringValidator()
Method Detail |
---|
public void validate(ValidatorContext context, java.lang.Object beanToValidate)
Validator
context
- The ValidatorContext, which is used to report failures.beanToValidate
- The JavaBean to validate.public void setMinLength(java.lang.Integer length)
length
- The minimum required lengthpublic java.lang.Integer getMinLength()
public void setMaxLength(java.lang.Integer length)
length
- The maximum required lengthpublic java.lang.Integer getMaxLength()
public void setMinLengthFailure(FailureMessage failure)
public void setMaxLengthFailure(FailureMessage failure)
public void setNullFailure(FailureMessage failure)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |