Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.4.0)

E10653-05

oracle.jbo.rules
Class JboLengthValidator

java.lang.Object
  extended by oracle.jbo.common.NamedObjectImpl
      extended by oracle.jbo.rules.AbstractValidator
          extended by oracle.jbo.rules.JboAbstractValidator
              extended by oracle.jbo.rules.JboLengthValidator
All Implemented Interfaces:
DefPersistable, PersistentDefinition, JboValidatorHints, JboValidatorInterface, ValidatorConstants, VariableManagerOwner, VariableManagerOwnerBase

public class JboLengthValidator
extends JboAbstractValidator

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.

Since:
Jdeveloper 3.0

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.rules.ValidatorConstants
ATTR, ATTR_STR, EO, EO_STR, EXPR, EXPR_STR, JBO, JBO_STR, LITERAL, LITERAL_STR, MANDATORY_STR, mCompOperTypeVals, mRhsTypeVals, mSeverityVals, NOTEQUALTO, PNAME_CompareLength, PNAME_CompareType, PNAME_CompareValue, PNAME_DataType, PNAME_Description, PNAME_ErrorMessageExpressions, PNAME_ErrorMessageId, PNAME_ErrorMessageIds, PNAME_Exposed, PNAME_ExprValueSupplier, PNAME_ForPersonalization, PNAME_Inverse, PNAME_Name, PNAME_OnAttribute, PNAME_OnAttributes, PNAME_OnCondition, PNAME_OperandType, PNAME_Severity, PNAME_Subtype, PNAME_TransactionLevel, PNAME_TransientExpression, PNAME_Trigger, PNAME_ValidationBeanClass, PNAME_ValName, PNAME_xmlns, PRECISION_SCALE_STR, SEVERITY_ERROR, SEVERITY_RECOVERABLE_ERROR, SEVERITY_VETOABLE_WARNING, SEVERITY_WARNING, SQL, SQL_STR, VALIDATION_XMLNS, VALIDATOR_MSG_ID_PREFIX, VO, VO_STR, VO_USAGE, VO_USAGE_STR
 
Fields inherited from interface oracle.jbo.mom.xml.DefPersistable
XML_STATEMENT
 
Constructor Summary
JboLengthValidator()
          Creates an uninitialized length validator.
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.
 void writeContents(DefWriter jos)
          Objects should write their persistence output in this method
 
Methods inherited from class oracle.jbo.rules.JboAbstractValidator
applyValidatorPersonalization, clone, closeObject, getDefXMLNameSpace, getErrorMsgId, getErrorReportAttrDef, getFullName, getImageLoc, getName, getOrigObject, getTriggeringAttributeDefs, getValidatingAttributeName, getValidatorType, getValueToValidate, getXMLElementTag, isForPersonalization, isReadOnly, raiseException, resolve, setForPersonalization, setInitialized, setName, setNewValue, setOrigObject, setValidatingAttribute, setValidatingAttribute, validate, validateMany, validateValueWithContext, writeObject
 
Methods inherited from class oracle.jbo.rules.AbstractValidator
applyValidatorPersonalization, convertToJava, copyErrorMsgInfo, createException, createExprValueSupplier, ensureVariableManager, getDescription, getErrorMessageClass, getErrorMsgExpressions, getErrorMsgIds, getExprValueSupplierType, getInverse, getMessageBundleClass, getOnCondition, getOwner, getResourceBundleDef, getResourceBundleId, getSeverity, getTriggeringAttributeNames, getValidatorSubType, getVariableManager, hasErrorMsg, hasValidationCondition, hasVariables, initErrMsgParms, initTriggeringAttributeDefs, isDirty, isMovedToAttrLevel, isNew, isTransactionLevel, isTransactionLevel, isValidatable, loadVariables, parseSeverityStr, prepareException, raiseException, readStringArrayList, readTransientExpression, readUserObject, readUserObject, readUserObjectTrim, readUserObjectTrim, readUserStringElementsMap, setDefaultDescription, setDescription, setDirty, setErrorMessageClass, setErrorMsgExpressions, setErrorMsgId, setErrorMsgIds, setExprValueSupplierType, setInverse, setNew, setOnCondition, setResourceBundleDef, setResourceBundleId, setSeverity, setTransactionLevel, setTriggeringAttributeNames, setValidatingAttributeName, writeChildren
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
allocatePropertyMap, getAllProperties, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionsMap, getPropertyMap, getResourcesFromBundle, getStringFromMessageBundle, isPropertyExpression, mergePropertyMap, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, resolvePropertyRaw, setFullName, setParent, setPropertiesMap, setPropertiesMap2, setProperty, setProperty, setPropertyExpression, setPropertyMap
 
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

EQUALTO

public static final int EQUALTO
See Also:
Constant Field Values

LESSTHAN

public static final int LESSTHAN
See Also:
Constant Field Values

GREATERTHAN

public static final int GREATERTHAN
See Also:
Constant Field Values

LESSTHANEQUALTO

public static final int LESSTHANEQUALTO
See Also:
Constant Field Values

GREATERTHANEQUALTO

public static final int GREATERTHANEQUALTO
See Also:
Constant Field Values

BETWEEN

public static final int BETWEEN
See Also:
Constant Field Values

operTypeVals

public static final java.lang.String[] operTypeVals

dataTypeVals

public static final java.lang.String[] dataTypeVals

mOperType

protected int mOperType

CHARACTER

public static final int CHARACTER
See Also:
Constant Field Values

BYTE

public static final int BYTE
See Also:
Constant Field Values

mDataType

protected int mDataType

rhsValue

protected java.lang.Object rhsValue

mMinLength

protected int mMinLength

mMaxLength

protected int mMaxLength
Constructor Detail

JboLengthValidator

public JboLengthValidator()
Creates an uninitialized length validator.

The methods setOperType() ,setDataType() and setRhsValue() must be invoked before validation can be performed.


JboLengthValidator

public JboLengthValidator(boolean inverse,
                          int operType,
                          int dataType,
                          java.lang.Object rhsValue)
Creates an initialized length validator.

Parameters:
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

initialize

protected void initialize(JboValidatorContext evObj)
Overrides:
initialize in class JboAbstractValidator

validateValue

public boolean validateValue(java.lang.Object value)
Validate an object by comparing its length with a pre-defined length 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().

Specified by:
validateValue in class JboAbstractValidator
Parameters:
value - the object whose length is to be validated.
Returns:
true if the relation holds, or false if the relation does not hold or if the operator or an operand is invalid or uninitialized.

setOperType

public void setOperType(int typeArg)
Sets this validator's comparison operator.

Parameters:
typeArg - one of the comparison operator constants defined in this class.

getOperType

public int getOperType()
Gets this validator's comparison operator.


setDataType

public void setDataType(int typeArg)
Sets this validator's comparison datatype.

Parameters:
typeArg - one of the datatype constants defined in this class.

getDataType

public int getDataType()
Gets this validator's comparison datatype.


setRhsValue

public void setRhsValue(java.lang.Object rhsValueArg)
Sets the right-side operand of this validator's expression.

Parameters:
rhsValueArg - a reference object containing a numeric value.

getRhsValue

public java.lang.Object getRhsValue()
Gets the right-side operand of this validator's expression.


getMinLength

public int getMinLength()

setMinLength

public void setMinLength(int minLength)

getMaxLength

public int getMaxLength()

setMaxLength

public void setMaxLength(int maxLength)

toString

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

Overrides:
toString in class java.lang.Object

convertOperType

public static int convertOperType(java.lang.String typeArg)
Interprets a string as one of the comparison operator constants defined in this class.

Parameters:
typeArg - a string, the textual name of a comparison operator.
Returns:
a comparison operator constant. An unrecognizable string defaults to EQUALTO.

convertDataType

public static int convertDataType(java.lang.String typeArg)
Interprets a string as one of the comparison datatype constants defined in this class.

Parameters:
typeArg - a string, the textual name of a comparison datatype.
Returns:
a comparison datatype constant. An unrecognizable string defaults to CHARACTER.

parseOperatorTypeStr

public static int parseOperatorTypeStr(java.lang.String str)

getOperatorTypeString

public java.lang.String getOperatorTypeString()
Converts this validator's comparison operator to its symbolic form.

Returns:
a comparison symbol. If the comparison operator is uninitialized or invalid the null string is returned.

initValidatorProperties

public void initValidatorProperties(java.util.HashMap props)
Specified by:
initValidatorProperties in interface JboValidatorHints
Overrides:
initValidatorProperties in class AbstractValidator

loadXMLContents

public void loadXMLContents(DefElement elem)
Overrides:
loadXMLContents in class JboAbstractValidator

getDefXMLElementTag

public java.lang.String getDefXMLElementTag()
Specified by:
getDefXMLElementTag in interface PersistentDefinition
Specified by:
getDefXMLElementTag in class JboAbstractValidator

writeContents

public void writeContents(DefWriter jos)
Description copied from interface: PersistentDefinition
Objects should write their persistence output in this method

Specified by:
writeContents in interface PersistentDefinition
Overrides:
writeContents in class JboAbstractValidator
Parameters:
jos - the Output storage for persistence

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.4.0)

E10653-05

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