|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.7.0) E10653-08 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jbo.common.NamedObjectImpl
oracle.jbo.rules.AbstractValidator
oracle.jbo.rules.JboAbstractValidator
oracle.jbo.rules.JboLengthValidator
public class JboLengthValidator
A validator that tests the length of the attribute values by comparing them with a pre-defined length value.
The length to be validated is designated as the left-hand operand of a relation operation. The validator provides the right-hand operand, the comparison datatype and the relation operator.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface oracle.jbo.rules.ValidatorConstants |
---|
ValidatorConstants.MessageFlavor |
Field Summary | |
---|---|
static int |
BETWEEN
|
static int |
BYTE
|
static int |
CHARACTER
|
static java.lang.String[] |
dataTypeVals
|
static int |
EQUALTO
|
static int |
GREATERTHAN
|
static int |
GREATERTHANEQUALTO
|
static int |
LESSTHAN
|
static int |
LESSTHANEQUALTO
|
protected int |
mDataType
|
protected int |
mMaxLength
|
protected int |
mMinLength
|
protected int |
mOperType
|
static java.lang.String[] |
operTypeVals
|
protected java.lang.Object |
rhsValue
|
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 class oracle.jbo.common.NamedObjectImpl |
---|
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX |
Fields inherited from interface oracle.jbo.mom.xml.DefPersistable |
---|
XML_STATEMENT |
Constructor Summary | |
---|---|
JboLengthValidator()
Creates an uninitialized length validator. |
|
JboLengthValidator(boolean propBased)
|
|
JboLengthValidator(boolean inverse,
int operType,
int dataType,
java.lang.Object rhsValue)
Creates an initialized length validator. |
Method Summary | |
---|---|
static int |
convertDataType(java.lang.String typeArg)
Interprets a string as one of the comparison datatype constants defined in this class. |
static int |
convertOperType(java.lang.String typeArg)
Interprets a string as one of the comparison operator constants defined in this class. |
int |
getDataType()
Gets this validator's comparison datatype. |
java.lang.String |
getDefXMLElementTag()
|
int |
getMaxLength()
|
int |
getMinLength()
|
java.lang.String |
getOperatorTypeString()
Converts this validator's comparison operator to its symbolic form. |
int |
getOperType()
Gets this validator's comparison operator. |
java.lang.Object |
getRhsValue()
Gets the right-side operand of this validator's expression. |
protected void |
initialize(JboValidatorContext evObj)
|
void |
initValidatorProperties(java.util.HashMap props)
|
void |
loadXMLContents(DefElement elem)
|
static int |
parseOperatorTypeStr(java.lang.String str)
|
void |
setDataType(int typeArg)
Sets this validator's comparison datatype. |
void |
setMaxLength(int maxLength)
|
void |
setMinLength(int minLength)
|
void |
setOperType(int typeArg)
Sets this validator's comparison operator. |
void |
setRhsValue(java.lang.Object rhsValueArg)
Sets the right-side operand of this validator's expression. |
java.lang.String |
toString()
Internal: For debugging purposes only. |
boolean |
validateValue(java.lang.Object value)
Validate an object by comparing its length with a pre-defined length value. |
boolean |
validateValueWithContext(JboValidatorContext evObj,
java.lang.Object value)
Called internally by the framework with validation OnCondition is true or there is no validation OnCondition. |
void |
writeContents(DefWriter jos)
Objects should write their persistence output in this method |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.jbo.rules.JboValidatorHints |
---|
getTriggeringAttributeNames, isTransactionLevel |
Methods inherited from interface oracle.jbo.rules.JboValidatorInterface |
---|
getDescription, setDescription |
Methods inherited from interface oracle.jbo.mom.xml.DefPersistable |
---|
isDirty, isNew, setDirty, setNew |
Methods inherited from interface oracle.jbo.mom.xml.PersistentDefinition |
---|
writeChildren |
Field Detail |
---|
public static final int EQUALTO
public static final int LESSTHAN
public static final int GREATERTHAN
public static final int LESSTHANEQUALTO
public static final int GREATERTHANEQUALTO
public static final int BETWEEN
public static final java.lang.String[] operTypeVals
public static final java.lang.String[] dataTypeVals
protected int mOperType
public static final int CHARACTER
public static final int BYTE
protected int mDataType
protected java.lang.Object rhsValue
protected int mMinLength
protected int mMaxLength
Constructor Detail |
---|
public JboLengthValidator()
The methods setOperType()
,setDataType()
and setRhsValue()
must be invoked before validation can be performed.
public JboLengthValidator(boolean propBased)
public JboLengthValidator(boolean inverse, int operType, int dataType, java.lang.Object rhsValue)
inverse
- if true
the logic of this validator's
comparison relation is inverted.operType
- this validator's comparison operator;
one of the comparison operator constants defined in this class.dataType
- this validator's comparison datatype;
one of the datatype constants defined in this class.rhsValue
- this validator's right-hand operand,
a reference object containing a numeric value.Method Detail |
---|
protected void initialize(JboValidatorContext evObj)
initialize
in class JboAbstractValidator
public boolean validateValue(java.lang.Object value)
The length of the value
parameter is the left-hand
operand of this validator's comparison relation.
The operator is set by setOperType()
and the right-hand operand is the value set by setRhsValue()
.
This method is called by AbstractValidator#vetoableChange()
.
validateValue
in class JboAbstractValidator
value
- the object whose length is to be validated.
true
if the relation holds, or
false
if the relation does not hold or
if the operator or an operand is invalid or uninitialized.public boolean validateValueWithContext(JboValidatorContext evObj, java.lang.Object value)
JboAbstractValidator
validateValueWithContext
in class JboAbstractValidator
public void setOperType(int typeArg)
typeArg
- one of the comparison operator constants defined in this class.public int getOperType()
public void setDataType(int typeArg)
typeArg
- one of the datatype constants defined in this class.public int getDataType()
public void setRhsValue(java.lang.Object rhsValueArg)
rhsValueArg
- a reference object containing a numeric value.public java.lang.Object getRhsValue()
public int getMinLength()
public void setMinLength(int minLength)
public int getMaxLength()
public void setMaxLength(int maxLength)
public java.lang.String toString()
toString
in class java.lang.Object
public static int convertOperType(java.lang.String typeArg)
typeArg
- a string, the textual name of a comparison operator.
EQUALTO
.public static int convertDataType(java.lang.String typeArg)
typeArg
- a string, the textual name of a comparison datatype.
CHARACTER
.public static int parseOperatorTypeStr(java.lang.String str)
public java.lang.String getOperatorTypeString()
public void initValidatorProperties(java.util.HashMap props)
initValidatorProperties
in interface JboValidatorHints
initValidatorProperties
in class AbstractValidator
public void loadXMLContents(DefElement elem)
loadXMLContents
in class JboAbstractValidator
public java.lang.String getDefXMLElementTag()
getDefXMLElementTag
in interface PersistentDefinition
getDefXMLElementTag
in class JboAbstractValidator
public void writeContents(DefWriter jos)
PersistentDefinition
writeContents
in interface PersistentDefinition
writeContents
in class JboAbstractValidator
jos
- the Output storage for persistence
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.7.0) E10653-08 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |