Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


oracle.rules.sdk.editor.datamodel
Class Constraint

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byoracle.rules.sdk.editor.datamodel.ModelComponent
              extended byoracle.rules.sdk.editor.datamodel.Constraint

All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Constraint
extends ModelComponent

There are three types of constraints: enumeration, range and regular expression.

See Also:
Serialized Form

Field Summary
static java.lang.String ENUM_VALUE_KEY
           
static java.lang.String ENUMERATION
           
static java.lang.String PROP_ENUM_VALUE_TABLE
           
static java.lang.String PROP_FORM
           
static java.lang.String PROP_LOWER_BOUND
           
static java.lang.String PROP_REGEXP
           
static java.lang.String PROP_UPPER_BOUND
           
static java.lang.String RANGE
           
static java.lang.String REGULAR_EXPRESSION
           

 

Fields inherited from class oracle.rules.sdk.editor.datamodel.ModelComponent
PROP_ALIAS, PROP_ID, PROP_NAME, PROP_PROPERTIES, PROP_VISIBLE

 

Method Summary
 java.lang.String getDisplayString()
          Get the String that describes the constraint.
 java.util.List getEnumValues()
          A convenient API to get enumeration values as a list of Strings
 EnumValueTable getEnumValueTable()
          Get the list of possible values.
 java.lang.String getForm()
          Get the form of the constraint
 java.lang.String[] getFormOptions()
          Get the list of possible form values
 int getFormSelected()
           
 double getLowerBound()
          Get lower bound.
 java.lang.String getRegExp()
          Get the regular expression to be matched.
 double getUpperBound()
          Get upper bound.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Overwrite hashtable put method.
 void setEnumValues(java.util.List possibleVals)
          A convenient API to set enumeration values.
 void setForm(java.lang.String form)
          Set form of the constraint.
 void setLowerBound(double lo)
          Set lower bound.
 void setName(java.lang.String name)
          Set the name of the element.
 void setRegExp(java.lang.String regexp)
          Set the regular expression to be matched Refer to java.util.regex.Pattern for the specification of regular expression.
 void setUpperBound(double up)
          Set upper bound.
 void validate()
          validate consistency of the constraint definition
 void validate(java.lang.String val)
          Given a String that should conform to the constraint, the method validates the constraint against the string.

 

Methods inherited from class oracle.rules.sdk.editor.datamodel.ModelComponent
get, getAlias, getDataModel, getID, getName, getParent, getProperties, getVisible, setAlias, setVisible

 

Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values

 

Methods inherited from class java.util.AbstractMap
equals, hashCode, toString

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface java.util.Map
equals, hashCode

 

Field Detail

ENUMERATION

public static final java.lang.String ENUMERATION
See Also:
Constant Field Values

RANGE

public static final java.lang.String RANGE
See Also:
Constant Field Values

REGULAR_EXPRESSION

public static final java.lang.String REGULAR_EXPRESSION
See Also:
Constant Field Values

ENUM_VALUE_KEY

public static final java.lang.String ENUM_VALUE_KEY
See Also:
Constant Field Values

PROP_FORM

public static final java.lang.String PROP_FORM
See Also:
Constant Field Values

PROP_ENUM_VALUE_TABLE

public static final java.lang.String PROP_ENUM_VALUE_TABLE
See Also:
Constant Field Values

PROP_LOWER_BOUND

public static final java.lang.String PROP_LOWER_BOUND
See Also:
Constant Field Values

PROP_UPPER_BOUND

public static final java.lang.String PROP_UPPER_BOUND
See Also:
Constant Field Values

PROP_REGEXP

public static final java.lang.String PROP_REGEXP
See Also:
Constant Field Values

Method Detail

setName

public void setName(java.lang.String name)
Description copied from class: ModelComponent
Set the name of the element.
Overrides:
setName in class ModelComponent
Parameters:
name - the name of the element.

getForm

public java.lang.String getForm()
Get the form of the constraint
Returns:
Constraint.ENUMERATION, Constraint.RANGE or Constraint.REGULAR_EXPRESSION

getFormOptions

public java.lang.String[] getFormOptions()
Get the list of possible form values
Returns:
An array containing possible form values

getFormSelected

public int getFormSelected()

setForm

public void setForm(java.lang.String form)
Set form of the constraint.
Parameters:
form - is either Constraint.ENUMERATION, Constraint.RANGE or Constraint.REGULAR_EXPRESSION

getEnumValueTable

public EnumValueTable getEnumValueTable()
Get the list of possible values. Applicable to EnumConstraint.
Returns:
the Enumeration Value Table

getEnumValues

public java.util.List getEnumValues()
A convenient API to get enumeration values as a list of Strings
Returns:
The enuemration values in a list

setEnumValues

public void setEnumValues(java.util.List possibleVals)
A convenient API to set enumeration values.
Parameters:
possibleVals - the enuemration values in a list. A null pointer or an empty list will cause no emumeration value set.

getLowerBound

public double getLowerBound()
Get lower bound. Applicable to Range Constraint
Returns:
lower bound

setLowerBound

public void setLowerBound(double lo)
Set lower bound. Applicable to Range Constraint
Parameters:
lo - lower bound of the range constraint

getUpperBound

public double getUpperBound()
Get upper bound. Applicable to Range Constraint
Returns:
upper bound

setUpperBound

public void setUpperBound(double up)
Set upper bound. Applicable to Range Constraint
Parameters:
up - upper bound of the range constraint

getRegExp

public java.lang.String getRegExp()
Get the regular expression to be matched. Applicable to RexExp Constraint
Returns:
the regular expression to be matched

setRegExp

public void setRegExp(java.lang.String regexp)
Set the regular expression to be matched Refer to java.util.regex.Pattern for the specification of regular expression. Applicable to RexExp Constraint
Parameters:
regexp - the regular expression to be matched

getDisplayString

public java.lang.String getDisplayString()
Get the String that describes the constraint.
Returns:
the string describing the constraint

validate

public void validate(java.lang.String val)
              throws RulesSDKException
Given a String that should conform to the constraint, the method validates the constraint against the string.
Parameters:
val - the string that conforms to the constraint
Throws:
thrown - when the constraint is violated. The message about the violation reason should be in the exception.
RulesSDKException

validate

public void validate()
              throws RulesSDKDMValidationException
validate consistency of the constraint definition
Overrides:
validate in class ModelComponent
Throws:
thrown - if any of the following happens (1)lower, upper bound is not in right format (2)lo > up (3) enumeration value is less than 1
RulesSDKDMValidationException

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Overwrite hashtable put method. For property "name" we do reference checking
Parameters:
key - a String containing the property name to be saved.
value - a String corresponding to the key to be saved

Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


Copyright © 2006, Oracle. All rights reserved.