Skip navigation links
oracle.jbo.rules
Class JboMethodValidator
java.lang.Object
oracle.jbo.common.NamedObjectImpl
oracle.jbo.rules.AbstractValidator
oracle.jbo.rules.JboAbstractValidator
oracle.jbo.rules.JboMethodValidator
- All Implemented Interfaces:
- DiffMergeable, DefPersistable, PersistentDefinition, JboTransValidatorInterface, JboValidatorHints, JboValidatorInterface, ValidatorConstants, VariableManagerOwner, VariableManagerOwnerBase
-
public class JboMethodValidator
- extends JboAbstractValidator
- implements JboTransValidatorInterface
A validator that tests values by passing them to a validation method.
The validation method must be public, take a single Object
parameter and return Boolean
.
- Since:
- Jdeveloper 3.0
Fields inherited from interface oracle.jbo.rules.ValidatorConstants |
ATTR, 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 Summary |
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. |
Method Summary |
void |
applyDiffContents(DifferDetails dif, DiffResolver resolver)
|
DifferDetails |
diffContents(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
|
java.lang.String |
getDefXMLElementTag()
|
java.lang.String |
getErrorMsgId()
|
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 |
initValidatorProperties(java.util.HashMap props)
|
void |
loadXMLContents(DefElement elem)
|
protected void |
prepareException(ValidationException valEx, JboValidatorContext evObj, int severity)
|
void |
raiseException(java.lang.Exception e, JboValidatorContext evObj, java.lang.String msgId, int severity)
|
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. |
void |
setTransactionLevel(boolean bTransactionLevel)
|
java.lang.String |
toString()
Internal: For debugging purposes only. |
void |
validateMany(java.util.ArrayList valCtxs)
|
boolean |
validateValue(java.lang.Object value)
Validates a value. |
boolean |
validateValueWithContext(JboValidatorContext evObj, java.lang.Object value)
Called internally by the framework with validation OnCondition is true or there is no validation OnCondition. |
void |
writeContents(DefWriter jos)
Objects should write their persistence output in this method |
Methods inherited from class oracle.jbo.rules.JboAbstractValidator |
applyValidatorPersonalization, clone, closeObject, createException, getDefXMLNameSpace, getErrorReportAttrDef, getFullName, getImageLoc, getMessageFlavor, getName, getOrigObject, getTriggeringAttributeDefs, getValidatingAttributeName, getValidatorType, getValueToValidate, getXMLElementTag, initialize, isForPersonalization, isReadOnly, resolve, setForPersonalization, setInitialized, setMessageFlavor, setName, setNewValue, setOrigObject, setValidatingAttribute, setValidatingAttribute, validate, writeObject |
Methods inherited from class oracle.jbo.rules.AbstractValidator |
applyDiffChildren, applyValidatorPersonalization, convertToJava, copyErrorMsgInfo, createAttributeException, createExprValueSupplier, createRowException, diffChildren, diffObjects, ensureDifferDetails, ensureVariableManager, getDescription, getErrorMessageClass, getErrorMsgExpressions, getErrorMsgIds, getExprValueSupplierType, getInverse, getMessageBundleClass, getOnCondition, getOwner, getResourceBundleDef, getResourceBundleId, getSeverity, getTriggeringAttributeNames, getValidatorSubType, getVariableManager, hasErrorMsg, hasValidationCondition, hasVariables, initErrMsgParms, initTriggeringAttributeDefs, isDirty, isMovedToAttrLevel, isNew, isTransactionLevel, isTransactionLevel, isValidatable, loadVariables, parseSeverityStr, raiseException, readStringArrayList, readTransientExpression, readTransientExpression, readUserObject, readUserObject, readUserObjectTrim, readUserObjectTrim, readUserStringElementsMap, setDefaultDescription, setDescription, setDirty, setErrorMessageClass, setErrorMsgExpressions, setErrorMsgId, setErrorMsgIds, setExprValueSupplierType, setInverse, setNew, setOnCondition, setResourceBundleDef, setResourceBundleId, setSeverity, setTriggeringAttributeNames, setValidatingAttributeName, setValidatorSubType, writeChildren |
Methods inherited from class oracle.jbo.common.NamedObjectImpl |
allocatePropertyMap, 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, setPropertyMap |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JboMethodValidator
public JboMethodValidator()
- Creates a validator without assigning its validation method.
JboMethodValidator
public JboMethodValidator(java.lang.String methodName,
java.lang.Class entityClz,
java.lang.Class clz)
- Creates a validator given the name of the validation method.
- Parameters:
methodName
- the name of a Java method. The method must be public, take a single Object
parameter and return Boolean
.
setObjectMethod
public 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.
prepareException
protected void prepareException(ValidationException valEx,
JboValidatorContext evObj,
int severity)
-
- Overrides:
prepareException
in class AbstractValidator
-
- For internal use only. Application developers should not use this
getErrorMsgId
public java.lang.String getErrorMsgId()
-
- Overrides:
getErrorMsgId
in class JboAbstractValidator
validateMany
public void validateMany(java.util.ArrayList valCtxs)
-
- Specified by:
validateMany
in interface JboTransValidatorInterface
- Overrides:
validateMany
in class JboAbstractValidator
validateValueWithContext
public boolean validateValueWithContext(JboValidatorContext evObj,
java.lang.Object value)
- Description copied from class:
JboAbstractValidator
- Called internally by the framework with validation OnCondition is true or there is no validation OnCondition. This method should not be directly invoked in applications.
-
- Overrides:
validateValueWithContext
in class JboAbstractValidator
raiseException
public void raiseException(java.lang.Exception e,
JboValidatorContext evObj,
java.lang.String msgId,
int severity)
-
- Overrides:
raiseException
in class JboAbstractValidator
validateValue
public boolean validateValue(java.lang.Object value)
- Description copied from class:
JboAbstractValidator
- Validates a value.
Subclasses must implement this method.
-
- Specified by:
validateValue
in class JboAbstractValidator
-
- Parameters:
value
- the object to be validated.
- Returns:
true
if the object is valid.
setMethodName
public void setMethodName(java.lang.String mthName)
- Sets the name of the method invoked by this validator.
-
- Parameters:
mthName
- the name of a Java method. The method must be public, take a single Object
parameter and return Boolean
.
getMethodName
public java.lang.String getMethodName()
- Gets the name of the method invoked by this validator.
-
- Returns:
- the name of a Java method.
getMethod
public java.lang.reflect.Method getMethod()
- Gets the method invoked by this validator.
-
- Returns:
- a
method
object, a description of a Java method.
setTransactionLevel
public void setTransactionLevel(boolean bTransactionLevel)
-
- Overrides:
setTransactionLevel
in class AbstractValidator
toString
public java.lang.String toString()
- Internal: For debugging purposes only.
-
- Overrides:
toString
in class java.lang.Object
initValidatorProperties
public void initValidatorProperties(java.util.HashMap props)
-
- Specified by:
initValidatorProperties
in interface JboValidatorHints
- Overrides:
initValidatorProperties
in class AbstractValidator
getDefXMLElementTag
public java.lang.String getDefXMLElementTag()
-
- Specified by:
getDefXMLElementTag
in interface PersistentDefinition
- Overrides:
getDefXMLElementTag
in class AbstractValidator
loadXMLContents
public void loadXMLContents(DefElement elem)
-
- Overrides:
loadXMLContents
in class JboAbstractValidator
writeContents
public void writeContents(DefWriter jos)
- Description copied from interface:
PersistentDefinition
- Objects should write their persistence output in this method
-
- Specified by:
writeContents
in interface PersistentDefinition
- Overrides:
writeContents
in class JboAbstractValidator
-
- Parameters:
jos
- the Output storage for persistence
diffContents
public DifferDetails diffContents(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
-
- Specified by:
diffContents
in interface DiffMergeable
- Overrides:
diffContents
in class JboAbstractValidator
applyDiffContents
public void applyDiffContents(DifferDetails dif,
DiffResolver resolver)
-
- Specified by:
applyDiffContents
in interface DiffMergeable
- Overrides:
applyDiffContents
in class AbstractValidator
Skip navigation links
Copyright © 1997, 2015, Oracle. All rights reserved.