|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.server.rules.JboBaseValidator
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.
Field Summary |
Type | Field |
---|---|
protected java.lang.Object |
mLValue
|
Constructor Summary |
JboBaseValidator()
|
Method Summary |
Type | Method |
---|---|
java.lang.String |
getDescription()
Gets the textul description of this validator. |
boolean |
getInverse()
Reports whether the logic of this validator is inverted. |
void |
setDescription(java.lang.String description)
Sets the textul description of this validator using a specified string. |
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. |
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 |
protected transient java.lang.Object mLValue
Constructor Detail |
public JboBaseValidator()
Method Detail |
public void vetoableChange(PropertyChangeEvent evObj) throws JboException
validateValue()
on a value contained in a constrained property.
.
evObj
- a PropertyChangeEvent
containing a property
to be validated.JboException
- if validation fails, with CSMessageBundle
error code EXC_VAL_ATTR_SET_FAILED
.public abstract boolean validateValue(java.lang.Object value) throws java.lang.Exception
Subclasses must implement this method.
value
- the object to be validated.true
if the object is valid.java.lang.Exception
- if validation cannot be performed.protected void setNewValue(java.lang.Object newValue) throws java.lang.Exception
newValue
- either the attribute's value or a value to use to compare
in the validator.public void setValidatingAttribute(AttributeDefImpl attr)
attr
- an attribute.public void setValidatingAttribute(EntityDefImpl beanInfo, java.lang.String str)
This variant is used when the validator is attached to an entity, rather than to an attribute.
beanInfo
- the entity containing the attribute.str
- an attribute name as a string.public void setInverse(boolean bInverse)
bInverse
- true
if the validation result is to be inverted,
and false
if the validation result is not to be inverted.public boolean getInverse()
true
if the validation result is inverted, and
false
if the validation result is not inverted.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- a documentation string.
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |