org.exolab.castor.xml.validators
Class IntegerValidator

java.lang.Object
  extended byorg.exolab.castor.xml.validators.PatternValidator
      extended byorg.exolab.castor.xml.validators.IntegerValidator
All Implemented Interfaces:
TypeValidator

public class IntegerValidator
extends PatternValidator
implements TypeValidator

The Integer Validation class. This class handles validation for the integer type as well as all integer derived types such as positive-integer and negative-integer

Version:
$Revision: 1.8 $ $Date: 2001/12/10 22:27:42 $
Author:
Keith Visco

Nested Class Summary
 
Nested classes inherited from class org.exolab.castor.xml.validators.PatternValidator
PatternValidator.DefaultRegExpEvaluator
 
Constructor Summary
IntegerValidator()
          Creates a new IntegerValidator with no restrictions
 
Method Summary
 void clearFixed()
          Clears the fixed value for this IntegerValidator
 void clearMax()
          Clears the maximum value for this IntegerValidator
 void clearMin()
          Clears the minimum value for this IntegerValidator
 void setFixed(int fixedValue)
          Sets the fixed value that integers validated with this validated must be equal to
 void setFixed(java.lang.Integer fixedValue)
           
 void setMaxExclusive(int maxValue)
          Sets the maximum value that integers validated with this validator must be less than
 void setMaxInclusive(int maxValue)
          Sets the maximum value that integers validated with this validator are allowed to be
 void setMinExclusive(int minValue)
          Sets the minimum value that integers validated with this validator must be greater than
 void setMinInclusive(int minValue)
          Sets the minimum value that integers validated with this validator are allowed to be
 void setTotalDigits(int totalDig)
          Sets the totalDigits facet for this Integer type.
 void validate(int i)
           
 void validate(java.lang.Object object)
          Validates the given Object
 
Methods inherited from class org.exolab.castor.xml.validators.PatternValidator
getPattern, hasPattern, setPattern, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerValidator

public IntegerValidator()
Creates a new IntegerValidator with no restrictions

Method Detail

clearFixed

public void clearFixed()
Clears the fixed value for this IntegerValidator


clearMax

public void clearMax()
Clears the maximum value for this IntegerValidator


clearMin

public void clearMin()
Clears the minimum value for this IntegerValidator


setFixed

public void setFixed(int fixedValue)
Sets the fixed value that integers validated with this validated must be equal to

Parameters:
fixedValue - the fixed value an integer validated with this validator must be equal to.
NOTE: Using Fixed values takes preceedence over using max and mins, and is really the same as setting both max-inclusive and min-inclusive to the same value

setFixed

public void setFixed(java.lang.Integer fixedValue)

setMinExclusive

public void setMinExclusive(int minValue)
Sets the minimum value that integers validated with this validator must be greater than

Parameters:
minValue - the minimum value an integer validated with this validator must be greater than

setMinInclusive

public void setMinInclusive(int minValue)
Sets the minimum value that integers validated with this validator are allowed to be

Parameters:
minValue - the minimum value an integer validated with this validator may be

setMaxExclusive

public void setMaxExclusive(int maxValue)
Sets the maximum value that integers validated with this validator must be less than

Parameters:
maxValue - the maximum value an integer validated with this validator must be less than

setMaxInclusive

public void setMaxInclusive(int maxValue)
Sets the maximum value that integers validated with this validator are allowed to be

Parameters:
maxValue - the maximum value an integer validated with this validator may be

setTotalDigits

public void setTotalDigits(int totalDig)
Sets the totalDigits facet for this Integer type.

Parameters:
totalDig - the value of totalDigits (must be >0)

validate

public void validate(int i)
              throws ValidationException
Throws:
ValidationException

validate

public void validate(java.lang.Object object)
              throws ValidationException
Validates the given Object

Specified by:
validate in interface TypeValidator
Overrides:
validate in class PatternValidator
Parameters:
object - the Object to validate
Throws:
ValidationException


Intalio Inc. (C) 1999-2001. All rights reserved http://www.intalio.com