org.exolab.castor.xml.validators
Class DecimalValidator
java.lang.Object
org.exolab.castor.xml.validators.DecimalValidator
- TypeValidator
public class DecimalValidator
extends java.lang.Object
The Decimal Validation class. This class handles validation
for the Decimal type.
TODO : pattern, enumeration
$Revision: 1.3 $ $Date: 2003/03/03 17:29:36 $
void | clearMax() - Clears the maximum value for this DecimalValidator
|
void | clearMin() - Clears the minimum value for this DecimalValidator
|
BigDecimal | getFixed() - Returns the fixed value that decimals validated with this
validator must be equal to.
|
BigDecimal | getMaxInclusive() - Returns the maximum value that decimals validated with this
validator must be equal to or less than.
|
BigDecimal | getMinInclusive() - Returns the minimum value that decimals validated with this
validator must be equal to or greater than.
|
boolean | hasFixed() - Returns true if a fixed value, to validate against, has been
set.
|
void | setFixed(BigDecimal fixed) - Sets the fixed value the decimal to validate must
be equal to.
|
void | setFractionDigits(int fractionDig) - Sets the fractionDigits facet for this decimal validator.
|
void | setMaxExclusive(BigDecimal maxValue) - Sets the maximum value that decimals validated with this
validator must be less than
|
void | setMaxInclusive(BigDecimal maxValue) - Sets the maximum value that decimals validated with this
validator are allowed to be
|
void | setMinExclusive(BigDecimal minValue) - Sets the minimum value that decimals validated with this
validator must be greater than
|
void | setMinInclusive(BigDecimal minValue) - Sets the minimum value that decimals validated with this
validator are allowed to be
|
void | setTotalDigits(int totalDig) - Sets the totalDigits facet for this decimal validator.
|
void | validate(BigDecimal bd)
|
void | validate(Object object) - Validates the given Object
|
void | validate(Object object, ValidationContext context) - Validates the given Object
|
DecimalValidator
public DecimalValidator()
Creates a new DecimalValidator with no restrictions
clearMax
public void clearMax()
Clears the maximum value for this DecimalValidator
clearMin
public void clearMin()
Clears the minimum value for this DecimalValidator
getFixed
public BigDecimal getFixed()
Returns the fixed value that decimals validated with this
validator must be equal to. A null value is returned
if no fixed value has been specified.
- the fixed value to validate against.
getMaxInclusive
public BigDecimal getMaxInclusive()
Returns the maximum value that decimals validated with this
validator must be equal to or less than. A null value
is returned if no maximum value has been specified.
- the maximum inclusive value to validate against.
getMinInclusive
public BigDecimal getMinInclusive()
Returns the minimum value that decimals validated with this
validator must be equal to or greater than. A null value
is returned if no minimum value has been specified.
- the minimum inclusive value to validate against.
hasFixed
public boolean hasFixed()
Returns true if a fixed value, to validate against, has been
set.
- true if a fixed value has been set.
setFixed
public void setFixed(BigDecimal fixed)
Sets the fixed value the decimal to validate must
be equal to.
setFractionDigits
public void setFractionDigits(int fractionDig)
Sets the fractionDigits facet for this decimal validator.
fractionDig
- the value of fractionDigits (must be >=0)
setMaxExclusive
public void setMaxExclusive(BigDecimal maxValue)
Sets the maximum value that decimals validated with this
validator must be less than
maxValue
- the maximum value an decimal validated with this
validator must be less than
setMaxInclusive
public void setMaxInclusive(BigDecimal maxValue)
Sets the maximum value that decimals validated with this
validator are allowed to be
maxValue
- the maximum value an decimal validated with this
validator may be
setMinExclusive
public void setMinExclusive(BigDecimal minValue)
Sets the minimum value that decimals validated with this
validator must be greater than
minValue
- the minimum value an decimal validated with this
validator must be greater than
setMinInclusive
public void setMinInclusive(BigDecimal minValue)
Sets the minimum value that decimals validated with this
validator are allowed to be
minValue
- the minimum value an decimal validated with this
validator may be
setTotalDigits
public void setTotalDigits(int totalDig)
Sets the totalDigits facet for this decimal validator.
totalDig
- the value of totalDigits (must be >0)
validate
public void validate(Object object)
throws ValidationException
Validates the given Object
object
- the Object to validate
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com