|
||||||||||
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 | +--org.apache.turbine.services.intake.validator.NumberValidator
Validates numbers with the following constraints in addition to those listed in DefaultValidator.
Name | Valid Values | Default Value |
---|---|---|
minValue | greater than BigDecimal.MIN_VALUE | |
maxValue | less than BigDecimal.MAX_VALUE | |
notANumberMessage | Some text | Entry was not a valid number |
Field Summary | |
protected java.lang.String |
invalidNumberMessage
|
protected java.lang.String |
maxValueMessage
|
protected java.lang.String |
minValueMessage
|
Fields inherited from class org.apache.turbine.services.intake.validator.DefaultValidator |
mask, maskMessage, maxLength, maxLengthMessage, message, minLength, minLengthMessage, required, requiredMessage |
Constructor Summary | |
NumberValidator()
|
|
NumberValidator(java.util.Map paramMap)
|
Method Summary | |
protected void |
doAssertValidity(java.lang.String testValue)
Determine whether a testValue meets the criteria specified in the constraints defined for this validator |
protected void |
doInit(java.util.Map paramMap)
|
protected java.lang.String |
getDefaultInvalidNumberMessage()
|
java.lang.String |
getInvalidNumberMessage()
Get the value of invalidNumberMessage. |
java.math.BigDecimal |
getMaxValueAsBigDecimal()
Get the value of maxValue. |
java.lang.String |
getMaxValueMessage()
Get the value of maxValueMessage. |
java.math.BigDecimal |
getMinValueAsBigDecimal()
Get the value of minValue. |
java.lang.String |
getMinValueMessage()
Get the value of minValueMessage. |
void |
init(java.util.Map paramMap)
Extract the relevant parameters from the constraints listed in |
void |
setInvalidNumberMessage(java.lang.String v)
Set the value of invalidNumberMessage. |
void |
setMaxValue(java.math.BigDecimal v)
Set the value of maxValue. |
void |
setMaxValueMessage(java.lang.String v)
Set the value of maxValueMessage. |
void |
setMinValue(java.math.BigDecimal v)
Set the value of minValue. |
void |
setMinValueMessage(java.lang.String v)
Set the value of minValueMessage. |
Methods inherited from class org.apache.turbine.services.intake.validator.DefaultValidator |
assertValidity, getMask, getMaskMessage, getMaxLength, getMaxLengthMessage, getMessage, getMinLength, getMinLengthMessage, getRequiredMessage, isRequired, isValid, setMask, setMaskMessage, setMaxLength, setMaxLengthMessage, setMinLength, setMinLengthMessage, setRequired, setRequiredMessage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String minValueMessage
protected java.lang.String maxValueMessage
protected java.lang.String invalidNumberMessage
Constructor Detail |
public NumberValidator(java.util.Map paramMap) throws TurbineException
public NumberValidator()
Method Detail |
public void init(java.util.Map paramMap) throws TurbineException
init
in class DefaultValidator
inputParameters
- a Map
of InputParam
's
containing constraints on the input.TurbineException
- if an error occursprotected void doInit(java.util.Map paramMap)
protected java.lang.String getDefaultInvalidNumberMessage()
protected void doAssertValidity(java.lang.String testValue) throws ValidationException
doAssertValidity
in class DefaultValidator
testValue
- a String
to be testedValidationException
- containing an error message if the
testValue did not pass the validation tests.public java.math.BigDecimal getMinValueAsBigDecimal()
public void setMinValue(java.math.BigDecimal v)
v
- Value to assign to minValue.public java.lang.String getMinValueMessage()
public void setMinValueMessage(java.lang.String v)
v
- Value to assign to minValueMessage.public java.math.BigDecimal getMaxValueAsBigDecimal()
public void setMaxValue(java.math.BigDecimal v)
v
- Value to assign to maxValue.public java.lang.String getMaxValueMessage()
public void setMaxValueMessage(java.lang.String v)
v
- Value to assign to maxValueMessage.public java.lang.String getInvalidNumberMessage()
public void setInvalidNumberMessage(java.lang.String v)
v
- Value to assign to invalidNumberMessage.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |