|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.intake.validator.DefaultValidator
A validator that will compare a testValue against the following constraints:
Name | Valid Values | Default Value |
---|---|---|
required | true|false | false |
mask | regexp | |
minLength | integer | 0 |
maxLength | integer |
Field Summary | |
protected org.apache.regexp.RE |
mask
|
protected java.lang.String |
maskMessage
|
protected int |
maxLength
|
protected java.lang.String |
maxLengthMessage
|
protected java.lang.String |
message
|
protected int |
minLength
|
protected java.lang.String |
minLengthMessage
|
protected boolean |
required
|
protected java.lang.String |
requiredMessage
|
Constructor Summary | |
DefaultValidator()
|
|
DefaultValidator(java.util.Map paramMap)
|
Method Summary | |
void |
assertValidity(java.lang.String testValue)
Determine whether a testValue meets the criteria specified in the constraints defined for this validator |
protected void |
doAssertValidity(java.lang.String testValue)
Method to allow subclasses to add additional validation |
java.lang.String |
getMask()
Get the value of mask. |
java.lang.String |
getMaskMessage()
Get the value of maskMessage. |
int |
getMaxLength()
Get the value of maxLength. |
java.lang.String |
getMaxLengthMessage()
Get the value of maxLengthMessage. |
java.lang.String |
getMessage()
Get the last error message resulting from invalid input. |
int |
getMinLength()
Get the value of minLength. |
java.lang.String |
getMinLengthMessage()
Get the value of minLengthMessage. |
java.lang.String |
getRequiredMessage()
Get the value of requiredMessage. |
void |
init(java.util.Map paramMap)
Extract the relevant parameters from the constraints listed in |
boolean |
isRequired()
Get the value of required. |
boolean |
isValid(java.lang.String testValue)
Determine whether a testValue meets the criteria specified in the constraints defined for this validator |
void |
setMask(java.lang.String v)
Set the value of mask. |
void |
setMaskMessage(java.lang.String v)
Set the value of maskMessage. |
void |
setMaxLength(int v)
Set the value of maxLength. |
void |
setMaxLengthMessage(java.lang.String v)
Set the value of maxLengthMessage. |
void |
setMinLength(int v)
Set the value of minLength. |
void |
setMinLengthMessage(java.lang.String v)
Set the value of minLengthMessage. |
void |
setRequired(boolean v)
Set the value of required. |
void |
setRequiredMessage(java.lang.String v)
Set the value of requiredMessage. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected boolean required
protected java.lang.String requiredMessage
protected org.apache.regexp.RE mask
protected java.lang.String maskMessage
protected int minLength
protected java.lang.String minLengthMessage
protected int maxLength
protected java.lang.String maxLengthMessage
protected java.lang.String message
Constructor Detail |
public DefaultValidator(java.util.Map paramMap) throws TurbineException
public DefaultValidator()
Method Detail |
public void init(java.util.Map paramMap) throws TurbineException
init
in interface InitableByConstraintMap
paramMap
- a Map
of Rule
's
containing constraints on the input.TurbineException
- if an error occurspublic boolean isValid(java.lang.String testValue)
isValid
in interface Validator
testValue
- a String
to be testedpublic void assertValidity(java.lang.String testValue) throws ValidationException
assertValidity
in interface Validator
testValue
- a String
to be testedValidationException
- containing an error message if the
testValue did not pass the validation tests.public java.lang.String getMessage()
getMessage
in interface Validator
String
message, or the empty String "".protected void doAssertValidity(java.lang.String testValue) throws ValidationException
public boolean isRequired()
public void setRequired(boolean v)
v
- Value to assign to required.public java.lang.String getRequiredMessage()
public void setRequiredMessage(java.lang.String v)
v
- Value to assign to requiredMessage.public java.lang.String getMask()
public void setMask(java.lang.String v) throws TurbineException
v
- Value to assign to mask.public java.lang.String getMaskMessage()
public void setMaskMessage(java.lang.String v)
v
- Value to assign to maskMessage.public int getMinLength()
public void setMinLength(int v)
v
- Value to assign to minLength.public java.lang.String getMinLengthMessage()
public void setMinLengthMessage(java.lang.String v)
v
- Value to assign to minLengthMessage.public int getMaxLength()
public void setMaxLength(int v)
v
- Value to assign to maxLength.public java.lang.String getMaxLengthMessage()
public void setMaxLengthMessage(java.lang.String v)
v
- Value to assign to maxLengthMessage.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |