public class JboMethodValidator extends JboBaseValidator implements JbiValidator
The validation method must be public,
take a single Object parameter and return Boolean.
ValidatorConstants.MessageFlavormBindingStyle, mValidatingAttr, mValidatingAttrNamembInverse, mErrorMessageClass, mMsgExpr, mMsgId, mMsgIds, mResourceBundleId, mTriggeringAttributeNames, mTriggeringAttributesmFullName, 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_STR| Constructor and Description |
|---|
JboMethodValidator()
Creates a validator without assigning its validation method.
|
JboMethodValidator(java.lang.String methodName,
java.lang.Class entityClz,
java.lang.Class clz)
Creates a validator given the name of the validation method.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDefXMLElementTag() |
java.lang.String |
getDescription()
Gets the textul description of this validator.
|
java.lang.reflect.Method |
getMethod()
Gets the method invoked by this validator.
|
java.lang.String |
getMethodName()
Gets the name of the method invoked by this validator.
|
void |
loadXMLContents(DefElement elem) |
void |
setDescription(java.lang.String description)
Sets the textul description of this validator.
|
void |
setMethodName(java.lang.String mthName)
Sets the name of the method invoked by this validator.
|
void |
setObjectMethod(java.lang.Class entityClz,
java.lang.Class attrClaz)
This implementation finds the given method in the given
object and stores the Method reference for invocation by
validateValue.
|
java.lang.String |
toString()
Internal: For debugging purposes only.
|
boolean |
validateValue(java.lang.Object value)
Validate an object by passing it to the validation method.
|
void |
vetoableChange(PropertyChangeEvent evObj)
Invokes
validateValue() on a value contained in a constrained property. |
extractValueToValidate, getBindingStyle, initialize, raiseException, resolve, setBindingStyle, setNewValue, setValidatingAttribute, setValidatingAttributeapplyDiffChildren, applyDiffContents, applyValidatorPersonalization, clone, convertToJava, copyErrorMsgInfo, createAttributeException, createException, createExprValueSupplier, createRowException, diffChildren, diffContents, diffObjects, ensureDifferDetails, ensureVariableManager, getErrorMessageClass, getErrorMsgExpressions, getErrorMsgId, getErrorMsgIds, getExprValueSupplierType, getFullName, getInverse, getMessageBundleClass, getName, getOnCondition, getOwner, getResourceBundleDef, getResourceBundleId, getSeverity, getTriggeringAttributeDefs, getTriggeringAttributeNames, getValidatingAttributeName, getValidatorSubType, getVariableManager, hasErrorMsg, hasValidationCondition, hasVariables, initErrMsgParms, initTriggeringAttributeDefs, initValidatorProperties, isDirty, isMovedToAttrLevel, isNew, isTransactionLevel, isTransactionLevel, isValidatable, loadVariables, parseSeverityStr, prepareException, raiseException, 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, writeChildren, writeContentsallocatePropertyMap, getAllProperties, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionsMap, getPropertyMap, getRawPropertyValue, getResourcesFromBundle, getStringFromMessageBundle, isPropertyExpression, mergePropertyMap, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, resolvePropertyRaw, setFullName, setName, setParent, setPropertiesMap, setPropertiesMap2, setProperty, setProperty, setPropertyExpression, setPropertyMappublic JboMethodValidator()
public JboMethodValidator(java.lang.String methodName,
java.lang.Class entityClz,
java.lang.Class clz)
methodName - the name of a Java method. The method must be public,
take a single Object parameter and return Boolean.public void vetoableChange(PropertyChangeEvent evObj)
validateValue() on a value contained in a constrained property.
vetoableChange in interface VetoableChangeListenervetoableChange in class JboBaseValidatorevObj - a PropertyChangeEvent() containing a property
to be validated.JboException - if validation fails.public boolean validateValue(java.lang.Object value)
throws JboException
validateValue in interface JbiValidatorvalidateValue in class JboBaseValidatorvalue - the object to be validated.false if the validation method cannot be found or
if the validation method throws an exception that
is not a instance of JboException.
Otherwise, pass on the boolean value returned by the validation method.JboException - if the validation method throws an instance of
JboException.public void setMethodName(java.lang.String mthName)
mthName - the name of a Java method. The method must be public,
take a single Object parameter and return Boolean.public void setObjectMethod(java.lang.Class entityClz,
java.lang.Class attrClaz)
public java.lang.String getMethodName()
public java.lang.reflect.Method getMethod()
method object, a description of a Java method.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDescription()
getDescription in interface JbiValidatorgetDescription in class AbstractValidatorpublic void setDescription(java.lang.String description)
setDescription in interface JbiValidatorsetDescription in class AbstractValidatordescription - a documentation string.public void loadXMLContents(DefElement elem)
loadXMLContents in class JboBaseValidatorpublic java.lang.String getDefXMLElementTag()
getDefXMLElementTag in class AbstractValidator