Oracle9i Business Components for Java API Reference
Oracle9i Jdeveloper (9.0.4)
B10391-01


oracle.jbo.server.rules
Class JboBaseValidator

java.lang.Object
  |
  +--oracle.jbo.server.rules.JboBaseValidator
Direct Known Subclasses:
JboCompareValidator, JboListValidator, JboRangeValidator

public abstract class JboBaseValidator
extends java.lang.Object

The superclass for all pre-defined validators.

This class implements the basic functionality of storing the value of either an attribute to be validated, or the entity or application module reference on which validation is to be invoked. Subclasses must provide validateValue, which performs the actual validation test.

Since:
Jdeveloper 3.0

Field Summary
protected  java.lang.Object mLValue
           
 java.lang.String MSG_BUNDLE_SUFFIX
           

 

Constructor Summary
JboBaseValidator()
           

 

Method Summary
 java.lang.String getDescription()
          Gets the textul description of this validator.
 java.lang.String getErrorMsgId()
           
 boolean getInverse()
          Reports whether the logic of this validator is inverted.
protected  void initialize()
           
protected  void raiseException(java.lang.Exception e, PropertyChangeEvent evObj)
           
 void setDescription(java.lang.String description)
          Sets the textul description of this validator using a specified string.
 void setErrorMsgId(java.lang.String msgId)
           
 void setInverse(boolean bInverse)
          Allows the logic of this validator to be inverted.
protected  void setNewValue(java.lang.Object newValue)
          When the newValue is an Entity, get the attribute's value by using the getAttribute method on the entity.
 void setValidatingAttribute(AttributeDefImpl attr)
          Sets the validating attribute.
 void setValidatingAttribute(EntityDefImpl beanInfo, java.lang.String str)
          Sets the validating attribute by name.
 void setValidatingAttributeName(java.lang.String name)
           
abstract  boolean validateValue(java.lang.Object value)
          Validates an object.
 void vetoableChange(PropertyChangeEvent evObj)
          Invokes validateValue() on a value contained in a constrained property.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

mLValue

protected transient java.lang.Object mLValue

MSG_BUNDLE_SUFFIX

public final java.lang.String MSG_BUNDLE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

JboBaseValidator

public JboBaseValidator()
Method Detail

initialize

protected void initialize()

vetoableChange

public void vetoableChange(PropertyChangeEvent evObj)
                    throws JboException
Invokes validateValue() on a value contained in a constrained property.

.

Parameters:
evObj - a PropertyChangeEvent containing a property to be validated.
Throws:
JboException - if validation fails, with CSMessageBundle error code EXC_VAL_ATTR_SET_FAILED.

raiseException

protected void raiseException(java.lang.Exception e,
PropertyChangeEvent evObj)

validateValue

public abstract boolean validateValue(java.lang.Object value)
                               throws java.lang.Exception
Validates an object.

Subclasses must implement this method.

Parameters:
value - the object to be validated.
Returns:
true if the object is valid.
Throws:
java.lang.Exception - if validation cannot be performed.

setNewValue

protected void setNewValue(java.lang.Object newValue)
                    throws java.lang.Exception
When the newValue is an Entity, get the attribute's value by using the getAttribute method on the entity. Otherwise, newValue should be a value to compare in this validator.
Parameters:
newValue - either the attribute's value or a value to use to compare in the validator.
java.lang.Exception

setValidatingAttributeName

public void setValidatingAttributeName(java.lang.String name)

setValidatingAttribute

public void setValidatingAttribute(AttributeDefImpl attr)
Sets the validating attribute.
Parameters:
attr - an attribute.

setValidatingAttribute

public void setValidatingAttribute(EntityDefImpl beanInfo,
                                   java.lang.String str)
Sets the validating attribute by name.

This variant is used when the validator is attached to an entity, rather than to an attribute.

Parameters:
beanInfo - the entity containing the attribute.
str - an attribute name as a string.

setInverse

public void setInverse(boolean bInverse)
Allows the logic of this validator to be inverted.
Parameters:
bInverse - true if the validation result is to be inverted, and false if the validation result is not to be inverted.

getInverse

public boolean getInverse()
Reports whether the logic of this validator is inverted.
Returns:
true if the validation result is inverted, and false if the validation result is not inverted.

getDescription

public java.lang.String getDescription()
Gets the textul description of this validator.
Returns:
a documentation string.

setDescription

public void setDescription(java.lang.String description)
Sets the textul description of this validator using a specified string.
Parameters:
description - a documentation string.

getErrorMsgId

public java.lang.String getErrorMsgId()

setErrorMsgId

public void setErrorMsgId(java.lang.String msgId)

Oracle9i Business Components for Java API Reference
Oracle9i Jdeveloper (9.0.4)
B10391-01


 

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