com.isti.util
Class CfgPropValidator

java.lang.Object
  extended by com.isti.util.CfgPropValidator

public class CfgPropValidator
extends java.lang.Object

Class CfgPropValidator defines a configuration property validator object used with the 'CfgPropItem' class.


Field Summary
 java.lang.String allowedChars
           
 java.lang.Comparable maxValueCompObj
           
 java.lang.Comparable minValueCompObj
           
 java.lang.Object[] validValuesArr
           
 java.util.Vector validValuesVec
           
 
Constructor Summary
CfgPropValidator(java.lang.Comparable minValueCompObj, java.lang.Comparable maxValueCompObj)
          Creates a validator object with minimum and maximum values.
CfgPropValidator(java.lang.Object[] objArr)
          Creates a validator object with the given set of valid values.
CfgPropValidator(java.lang.String allowedChars)
          Creates a validator object with the given set of valid values.
 
Method Summary
 boolean isMinimumNonNegative()
          Returns true if this validator contains a minimum value that forces values to be greater than or equal to zero.
 boolean validateValue(java.lang.Object valueObj)
          Validates the given value object against this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minValueCompObj

public final java.lang.Comparable minValueCompObj

maxValueCompObj

public final java.lang.Comparable maxValueCompObj

validValuesArr

public final java.lang.Object[] validValuesArr

validValuesVec

public final java.util.Vector validValuesVec

allowedChars

public final java.lang.String allowedChars
Constructor Detail

CfgPropValidator

public CfgPropValidator(java.lang.Comparable minValueCompObj,
                        java.lang.Comparable maxValueCompObj)
Creates a validator object with minimum and maximum values.

Parameters:
minValueCompObj - a "minimum" value object that implements the 'Comparable' interface (or null for no minimum).
maxValueCompObj - a "maximum" value object that implements the 'Comparable' interface (or null for no maximum).

CfgPropValidator

public CfgPropValidator(java.lang.Object[] objArr)
Creates a validator object with the given set of valid values.

Parameters:
objArr - an array of acceptable-value 'Object's.

CfgPropValidator

public CfgPropValidator(java.lang.String allowedChars)
Creates a validator object with the given set of valid values.

Parameters:
allowedChars - a String of characters allowed.
Method Detail

validateValue

public boolean validateValue(java.lang.Object valueObj)
Validates the given value object against this object.

Parameters:
valueObj - the value object to be validated.
Returns:
true if the object is considered valid, false if not.

isMinimumNonNegative

public boolean isMinimumNonNegative()
Returns true if this validator contains a minimum value that forces values to be greater than or equal to zero.

Returns:
true if this validator contains a minimum value that forces values to be greater than or equal to zero.