public class JboPrecisionScaleValidator extends JboAbstractValidator implements JboValidatorInterface
This validator is invoked by an Entity Objects's validate() method when an attribute with defined precision or scale is modified.
ValidatorConstants.MessageFlavor| Modifier and Type | Field and Description | 
|---|---|
| static int | DEFAULT_SCALE | 
mValidatingAttrmbInverse, mDescription, mErrorMessageClass, mMsgExpr, mMsgId, mMsgIds, mResourceBundleId, mTriggeringAttributeNames, mTriggeringAttributes, mValidatingAttrNamemFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_SUFFIXATTR, ATTR_STR, BETWEEN, EO, EO_STR, EQUALTO, EXPR, EXPR_STR, GREATERTHAN, GREATERTHANEQUALTO, JBO, JBO_STR, LESSTHAN, LESSTHANEQUALTO, LITERAL, LITERAL_STR, MANDATORY_STR, mCompOperTypeVals, mRhsTypeVals, mSeverityVals, NOTEQUALTO, PNAME_CompareLength, PNAME_CompareType, PNAME_CompareValue, PNAME_DataType, PNAME_Description, PNAME_ErrorMessageExpressions, PNAME_ErrorMessageId, PNAME_ErrorMessageIds, PNAME_Exposed, PNAME_ExprValueSupplier, PNAME_ForPersonalization, PNAME_Inverse, PNAME_MessageFlavor, PNAME_Name, PNAME_OnAttribute, PNAME_OnAttributes, PNAME_OnCondition, PNAME_OperandType, PNAME_Severity, PNAME_Subtype, PNAME_TransactionLevel, PNAME_TransientExpression, PNAME_Trigger, PNAME_ValidationBeanClass, PNAME_ValName, PNAME_xmlns, PRECISION_SCALE_STR, SEVERITY_ERROR, SEVERITY_RECOVERABLE_ERROR_INDEX, SEVERITY_VETOABLE_WARNING, SEVERITY_WARNING, SQL, SQL_STR, VALIDATION_XMLNS, VALIDATOR_MSG_ID_PREFIX, VO, VO_STR, VO_USAGE, VO_USAGE_STRXML_STATEMENT| Constructor and Description | 
|---|
| JboPrecisionScaleValidator()Creates a default validator. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected PrecisionScaleValidationException | createAttributeException(int objType,
                        ResourceBundleDef resBundleDef,
                        java.lang.String errorCode,
                        java.lang.String objName,
                        java.lang.String attrName,
                        java.lang.Object newValue,
                        java.lang.String methodName,
                        java.lang.Object source)For internal framework use only | 
| java.lang.String | getDefXMLElementTag() | 
| java.lang.String | getDescription()Gets the description of this validator. | 
| java.lang.String | getErrorMsgId() | 
| int | getPrecision()Gets the precision value. | 
| int | getScale()Gets the scale value. | 
| static JboPrecisionScaleValidator | getSingleton() | 
| protected void | initialize(JboValidatorContext evObj) | 
| void | setDescription(java.lang.String description)Sets the description of this validator. | 
| void | setPrecision(int prec)Sets the precision value. | 
| void | setScale(int scale)Sets the scale value. | 
| java.lang.String | toString()Internal: Applications should not use this method. | 
| boolean | validateValue(java.lang.Object value)Validates a value. | 
| static boolean | validateValue(java.lang.Object value,
             int prec,
             int scale)Tests the Entity Object against this validator's precision and scale values. | 
| boolean | validateValueWithContext(JboValidatorContext evObj,
                        java.lang.Object value)Validates an Entity Object by invoking validateValue(). | 
applyValidatorPersonalization, clone, closeObject, createException, diffContents, getDefXMLNameSpace, getErrorReportAttrDef, getFullName, getImageLoc, getMessageFlavor, getName, getOrigObject, getTriggeringAttributeDefs, getValidatingAttributeName, getValidatorType, getValueToValidate, getXMLElementTag, isForPersonalization, isReadOnly, loadXMLContents, raiseException, resolve, setForPersonalization, setInitialized, setMessageFlavor, setName, setNewValue, setOrigObject, setValidatingAttribute, setValidatingAttribute, validate, validateMany, writeContents, writeObjectapplyDiffChildren, applyDiffContents, applyValidatorPersonalization, convertToJava, copyErrorMsgInfo, createExprValueSupplier, createRowException, diffChildren, diffObjects, ensureDifferDetails, ensureVariableManager, getErrorMessageClass, getErrorMsgExpressions, getErrorMsgIds, getExprValueSupplierType, getInverse, getMessageBundleClass, getOnCondition, getOwner, getResourceBundleDef, getResourceBundleId, getSeverity, getTriggeringAttributeNames, getValidatorSubType, getVariableManager, hasErrorMsg, hasValidationCondition, hasVariables, initErrMsgParms, initTriggeringAttributeDefs, initValidatorProperties, isDirty, isMovedToAttrLevel, isNew, isTransactionLevel, isTransactionLevel, isValidatable, loadVariables, parseSeverityStr, prepareException, raiseException, readStringArrayList, readTransientExpression, readTransientExpression, readUserObject, readUserObject, readUserObjectTrim, readUserObjectTrim, readUserStringElementsMap, setDefaultDescription, setDirty, setErrorMessageClass, setErrorMsgExpressions, setErrorMsgId, setErrorMsgIds, setExprValueSupplierType, setInverse, setNew, setOnCondition, setResourceBundleDef, setResourceBundleId, setSeverity, setTransactionLevel, setTriggeringAttributeNames, setValidatingAttributeName, setValidatorSubType, writeChildrenallocatePropertyMap, getAllProperties, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionsMap, getPropertyMap, getRawPropertyValue, getResourcesFromBundle, getStringFromMessageBundle, isPropertyExpression, mergePropertyMap, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, resolvePropertyRaw, setFullName, setParent, setPropertiesMap, setPropertiesMap2, setProperty, setProperty, setPropertyExpression, setPropertyMapequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitvalidategetTriggeringAttributeNames, initValidatorProperties, isTransactionLevelisDirty, isNew, setDirty, setNewwriteChildrenpublic static final int DEFAULT_SCALE
public JboPrecisionScaleValidator()
Use setPrecision and setScale to configure the validatior.
public static JboPrecisionScaleValidator getSingleton()
protected void initialize(JboValidatorContext evObj)
initialize in class JboAbstractValidatorpublic boolean validateValueWithContext(JboValidatorContext evObj, java.lang.Object value)
validateValueWithContext in class JboAbstractValidatorevObj - an event object indicating the Entity Object to be validated.AttrSetValException - if validation fails.public boolean validateValue(java.lang.Object value)
JboAbstractValidatorSubclasses must implement this method.
validateValue in class JboAbstractValidatorvalue - the object to be validated.true if the object is valid.public static boolean validateValue(java.lang.Object value,
                    int prec,
                    int scale)
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.
value - 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 JboValidatorInterfacegetDescription in class AbstractValidatorpublic java.lang.String getErrorMsgId()
getErrorMsgId in class JboAbstractValidatorpublic void setDescription(java.lang.String description)
setDescription in interface JboValidatorInterfacesetDescription in class AbstractValidatordescription - a documentation string.public java.lang.String getDefXMLElementTag()
getDefXMLElementTag in interface PersistentDefinitiongetDefXMLElementTag in class AbstractValidatorprotected PrecisionScaleValidationException createAttributeException(int objType, ResourceBundleDef resBundleDef, java.lang.String errorCode, java.lang.String objName, java.lang.String attrName, java.lang.Object newValue, java.lang.String methodName, java.lang.Object source)
createAttributeException in class AbstractValidator