org.exolab.castor.xml.validators
Class ShortValidator

java.lang.Object
  extended by org.exolab.castor.xml.validators.PatternValidator
      extended by org.exolab.castor.xml.validators.ShortValidator
All Implemented Interfaces:
TypeValidator

public class ShortValidator
extends PatternValidator
implements TypeValidator

The Short Validation class. This class handles validation for the short type.

Version:
$Revision: 1.2 $ $Date: 2003/03/03 09:57:21 $
Author:
Keith Visco, Arnaud Blandin

Nested Class Summary
 
Nested classes/interfaces inherited from class org.exolab.castor.xml.validators.PatternValidator
PatternValidator.DefaultRegExpEvaluator
 
Constructor Summary
ShortValidator()
          Creates a new ShortValidator with no restrictions
 
Method Summary
 void clearFixed()
          Clears the fixed value for this ShortValidator
 void clearMax()
          Clears the maximum value for this ShortValidator
 void clearMin()
          Clears the minimum value for this ShortValidator
 java.lang.Short getFixed()
          Returns the fixed value that shorts validated with this validator must be equal to.
 java.lang.Short getMaxInclusive()
          Returns the maximum value that shorts validated with this validator must be equal to or less than.
 java.lang.Short getMinInclusive()
          Returns the minimum value that shorts validated with this validator must be equal to or greater than.
 boolean hasFixed()
          Returns true if a fixed value, to validate against, has been set.
 void setFixed(short fixedValue)
          Sets the fixed value that shorts validated with this validated must be equal to
 void setMaxExclusive(short maxValue)
          Sets the maximum value that shorts validated with this validator must be less than
 void setMaxInclusive(short maxValue)
          Sets the maximum value that shorts validated with this validator are allowed to be
 void setMinExclusive(short minValue)
          Sets the minimum value that shorts validated with this validator must be greater than
 void setMinInclusive(short minValue)
          Sets the minimum value that shorts validated with this validator are allowed to be
 void validate(java.lang.Object object)
          Validates the given Object
 void validate(java.lang.Object object, ValidationContext context)
          Validates the given Object
 void validate(short s, ValidationContext context)
           
 
Methods inherited from class org.exolab.castor.xml.validators.PatternValidator
getPattern, 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

ShortValidator

public ShortValidator()
Creates a new ShortValidator with no restrictions

Method Detail

clearFixed

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


clearMax

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


clearMin

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


getFixed

public java.lang.Short getFixed()
Returns the fixed value that shorts validated with this validator must be equal to. A null value is returned if no fixed value has been specified.

Returns:
the fixed value to validate against.

getMaxInclusive

public java.lang.Short getMaxInclusive()
Returns the maximum value that shorts validated with this validator must be equal to or less than. A null value is returned if no maximum value has been specified.

Returns:
the maximum inclusive value to validate against.

getMinInclusive

public java.lang.Short getMinInclusive()
Returns the minimum value that shorts validated with this validator must be equal to or greater than. A null value is returned if no minimum value has been specified.

Returns:
the minimum inclusive value to validate against.

hasFixed

public boolean hasFixed()
Returns true if a fixed value, to validate against, has been set.

Returns:
true if a fixed value has been set.

setFixed

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

Parameters:
fixedValue - the fixed value a short 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

setMinExclusive

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

Parameters:
minValue - the minimum value a short validated with this validator must be greater than

setMinInclusive

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

Parameters:
minValue - the minimum value a short validated with this validator may be

setMaxExclusive

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

Parameters:
maxValue - the maximum value a short validated with this validator must be less than

setMaxInclusive

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

Parameters:
maxValue - the maximum value a short validated with this validator may be

validate

public void validate(short s,
                     ValidationContext context)
              throws ValidationException
Throws:
ValidationException

validate

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

Parameters:
object - the Object to validate
Throws:
ValidationException

validate

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

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


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