|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.validators.PatternValidator
org.exolab.castor.xml.validators.DecimalValidator
public class DecimalValidator
The Decimal Validation class. This class handles validation for the
BigDecimal
type.
Constructor Summary | |
---|---|
DecimalValidator()
Creates a new DecimalValidator with no restrictions. |
Method Summary | |
---|---|
void |
clearFixed()
Clears the fixed value for this BigIntegerValidator. |
void |
clearMax()
Clears the maximum value for this DecimalValidator. |
void |
clearMin()
Clears the minimum value for this DecimalValidator. |
java.math.BigDecimal |
getFixed()
Returns the configured fixed value for BigDecimal validation. |
java.math.BigDecimal |
getMaxExclusive()
Returns the configured exclusive maximum value for BigDecimal validation. |
java.math.BigDecimal |
getMaxInclusive()
Returns the configured inclusive maximum value for BigDecimal validation. |
java.math.BigDecimal |
getMinExclusive()
Returns the configured exclusive minimum value for BigDecimal validation. |
java.math.BigDecimal |
getMinInclusive()
Returns the configured inclusive minimum value for BigDecimal validation. |
boolean |
hasFixed()
Returns true if a fixed value to validate against has been set. |
void |
setFixed(java.math.BigDecimal fixedValue)
Sets the fixed value for BigDecimal validation. |
void |
setFractionDigits(int fractionDig)
Sets the maximum number of fraction digits for BigDecimal validation. |
void |
setMaxExclusive(java.math.BigDecimal maxValue)
Sets the maximum (exclusive) value for BigDecimal validation. |
void |
setMaxInclusive(java.math.BigDecimal maxValue)
Sets the maximum (inclusive) value for BigDecimal validation. |
void |
setMinExclusive(java.math.BigDecimal minValue)
Sets the minimum (exclusive) value for BigDecimal validation. |
void |
setMinInclusive(java.math.BigDecimal minValue)
Sets the minimum (inclusive) value for BigDecimal validation. |
void |
setTotalDigits(int totalDig)
Sets the maximum number of digits for BigDecimal validation. |
void |
validate(java.math.BigDecimal bd,
ValidationContext context)
Validates the given Object. |
void |
validate(java.lang.Object object)
Validates the given Object. |
void |
validate(java.lang.Object object,
ValidationContext context)
Validates the given Object. |
Methods inherited from class org.exolab.castor.xml.validators.PatternValidator |
---|
addPattern, clearPatterns, getPatterns, hasPattern, isNillable, setNillable, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DecimalValidator()
Method Detail |
---|
public void clearFixed()
public void clearMax()
public void clearMin()
public java.math.BigDecimal getFixed()
public java.math.BigDecimal getMaxInclusive()
public java.math.BigDecimal getMaxExclusive()
public java.math.BigDecimal getMinInclusive()
public java.math.BigDecimal getMinExclusive()
public boolean hasFixed()
public void setFixed(java.math.BigDecimal fixedValue)
NOTE: If maximum and/or minimum values have been set and the fixed value is not within that max/min range, then no BigDecimal will pass validation. This is as according to the XML Schema spec.
fixedValue
- the fixed value that a BigDecimal validated with this
validator must be equal to.public void setMinExclusive(java.math.BigDecimal minValue)
minValue
- the minimum (exclusive) value for BigDecimal validation.public void setMinInclusive(java.math.BigDecimal minValue)
minValue
- the minimum (inclusive) value for BigDecimal validation.public void setMaxExclusive(java.math.BigDecimal maxValue)
maxValue
- the maximum (exclusive) value for BigDecimal validation.public void setMaxInclusive(java.math.BigDecimal maxValue)
maxValue
- the maximum (inclusive) value for BigDecimal validation.public void setTotalDigits(int totalDig)
totalDig
- the maximum (inclusive) number of digits for BigDecimal
validation. (must be > 0)public void setFractionDigits(int fractionDig)
fractionDig
- the maximum (inclusive) number of fraction digits for
BigDecimal validation. (must be > 0)public void validate(java.math.BigDecimal bd, ValidationContext context) throws ValidationException
bd
- the BigDecimal to validatecontext
- the ValidationContext
ValidationException
- if the object fails validation.public void validate(java.lang.Object object) throws ValidationException
object
- the Object to validate
ValidationException
- if the object fails validation.public void validate(java.lang.Object object, ValidationContext context) throws ValidationException
validate
in interface TypeValidator
validate
in class PatternValidator
object
- the Object to validatecontext
- the ValidationContext
ValidationException
- if the object fails validation.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |