public class CfgPropValidator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
allowedChars |
java.lang.Comparable |
maxValueCompObj |
java.lang.Comparable |
minValueCompObj |
java.lang.Object[] |
validValuesArr |
java.util.Vector |
validValuesVec |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isAllowAll()
Returns true if this validator allows all values.
|
boolean |
isMinimumNonNegative()
Returns true if this validator contains a minimum value that forces
values to be greater than or equal to zero.
|
void |
setAllowAll(boolean b)
Set the allow all values flag.
|
boolean |
validateValue(java.lang.Object valueObj)
Validates the given value object against this object.
|
public final java.lang.Comparable minValueCompObj
public final java.lang.Comparable maxValueCompObj
public final java.lang.Object[] validValuesArr
public final java.util.Vector validValuesVec
public final java.lang.String allowedChars
public CfgPropValidator(java.lang.Comparable minValueCompObj, java.lang.Comparable maxValueCompObj)
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).public CfgPropValidator(java.lang.Object[] objArr)
objArr
- an array of acceptable-value 'Object's.public CfgPropValidator(java.lang.String allowedChars)
allowedChars
- a String of characters allowed.public boolean validateValue(java.lang.Object valueObj)
valueObj
- the value object to be validated.public boolean isAllowAll()
public boolean isMinimumNonNegative()
public void setAllowAll(boolean b)
b
- true if this validator allows all values.