public class JboRangeValidator extends JboAbstractValidator
ValidatorConstants.MessageFlavormValidatingAttrmbInverse, mDescription, mErrorMessageClass, 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, TRIGGER_SUBTYPE_PREFIX, VALIDATION_XMLNS, VALIDATOR_MSG_ID_PREFIX, VO, VO_STR, VO_USAGE, VO_USAGE_STRXML_STATEMENT| Constructor and Description |
|---|
JboRangeValidator()
Creates an uninitialized range validator.
|
JboRangeValidator(boolean entityPropBased) |
JboRangeValidator(boolean inverse,
java.lang.Object minValue,
java.lang.Object maxValue)
Creates a range validator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyDiffContents(DifferDetails dif,
DiffResolver resolver) |
JboValidatorHints |
applyValidatorPersonalization(JboValidatorHints orgVal) |
java.lang.Object |
clone() |
DifferDetails |
diffContents(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails) |
java.lang.String |
getDefXMLElementTag() |
java.lang.Object |
getMax()
Gets the maximum value for the range.
|
java.lang.Object |
getMin()
Gets the minimum value for the range.
|
protected void |
initialize(JboValidatorContext evObj) |
void |
initValidatorProperties(java.util.HashMap props) |
void |
loadXMLContents(DefElement elem) |
void |
setMax(java.lang.Object maxValue)
Sets the maximum value for the range.
|
void |
setMin(java.lang.Object minValue)
Sets the minimum value for the range.
|
protected void |
setNewValue(java.lang.Object newValue)
after setting the new value, prepare the comparator
to be of same type if it is not already so.
|
java.lang.String |
toString()
Internal: For debugging only.
|
boolean |
validateValue(java.lang.Object value)
Validates a value.
|
boolean |
validateValueWithContext(JboValidatorContext evObj,
java.lang.Object value)
Validates that a value is in a pre-defined range.
|
void |
writeContents(DefWriter jos)
Objects should write their persistence output in this method
|
closeObject, createException, editCodeSource, ensureCodeSource, getDefXMLNameSpace, getErrorMsgId, getErrorReportAttrDef, getFullName, getImageLoc, getMessageFlavor, getName, getOrigObject, getTriggeringAttributeDefs, getValidatingAttributeName, getValidatorType, getValueToValidate, getXMLElementTag, isForPersonalization, isReadOnly, lookupExprDef, raiseException, resolve, setForPersonalization, setInitialized, setMessageFlavor, setName, setOrigObject, setValidatingAttribute, setValidatingAttribute, validate, validateMany, writeObjectapplyDiffChildren, applyValidatorPersonalization, beginDiffObjects, convertToJava, copyErrorMsgInfo, createAttributeException, createExprValueSupplier, createRowException, diffChildren, diffObjects, ensureDifferDetails, ensureVariableManager, getDescription, getErrorMessageClass, getErrorMsgExpressionDefs, getErrorMsgExpressions, getErrorMsgIds, getExprIdentifier, getExprValueSupplierType, getInverse, getMessageBundleClass, getOnCondition, getOnConditionDef, getOwner, getResourceBundleDef, getResourceBundleId, getSeverity, getTriggeringAttributeNames, getTriggerType, getValidatorSubType, getVariableManager, hasErrorMsg, hasValidationCondition, hasVariables, initErrMsgParms, initTriggeringAttributeDefs, isDirty, isMovedToAttrLevel, isNew, isTransactionLevel, isTransactionLevel, isValidatable, loadVariables, lookupMessageDef, parseSeverityStr, prepareException, raiseException, readStringArrayList, readTransientExpression, readTransientExpression, readUserObject, readUserObject, readUserObjectTrim, readUserObjectTrim, readUserStringElementsMap, setDefaultDescription, setDescription, setDirty, setErrorMessageClass, setErrorMsgExpressionDefs, setErrorMsgExpressions, setErrorMsgId, setErrorMsgIds, setExprValueSupplierType, setInverse, setNew, setOnCondition, setResourceBundleDef, setResourceBundleId, setSeverity, setTransactionLevel, setTriggeringAttributeNames, setTriggerType, setValidatingAttributeName, setValidatorSubType, writeChildrenallocatePropertyMap, getAllProperties, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionDef, 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, waitgetTriggeringAttributeNames, isTransactionLevelgetDescription, setDescriptionisDirty, isNew, setDirty, setNewwriteChildrenpublic JboRangeValidator()
The methods setMin() and setMax()
must be invoked to set the range.
public JboRangeValidator(boolean entityPropBased)
public JboRangeValidator(boolean inverse,
java.lang.Object minValue,
java.lang.Object maxValue)
inverse - if true the logic of this validator's
comparison relation is inverted.minValue - the least value of the range.maxValue - the greatest value of the range.public java.lang.Object clone()
clone in class JboAbstractValidatorprotected void initialize(JboValidatorContext evObj)
initialize in class JboAbstractValidatorprotected void setNewValue(java.lang.Object newValue)
throws java.lang.Exception
setNewValue in class JboAbstractValidatornewValue - either the attribute's value or a value to use to compare
in the validator.java.lang.Exceptionpublic boolean validateValueWithContext(JboValidatorContext evObj, java.lang.Object value)
The range is set using the setMin() and
setMax() methods.
This method is called by AbstractValidator#vetoableChange().
validateValueWithContext in class JboAbstractValidatorvalue - the object to be validated.true if the relation is in the range.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 void setMin(java.lang.Object minValue)
minValue - new minimum value.public void setMax(java.lang.Object maxValue)
maxValue - new maximum value.public java.lang.Object getMin()
public java.lang.Object getMax()
public java.lang.String toString()
toString in class java.lang.Objectpublic void initValidatorProperties(java.util.HashMap props)
initValidatorProperties in interface JboValidatorHintsinitValidatorProperties in class AbstractValidatorpublic void loadXMLContents(DefElement elem)
loadXMLContents in class JboAbstractValidatorpublic java.lang.String getDefXMLElementTag()
getDefXMLElementTag in interface PersistentDefinitiongetDefXMLElementTag in class AbstractValidatorpublic void writeContents(DefWriter jos)
PersistentDefinitionwriteContents in interface PersistentDefinitionwriteContents in class JboAbstractValidatorjos - the Output storage for persistencepublic JboValidatorHints applyValidatorPersonalization(JboValidatorHints orgVal)
applyValidatorPersonalization in interface JboValidatorHintsapplyValidatorPersonalization in class JboAbstractValidatorpublic DifferDetails diffContents(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
diffContents in interface DiffMergeablediffContents in class JboAbstractValidatorpublic void applyDiffContents(DifferDetails dif, DiffResolver resolver)
applyDiffContents in interface DiffMergeableapplyDiffContents in class AbstractValidator