org.exolab.castor.xml.validators
Class DecimalValidator

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

public class DecimalValidator
extends java.lang.Object
implements TypeValidator

The Decimal Validation class. This class handles validation for the Decimal type. TODO : pattern, enumeration

Version:
$Revision: 1.3 $ $Date: 2001/08/01 10:16:35 $
Author:
Arnaud Blandin

Constructor Summary
DecimalValidator()
          Creates a new DecimalValidator with no restrictions
 
Method Summary
 void clearMax()
          Clears the maximum value for this DecimalValidator
 void clearMin()
          Clears the minimum value for this DecimalValidator
 void setFixed(java.math.BigDecimal fixed)
          Sets the fixed value the decimal to validate must be equal to.
 void setFractionDigits(int fractionDig)
          Sets the fractionDigits facet for this XSInteger.
 void setMaxExclusive(java.math.BigDecimal maxValue)
          Sets the maximum value that decimals validated with this validator must be less than
 void setMaxInclusive(java.math.BigDecimal maxValue)
          Sets the maximum value that decimals validated with this validator are allowed to be
 void setMinExclusive(java.math.BigDecimal minValue)
          Sets the minimum value that decimals validated with this validator must be greater than
 void setMinInclusive(java.math.BigDecimal minValue)
          Sets the minimum value that decimals validated with this validator are allowed to be
 void setTotalDigits(int totalDig)
          Sets the totalDigits facet for this XSInteger.
 void validate(java.math.BigDecimal bd)
           
 void validate(java.lang.Object object)
          Validates the given Object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecimalValidator

public DecimalValidator()
Creates a new DecimalValidator with no restrictions

Method Detail

clearMax

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


clearMin

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


setMinExclusive

public void setMinExclusive(java.math.BigDecimal minValue)
Sets the minimum value that decimals validated with this validator must be greater than

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

setMinInclusive

public void setMinInclusive(java.math.BigDecimal minValue)
Sets the minimum value that decimals validated with this validator are allowed to be

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

setMaxExclusive

public void setMaxExclusive(java.math.BigDecimal maxValue)
Sets the maximum value that decimals validated with this validator must be less than

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

setMaxInclusive

public void setMaxInclusive(java.math.BigDecimal maxValue)
Sets the maximum value that decimals validated with this validator are allowed to be

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

setTotalDigits

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

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

setFractionDigits

public void setFractionDigits(int fractionDig)
Sets the fractionDigits facet for this XSInteger.

Parameters:
fractionDig - the value of fractionDigits (must be >=0)

setFixed

public void setFixed(java.math.BigDecimal fixed)
Sets the fixed value the decimal to validate must be equal to.

Parameters:
fixed - the fixed value

validate

public void validate(java.math.BigDecimal bd)
              throws ValidationException
Throws:
ValidationException

validate

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

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


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