|
Rational Developer for Power Systems Software V7.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.etools.iseries.ui.AbstractValidator
com.ibm.etools.iseries.ui.ComparisonRangeValidator
public class ComparisonRangeValidator
ComparisonRangeValidator extends AbstractValidator. It can perform two types of data validation:
Comparison Validation can be:
Range Validation is true if the comparing value is greater or equal to the minimum value and less than or equal to the maximum value.
In order to perform a validation, DataAttributes information must be passed to the ComparisonRangeValidator so that the comparison value (numeric or character string) is specified.
The property nullAllowed defaults to true. When no data is entered, the field will not change to reverse the image color if null conflicts with the validation. For example, if the validityCheckType is Comparison, comparisonType is GT, and comparisonValue is "abc", the null string will not be valid since it is less than "abc". But if nullAllowed is true, the field will not change to reverse the image color.
You can set a collatorStrength property to determine the level of difference considered significant in comparisons. The strengths are identical to the strength of java.text.Collator. Four strengths are allowed:
The default strength is java.text.Collator.PRIMARY. You can also set the decomposition mode of Collator. There are three levels of decomposition mode:
The default value is java.text.Collator.NO_DECOMPOSITION.
Collator,
DefaultValidator,
Validator,
Serialized Form| Field Summary | |
|---|---|
static int |
COMPARISON_EQ
Comparison type is Equal |
static int |
COMPARISON_GE
Comparison type is Greater Than and Equal |
static int |
COMPARISON_GT
Comparison type is Greater Than |
static int |
COMPARISON_LE
Comparison type is Less Than and Equal |
static int |
COMPARISON_LT
Comparison type is Less Than |
static int |
COMPARISON_NE
Comparison type is Not Equal |
static int |
COMPARISON_NG
Comparison type is Not Greater Than |
static int |
COMPARISON_NL
Comparison type is Not Less Than |
static int |
COMPARISON_NONE
Comparison type is none. |
static String |
Copyright
|
protected PropertyChangeSupport |
propertyChange
|
static int |
VALIDITYTYPE_COMPARISON
Validity check type is Comparison type. |
static int |
VALIDITYTYPE_NONE
Validity check type is none. |
static int |
VALIDITYTYPE_RANGE
Validity check type is Range type. |
| Fields inherited from interface com.ibm.etools.iseries.ui.Validator |
|---|
copyright |
| Constructor Summary | |
|---|---|
ComparisonRangeValidator()
Constructs a new ComparisonRangeValidator |
|
ComparisonRangeValidator(Attributes dataAttributes)
Constructs a new ComparisonRangeValidator with the specified DataAttributes. |
|
ComparisonRangeValidator(Attributes dataAttributes,
int validityCheckType,
int comparisonType,
String comparisonValue,
String minimumRange,
String maximumRange)
Constructs a new ComparisonRangeValidator with the specified DataAttributes, validityCheckType, comparisonType, comparisonValue, minimumRange, maximumRange. |
|
ComparisonRangeValidator(Attributes dataAttributes,
int validityCheckType,
int comparisonType,
String comparisonValue,
String minimumRange,
String maximumRange,
int collatorStrength,
int decompositionMode)
Constructs a new ComparisonRangeValidator with the specified DataAttributes, validityCheckType, comparisonType, comparisonValue, minimumRange, maximumRange, collatorStrength and decompositionMode. |
|
ComparisonRangeValidator(Attributes dataAttributes,
int validityCheckType,
int comparisonType,
String comparisonValue,
String minimumRange,
String maximumRange,
int collatorStrength,
int decompositionMode,
boolean nullAllowed)
Constructs a new ComparisonRangeValidator with the specified DataAttributes, validityCheckType, comparisonType, comparisonValue, minimumRange, maximumRange, collatorStrength, decompositionMode and nullAllowed. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
|
void |
addVetoableChangeListener(VetoableChangeListener l)
Add a vetoableChangeListener. |
static String |
Copyright()
This method returns the copyright notice for this class. |
void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
The firePropertyChange method was generated to support the propertyChange field. |
int |
getCollatorStrength()
Gets the collatorStrngth property (int) value. |
int |
getComparisonType()
Gets the comparisonType property (int) value. |
String |
getComparisonValue()
Gets the comparisonValue property (java.lang.String) value. |
Attributes |
getDataAttributes()
Gets the dataAttributes property (com.ibm.etools.iseries.ui.Attributes) value. |
int |
getDecompositionMode()
Gets the decompositionMode property (int) value. |
String |
getMaximumRange()
Gets the maximumRange property (java.lang.String) value. |
String |
getMinimumRange()
Gets the minimumRange property (java.lang.String) value. |
boolean |
getNullAllowed()
Gets the nullAllowed property (boolean) value. |
protected PropertyChangeSupport |
getPropertyChange()
Accessor for the propertyChange field. |
int |
getValidityCheckType()
Gets the validityCheckType property (int) value. |
boolean |
isDataValid(String strData)
Does validation on a string. |
void |
propertyChange(PropertyChangeEvent e)
Examine the PropertyChangeEvent and decides what to do on a particular event. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes a propertyChangeListener. |
void |
removeVetoableChangeListener(VetoableChangeListener l)
Removes a vetoableChangeListener. |
void |
setCollatorStrength(int strength)
Sets the collatorStrength property (int) value. |
void |
setComparisonType(int type)
Sets the comparisonType property (int) value. |
void |
setComparisonValue(String value)
Sets the comparisonValue property (java.lang.String) value. |
void |
setDataAttributes(Attributes a)
Sets the dataAttributes property (com.ibm.etools.iseries.ui.Attributes) value. |
void |
setDecompositionMode(int mode)
Sets the decompositionMode property (int) value. |
void |
setMaximumRange(String maxRange)
Sets the maximumRange property (java.lang.String) value. |
void |
setMinimumRange(String minRange)
Sets the minimumRange property (java.lang.String) value. |
void |
setNullAllowed(boolean allowed)
Sets the nullAllowed property (boolean) value. |
void |
setValidityCheckType(int valType)
Sets the validityCheckType property (int) value. |
void |
vetoableChange(PropertyChangeEvent e)
This method gets called when a constrained property is changed. |
| Methods inherited from class com.ibm.etools.iseries.ui.AbstractValidator |
|---|
fireVetoableChange, getVetoPropertyChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String Copyright
public static final int VALIDITYTYPE_NONE
public static final int VALIDITYTYPE_COMPARISON
public static final int VALIDITYTYPE_RANGE
public static final int COMPARISON_NONE
public static final int COMPARISON_EQ
public static final int COMPARISON_NE
public static final int COMPARISON_LT
public static final int COMPARISON_NL
public static final int COMPARISON_GT
public static final int COMPARISON_NG
public static final int COMPARISON_LE
public static final int COMPARISON_GE
protected transient PropertyChangeSupport propertyChange
| Constructor Detail |
|---|
public ComparisonRangeValidator()
public ComparisonRangeValidator(Attributes dataAttributes)
dataAttributes - com.ibm.etools.iseries.ui.Attributes
public ComparisonRangeValidator(Attributes dataAttributes,
int validityCheckType,
int comparisonType,
String comparisonValue,
String minimumRange,
String maximumRange)
dataAttributes - com.ibm.etools.iseries.ui.AttributesvalidityCheckType - intcomparisonType - intcomparisonValue - java.lang.StringminimumRange - java.lang.StringmaximumRange - java.lang.String
public ComparisonRangeValidator(Attributes dataAttributes,
int validityCheckType,
int comparisonType,
String comparisonValue,
String minimumRange,
String maximumRange,
int collatorStrength,
int decompositionMode)
dataAttributes - com.ibm.etools.iseries.ui.AttributesvalidityCheckType - intcomparisonType - intcomparisonValue - java.lang.StringminimumRange - java.lang.StringmaximumRange - java.lang.StringcollatorStrength - intdecompositionMode - int
public ComparisonRangeValidator(Attributes dataAttributes,
int validityCheckType,
int comparisonType,
String comparisonValue,
String minimumRange,
String maximumRange,
int collatorStrength,
int decompositionMode,
boolean nullAllowed)
dataAttributes - com.ibm.etools.iseries.ui.AttributesvalidityCheckType - intcomparisonType - intcomparisonValue - java.lang.StringminimumRange - java.lang.StringmaximumRange - java.lang.StringcollatorStrength - intdecompositionMode - intnullAllowed - boolean| Method Detail |
|---|
public void addPropertyChangeListener(PropertyChangeListener l)
public void addVetoableChangeListener(VetoableChangeListener l)
addVetoableChangeListener in class AbstractValidatorl - java.beans.VetoableChangeListenerpublic static String Copyright()
public void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
public int getCollatorStrength()
setCollatorStrength(int)public int getComparisonType()
setComparisonType(int)public String getComparisonValue()
setComparisonValue(java.lang.String)public Attributes getDataAttributes()
getDataAttributes in interface ValidatorgetDataAttributes in class AbstractValidatorsetDataAttributes(com.ibm.etools.iseries.ui.Attributes)public int getDecompositionMode()
setDecompositionMode(int)public String getMaximumRange()
setMaximumRange(java.lang.String)public String getMinimumRange()
setMinimumRange(java.lang.String)public boolean getNullAllowed()
setNullAllowed(boolean)protected PropertyChangeSupport getPropertyChange()
public int getValidityCheckType()
setValidityCheckType(int)public boolean isDataValid(String strData)
isDataValid in interface ValidatorisDataValid in class AbstractValidatorstrData - String
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenere - java.beans.PropertyChangeEventpublic void removePropertyChangeListener(PropertyChangeListener l)
l - PropertyChangeListenerpublic void removeVetoableChangeListener(VetoableChangeListener l)
removeVetoableChangeListener in class AbstractValidatorl - java.beans.VetoableChangeListener
public void setCollatorStrength(int strength)
throws PropertyVetoException
strength - Must be one of the values: java.text.Collator.PRIMARY,
java.text.Collator.SECONDARY, java.text.Collator.TERTIARY, java.text.Collator.IDENTICAL.
PropertyVetoExceptiongetCollatorStrength()
public void setComparisonType(int type)
throws PropertyVetoException
comparisonType - The new value for the property.
PropertyVetoExceptiongetComparisonType()public void setComparisonValue(String value)
comparisonValue - The new value for the property.getComparisonValue()
public void setDataAttributes(Attributes a)
throws PropertyVetoException
setDataAttributes in interface ValidatorsetDataAttributes in class AbstractValidatordataAttributes - The new value for the property.
PropertyVetoExceptiongetDataAttributes()
public void setDecompositionMode(int mode)
throws PropertyVetoException
strength - Must be one of the values: java.text.Collator.NO_DECOMPOSITION,
java.text.Collator.CANONICAL_DECOMPOSITION, java.text.Collator.FULL_DECOMPOSITION.
PropertyVetoExceptiongetDecompositionMode()public void setMaximumRange(String maxRange)
maximumRange - The new value for the property.getMaximumRange()public void setMinimumRange(String minRange)
minimumRange - The new value for the property.getMinimumRange()public void setNullAllowed(boolean allowed)
allowed - The new value for the property.getNullAllowed()
public void setValidityCheckType(int valType)
throws PropertyVetoException
validityCheckType - The new value for the property.
PropertyVetoExceptiongetValidityCheckType()
public void vetoableChange(PropertyChangeEvent e)
throws PropertyVetoException
vetoableChange in interface VetoableChangeListenere - java.beans.PropertyChangeEvent a PropertyChangeEvent object describing the event source and the property that has changed.
PropertyVetoException - if the recipient wishes the property change to be rolled back.
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||