|
||||||||
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.DurationValidator
public class DurationValidator
The Duration Validation class. This class handles validation for the Castor XML Schema duration type.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.exolab.castor.xml.validators.PatternValidator |
---|
PatternValidator.DefaultRegExpEvaluator |
Constructor Summary | |
---|---|
DurationValidator()
No-arg constructor. |
Method Summary | |
---|---|
void |
clearFixed()
Clears the fixed value for this Duration. |
void |
clearMax()
Clears the maximum value for this Duration. |
void |
clearMin()
Clears the minimum value for this Duration. |
Duration |
getFixed()
Returns the configured fixed value for Duration validation. |
Duration |
getMaxExclusive()
Returns the configured exclusive maximum value for Duration validation. |
Duration |
getMaxInclusive()
Returns the configured inclusive maximum value for Duration validation. |
Duration |
getMinExclusive()
Returns the configured exclusive minimum value for Duration validation. |
Duration |
getMinInclusive()
Returns the configured inclusive minimum value for Duration validation. |
boolean |
hasFixed()
Returns true if a fixed value to validate against has been set. |
void |
setFixed(Duration fixedValue)
Sets the fixed value for Duration validation. |
void |
setMaxExclusive(Duration maxValue)
Sets the maximum (exclusive) value for Duration validation. |
void |
setMaxInclusive(Duration maxValue)
Sets the maximum (inclusive) value for Duration validation. |
void |
setMinExclusive(Duration minValue)
Sets the minimum (exclusive) value for Duration validation. |
void |
setMinInclusive(Duration minValue)
Sets the minimum (inclusive) value for Duration validation. |
void |
validate(Duration duration)
Validate a duration instance. |
void |
validate(Duration duration,
ValidationContext context)
Validates a duration instance. |
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 DurationValidator()
Method Detail |
---|
public void clearFixed()
public void clearMax()
public void clearMin()
public Duration getFixed()
public Duration getMaxInclusive()
public Duration getMaxExclusive()
public Duration getMinInclusive()
public Duration getMinExclusive()
public boolean hasFixed()
public void setFixed(Duration fixedValue)
NOTE: If maximum and/or minimum values have been set and the fixed value is not within that max/min range, then no Duration will pass validation. This is as according to the XML Schema spec.
fixedValue
- the fixed value that a Duration validated with this
validator must be equal to.public void setMinExclusive(Duration minValue)
minValue
- the minimum (exclusive) value for Duration validation.public void setMinInclusive(Duration minValue)
minValue
- the minimum (inclusive) value for Duration validation.public void setMaxExclusive(Duration maxValue)
maxValue
- the maximum (exclusive) value for Duration validation.public void setMaxInclusive(Duration maxValue)
maxValue
- the maximum (inclusive) value for Duration validation.public void validate(Duration duration) throws ValidationException
duration
- the duration to validate
ValidationException
- if the duration fails validationpublic void validate(Duration duration, ValidationContext context) throws ValidationException
duration
- the duration type to validatecontext
- the ValidationContext
ValidationException
- if the duration fails validationpublic void validate(java.lang.Object object) throws ValidationException
object
- the Object to validate
ValidationException
- if the object fails validationpublic 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 |