Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.rules
Class JboMethodValidator

java.lang.Object
  extended byoracle.jbo.rules.AbstractValidator
      extended byoracle.jbo.rules.JboAbstractValidator
          extended byoracle.jbo.rules.JboMethodValidator
All Implemented Interfaces:
JboValidatorInterface

public class JboMethodValidator
extends JboAbstractValidator
implements JboValidatorInterface

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

Field Summary
 
Fields inherited from class oracle.jbo.rules.JboAbstractValidator
mSource, mValidatingAttr, mValidatingAttrName
 
Fields inherited from class oracle.jbo.rules.AbstractValidator
mbInverse, mDescription, mErrorMessageClass, mMsgId
 
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 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 setMethodName(java.lang.String mthName)
          Sets the name of the method invoked by this validator.
 java.lang.String toString()
          Internal: For debugging purposes only.
 void validate(JboValidatorContext evObj)
          Tests the validity of an attribute value.
 boolean validateValue(java.lang.Object value)
          Validate an object by passing it to the validation method.
 
Methods inherited from class oracle.jbo.rules.JboAbstractValidator
getNewValue, getValidatingAttributeName, initialize, setNewValue, setValidatingAttribute, setValidatingAttribute, setValidatingAttributeName
 
Methods inherited from class oracle.jbo.rules.AbstractValidator
convertToJava, getDescription, getErrorMessageClass, getInverse, setDescription, setErrorMessageClass, setErrorMsgId, setInverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.jbo.rules.JboValidatorInterface
getDescription, setDescription
 

Constructor Detail

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.

Method Detail

getErrorMsgId

public java.lang.String getErrorMsgId()
Overrides:
getErrorMsgId in class AbstractValidator

validate

public void validate(JboValidatorContext evObj)
Description copied from interface: JboValidatorInterface
Tests the validity of an attribute value.

Specified by:
validate in interface JboValidatorInterface
Overrides:
validate in class JboAbstractValidator

validateValue

public boolean validateValue(java.lang.Object value)
                      throws JboException
Validate an object by passing it to the validation method.

Specified by:
validateValue in class JboAbstractValidator
Parameters:
value - the object to be validated.
Returns:
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.
Throws:
JboException - if the validation method throws an instance of JboException.

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.

toString

public java.lang.String toString()
Internal: For debugging purposes only.


Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

Copyright © 1997, 2004, Oracle. All rights reserved.