|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.1.0) E10653-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jbo.rules.AbstractValidator
oracle.jbo.rules.JboAbstractValidator
oracle.jbo.rules.JboPrecisionScaleValidator
public class JboPrecisionScaleValidator
Implements precision and scale validation for numeric attributes and length validation for string and character attributes. The framework applies this validator to Entity Object attributes whose definitions inlcude XML metadata precision or scale values.
This validator is invoked by an Entity Objects's validate() method when an attribute with defined precision or scale is modified.
Field Summary | |
---|---|
static int |
DEFAULT_SCALE
|
Fields inherited from class oracle.jbo.rules.JboAbstractValidator |
---|
mValidatingAttr |
Fields inherited from class oracle.jbo.rules.AbstractValidator |
---|
mbInverse, mDescription, mErrorMessageClass, mMsgExpr, mMsgId, mMsgIds, mResourceBundleId, mTriggeringAttributeNames, mTriggeringAttributes, mValidatingAttrName |
Fields inherited from interface oracle.jbo.mom.xml.DefPersistable |
---|
XML_STATEMENT |
Constructor Summary | |
---|---|
JboPrecisionScaleValidator()
Creates a default validator. |
Method Summary | |
---|---|
java.lang.String |
getDefXMLElementTag()
|
java.lang.String |
getDescription()
Gets the description of this validator. |
java.lang.String |
getErrorMsgId()
|
int |
getPrecision()
Gets the precision value. |
int |
getScale()
Gets the scale value. |
static JboPrecisionScaleValidator |
getSingleton()
|
protected void |
initialize(JboValidatorContext evObj)
|
void |
setDescription(java.lang.String description)
Sets the description of this validator. |
void |
setPrecision(int prec)
Sets the precision value. |
void |
setScale(int scale)
Sets the scale value. |
java.lang.String |
toString()
Internal: Applications should not use this method. |
boolean |
validateValue(java.lang.Object value)
Validates a value. |
static boolean |
validateValue(java.lang.Object value,
int prec,
int scale)
Tests the Entity Object against this validator's precision and scale values. |
boolean |
validateValueWithContext(JboValidatorContext evObj,
java.lang.Object value)
Validates an Entity Object by invoking validateValue(). |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.jbo.rules.JboValidatorInterface |
---|
validate |
Methods inherited from interface oracle.jbo.rules.JboValidatorHints |
---|
getTriggeringAttributeNames, initValidatorProperties, isTransactionLevel |
Methods inherited from interface oracle.jbo.mom.xml.PersistentDefinition |
---|
writeChildren |
Field Detail |
---|
public static final int DEFAULT_SCALE
Constructor Detail |
---|
public JboPrecisionScaleValidator()
Use setPrecision and setScale to configure the validatior.
Method Detail |
---|
public static JboPrecisionScaleValidator getSingleton()
protected void initialize(JboValidatorContext evObj)
initialize
in class JboAbstractValidator
public boolean validateValueWithContext(JboValidatorContext evObj, java.lang.Object value)
validateValueWithContext
in class JboAbstractValidator
evObj
- an event object indicating the Entity Object to be validated.
AttrSetValException
- if validation fails.public boolean validateValue(java.lang.Object value)
JboAbstractValidator
Subclasses must implement this method.
validateValue
in class JboAbstractValidator
value
- the object to be validated.
true
if the object is valid.public static boolean validateValue(java.lang.Object value, int prec, int scale)
The precision value is the maximum allowed number of digits in a number, or the number of characters in a string. The scale value, when less than zero, is the minimum number of digits following the decimal point, and when greater than zero, is the minimum number of digits preceeding the decimal point.
value
- the Entity Object to be tested.
public int getPrecision()
public int getScale()
public void setPrecision(int prec)
prec
- the new precision value.public void setScale(int scale)
scale
- the new scale value.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDescription()
getDescription
in interface JboValidatorInterface
getDescription
in class AbstractValidator
public java.lang.String getErrorMsgId()
getErrorMsgId
in class JboAbstractValidator
public void setDescription(java.lang.String description)
setDescription
in interface JboValidatorInterface
setDescription
in class AbstractValidator
description
- a documentation string.public java.lang.String getDefXMLElementTag()
getDefXMLElementTag
in interface PersistentDefinition
getDefXMLElementTag
in class JboAbstractValidator
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.1.0) E10653-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |