JboPrecisionScaleValidator insteadpublic class JboPrecisionScaleValidator extends java.lang.Object implements JbiValidator
This validator is invoked by an Entity Objects's validate() method when an attribute with defined precision or scale is modified.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_SCALE
Deprecated.
|
| Constructor and Description |
|---|
JboPrecisionScaleValidator()
Deprecated.
Creates a default validator.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescription()
Deprecated.
Gets the description of this validator.
|
int |
getPrecision()
Deprecated.
Gets the precision value.
|
int |
getScale()
Deprecated.
Gets the scale value.
|
void |
setDescription(java.lang.String description)
Deprecated.
Sets the description of this validator.
|
void |
setPrecision(int prec)
Deprecated.
Sets the precision value.
|
void |
setScale(int scale)
Deprecated.
Sets the scale value.
|
java.lang.String |
toString()
Deprecated.
Internal: Applications should not use this method.
|
boolean |
validateValue(java.lang.Object value)
Deprecated.
Tests the Entity Object against this validator's precision and scale values.
|
void |
vetoableChange(PropertyChangeEvent evObj)
Deprecated.
Validates an Entity Object by invoking validateValue().
|
public static final int DEFAULT_SCALE
public JboPrecisionScaleValidator()
Use setPrecision and setScale to configure the validatior.
public void vetoableChange(PropertyChangeEvent evObj) throws JboException
vetoableChange in interface VetoableChangeListenerevObj - an event object indicating the Entity Object to be validated.AttrSetValException - if validation fails.JboExceptionpublic boolean validateValue(java.lang.Object value)
The precision value is the maximum allowed number of digits in a number, or the number of characters in a string. The scale value, when less than zero, is the minimum number of digits following the decimal point, and when greater than zero, is the minimum number of digits preceeding the decimal point.
validateValue in interface JbiValidatorvalue - the Entity Object to be tested.public int getPrecision()
public int getScale()
public void setPrecision(int prec)
prec - the new precision value.public void setScale(int scale)
scale - the new scale value.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDescription()
getDescription in interface JbiValidatorpublic void setDescription(java.lang.String description)
setDescription in interface JbiValidatordescription - a documentation string.