|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jbo.common.NamedObjectImpl oracle.jbo.rules.AbstractValidator oracle.jbo.server.rules.JboBaseValidator oracle.jbo.server.rules.JboMethodValidator
public class JboMethodValidator
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
.
Field Summary |
---|
Fields inherited from class oracle.jbo.server.rules.JboBaseValidator |
---|
mBindingStyle, mValidatingAttr, mValidatingAttrName |
Fields inherited from class oracle.jbo.rules.AbstractValidator |
---|
mbInverse, mErrorMessageClass, mMsgExpr, mMsgId, mMsgIds, mResourceBundleId, mTriggeringAttributeNames, mTriggeringAttributes |
Fields inherited from class oracle.jbo.common.NamedObjectImpl |
---|
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX |
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 | |
---|---|
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. |
Methods inherited from class oracle.jbo.server.rules.JboBaseValidator |
---|
extractValueToValidate, getBindingStyle, initialize, raiseException, resolve, setBindingStyle, setNewValue, setValidatingAttribute, setValidatingAttribute |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public 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
.Method Detail |
---|
public void vetoableChange(PropertyChangeEvent evObj)
validateValue()
on a value contained in a constrained property.
vetoableChange
in interface VetoableChangeListener
vetoableChange
in class JboBaseValidator
evObj
- a PropertyChangeEvent()
containing a property
to be validated.
JboException
- if validation fails.public boolean validateValue(java.lang.Object value) throws JboException
validateValue
in interface JbiValidator
validateValue
in class JboBaseValidator
value
- 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.Object
public java.lang.String getDescription()
getDescription
in interface JbiValidator
getDescription
in class AbstractValidator
public void setDescription(java.lang.String description)
setDescription
in interface JbiValidator
setDescription
in class AbstractValidator
description
- a documentation string.public void loadXMLContents(DefElement elem)
loadXMLContents
in class JboBaseValidator
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |