TypeValidator
public class DecimalValidator extends PatternValidator implements TypeValidator
BigDecimal
type.resourceBundle
Constructor | Description |
---|---|
DecimalValidator() |
Creates a new DecimalValidator with no restrictions.
|
Modifier and Type | Method | Description |
---|---|---|
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.lang.Object object) |
Validates the given Object.
|
void |
validate(java.lang.Object object,
ValidationContext context) |
Validates the given Object.
|
void |
validate(java.math.BigDecimal bd,
ValidationContext context) |
Validates the given Object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPattern, clearPatterns, getPatterns, hasPattern, isNillable, setNillable, validate
public DecimalValidator()
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 ValidationContextValidationException
- if the object fails validation.public void validate(java.lang.Object object) throws ValidationException
object
- the Object to validateValidationException
- 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 ValidationContextValidationException
- if the object fails validation.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com