|
||||||||
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.DoubleValidator
public class DoubleValidator
The Double Validation class. This class handles validation for the primitive
double
and java.lang.Double
types.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.exolab.castor.xml.validators.PatternValidator |
---|
PatternValidator.DefaultRegExpEvaluator |
Constructor Summary | |
---|---|
DoubleValidator()
Creates a new DoubleValidator with no restrictions. |
Method Summary | |
---|---|
void |
clearFixed()
Clears the fixed value for this DoubleValidator. |
void |
clearMax()
Clears the maximum value for this DoubleValidator. |
void |
clearMin()
Clears the minimum value for this DoubleValidator. |
java.lang.Double |
getFixed()
Returns the configured fixed value for double validation. |
java.lang.Double |
getMaxExclusive()
Returns the configured exclusive maximum value for double validation. |
java.lang.Double |
getMaxInclusive()
Returns the configured inclusive maximum value for double validation. |
java.lang.Double |
getMinExclusive()
Returns the configured exclusive minimum value for double validation. |
java.lang.Double |
getMinInclusive()
Returns the configured inclusive minimum value for double validation. |
boolean |
hasFixed()
Returns true if a fixed value to validate against has been set. |
void |
setFixed(double fixedValue)
Sets the fixed value for double validation. |
void |
setMaxExclusive(double maxValue)
Sets the maximum (exclusive) value for double validation. |
void |
setMaxInclusive(double maxValue)
Sets the maximum (inclusive) value for double validation. |
void |
setMinExclusive(double minValue)
Sets the minimum (exclusive) value for double validation. |
void |
setMinInclusive(double minValue)
Sets the minimum (inclusive) value for double validation. |
void |
validate(double d,
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, getPattern, getPatterns, hasPattern, isNillable, setNillable, setPattern, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleValidator()
Method Detail |
---|
public void clearFixed()
public void clearMax()
public void clearMin()
public java.lang.Double getFixed()
public java.lang.Double getMaxInclusive()
public java.lang.Double getMaxExclusive()
public java.lang.Double getMinInclusive()
public java.lang.Double getMinExclusive()
public boolean hasFixed()
public void setFixed(double fixedValue)
NOTE: If maximum and/or minimum values have been set and the fixed value is not within that max/min range, then no double will pass validation. This is as according to the XML Schema spec.
fixedValue
- the fixed value that a double validated with this validator
must be equal to.public void setMinExclusive(double minValue)
minValue
- the minimum (exclusive) value for double validation.public void setMinInclusive(double minValue)
minValue
- the minimum (inclusive) value for double validation.public void setMaxExclusive(double maxValue)
maxValue
- the maximum (exclusive) value for double validation.public void setMaxInclusive(double maxValue)
maxValue
- the maximum (inclusive) value for double validation.public void validate(double d, ValidationContext context) throws ValidationException
d
- the double 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 |