Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.rules
Class JboGenericValidator

java.lang.Object
  extended byoracle.jbo.rules.JboGenericValidator
All Implemented Interfaces:
GenericValidator, JboValidatorInterface, java.io.Serializable

public class JboGenericValidator
extends java.lang.Object
implements GenericValidator, java.io.Serializable

A validator for domain attributes.

This validator tests whether a domain object lies in a specified range, or is one of a set of specified values. The object's precision may also be validated.

An object will be tested against a list of values if the list is not null. Use setList() to provide the list. When the list is null (the default), the object is tested instead against the range, which is specified by setMin() and setMax().

Use setPrec() to specify the precision.

Since:
Jdeveloper 3.0
See Also:
TypeFactory, Serialized Form

Constructor Summary
JboGenericValidator()
          Creates an uninitialized validator.
 
Method Summary
 java.lang.String getDescription()
          Gets the textul description of this validator.
 java.util.Vector getList()
          Gets the list of valid values.
 java.lang.Object getMax()
          Gets the maximum bound of the valid range.
 java.lang.Object getMin()
          Gets the minimum bound of the valid range.
 java.lang.String getPrec()
          Gets the SQL numeric precision.
 boolean isUpdateable()
          Reports whether this validator allows updating.
 void setDescription(java.lang.String description)
          Sets the textul description of this validator.
 void setLhs(DomainInterface lValue)
          Internal: Applications should not use this method.
 void setList(java.util.Vector vec)
          Sets the list of valid values.
 void setMax(java.lang.Object maxValue)
          Sets the maximum bound of the valid range.
 void setMin(java.lang.Object minValue)
          Sets the minimum bound of the valid range.
 void setPrec(java.lang.String prec)
          Sets the SQL numeric precision.
 void setTypeInfo(java.lang.String type)
           
 void setUpdateable(boolean val)
          Enables or disables validation.
 java.lang.String toString()
          Generates a Java code fragment that invokes this validator.
 void validate(JboValidatorContext ctx)
          Tests the validity of an attribute value.
 boolean validateValue(java.lang.Object value)
          Validates that a domain object is within this validators precision and range or set of values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JboGenericValidator

public JboGenericValidator()
Creates an uninitialized validator.

Use "set" methods to provide validation parameters.

Method Detail

validateValue

public boolean validateValue(java.lang.Object value)
Validates that a domain object is within this validators precision and range or set of values.

Parameters:
value - the object to be validated.
Returns:
true if the object's precision and value are within specified limits, and the validator is updateable.

getList

public java.util.Vector getList()
Gets the list of valid values.

Returns:
a vector containing the valid values.

getMin

public java.lang.Object getMin()
Gets the minimum bound of the valid range.

Returns:
the least valid value.

getMax

public java.lang.Object getMax()
Gets the maximum bound of the valid range.

Returns:
the greatest valid value.

getPrec

public java.lang.String getPrec()
Gets the SQL numeric precision.

Returns:
a string representation of the number of significant digits.

isUpdateable

public boolean isUpdateable()
Reports whether this validator allows updating.

Returns:

false if validateValue(java.lang.Object) is forced to return false, and #vetoableChange(PropertyChangeEvent) is forced to fail.

true if validation is performed.


setList

public void setList(java.util.Vector vec)
Sets the list of valid values.

Parameters:
vec - a list containing the new valid values.

setMin

public void setMin(java.lang.Object minValue)
Sets the minimum bound of the valid range.

Parameters:
minValue - the new least valid value.

setMax

public void setMax(java.lang.Object maxValue)
Sets the maximum bound of the valid range.

Parameters:
maxValue - the new greatest valid value.

setPrec

public void setPrec(java.lang.String prec)
Sets the SQL numeric precision.

Parameters:
prec - a string representation of the new number of significant digits.

setUpdateable

public void setUpdateable(boolean val)
Enables or disables validation.

Parameters:
val - if false, validateValue() is forced to return false, and vetoableChange() is forced to fail.

setTypeInfo

public void setTypeInfo(java.lang.String type)

setLhs

public void setLhs(DomainInterface lValue)
Internal: Applications should not use this method.


toString

public java.lang.String toString()
Generates a Java code fragment that invokes this validator.

Returns:
"Range(min, max)".

validate

public void validate(JboValidatorContext ctx)
Description copied from interface: JboValidatorInterface
Tests the validity of an attribute value.

Specified by:
validate in interface JboValidatorInterface
Returns:
true if the value is valid.

getDescription

public java.lang.String getDescription()
Gets the textul description of this validator.

Specified by:
getDescription in interface JboValidatorInterface
Returns:
a documentation string.

setDescription

public void setDescription(java.lang.String description)
Sets the textul description of this validator.

Specified by:
setDescription in interface JboValidatorInterface
Parameters:
description - a documentation string.

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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