|
Oracle Business Rules Java API Reference 10g (10.1.3.1.0) B28966-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.util.AbstractMap
java.util.HashMap
oracle.rules.sdk.editor.ruleset.RuleComponent
RuleComponent is an Abstract Class which enables access to properties through generic accessors by extending HashMap.
The generic get and set can also be used to set additional custom properties which will be stored with the rule component when it is serialized (comments for example). A custom property value must be a String. To avoid collisions, its name must end with "Custom" (@see Util#CUSTOM).
For String property named X, there are corresponding properties
getX() return the value of X get ("X") setX ("myValue") assign "myValue" to X put ("X", "myValue") getXOptions() return a String array of option choices get("X" + Util.OPTIONS) getOptions("X") setXOptions(myOptionArray) set the options array, overrides SDK setting put ("X" + Util.OPTIONS, myOptionArray) getXSelected() return index of selection in options Array get("X" + Util.SELECTED) (cannot be set) getSelected ("X") getXConstraint() return name of data model constraint on X get("X" + Util.CONSTRAINT) getConstraint ("X") setXConstraint("Cname") return name of data model constraint on X set("X" + Util.CONSTRAINT, "Cname")
Method Summary | |
void |
clear() HashMap.clear() is overridden to set the RuleComponent tree to its initial state. |
void |
discardCopy() Discards the most recent saved copy. |
java.lang.Object |
get(java.lang.Object key) Generic property getter inheirited from RuleComponent . |
RuleComponent |
get(java.lang.String tableName, int index) Returns the RuleComponent at the given index from the named RuleComponentTable. |
java.lang.String |
getConstraint(java.lang.String propertyName) Returns the option list for the property, if any. |
java.lang.String[] |
getConstraintList(java.lang.String propertyName) |
java.lang.String |
getCustom(java.lang.String propertyName) Returns the value of the input custom property. |
java.lang.String |
getDescription() Returns the user supplied description of this rule component. |
java.lang.String |
getID() Returns a unique ID for each rule component in the edit session. |
java.lang.String[] |
getOptions(java.lang.String propertyName) Returns the option array for the property, if any. |
RuleComponent |
getParent() |
RuleComponentTable |
getParentTable() |
java.lang.String[] |
getPropertyNames() |
java.lang.Double[] |
getRange(java.lang.String propertyName) |
RuleDictionary |
getRuleDictionary() get rule dictionary object |
int |
getSelected(java.lang.String propertyName) Returns the index of the selected option in the list returned by getOptions(). |
java.lang.Object |
put(java.lang.Object key, java.lang.Object value) Generic property setter. |
java.lang.Object |
remove(java.lang.Object key) HashMap.remove() is overridden to allow only custom properties, constraints, and program set options to be removed. |
void |
restoreCopy() Restores the RuleComponent's properties to their state at the time of the last saveCopy(). |
void |
saveCopy() Creates a deep copy of this RuleComponent so that a restore can be performed later. |
void |
setCustom(java.lang.String propertyName, java.lang.String value) Sets the value of the input custom property. |
void |
setDescription(java.lang.String description) Sets the user supplied description of this rule component. |
void |
setRuleDictionary(RuleDictionary dict) set rule dictionary |
java.lang.String |
toString() |
void |
validate() Validates the correctness of the RuleComponent and all RuleComponents below it. |
Methods inherited from class java.util.HashMap |
clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Method Detail |
public java.lang.Object get(java.lang.Object key)
RuleComponent
.
Please see the specific bean class for a list of properties.
key
- a String containing the property name to be fetched.public java.lang.Object put(java.lang.Object key, java.lang.Object value)
A put() with either null key or null value throws a NullPointerException.
A put() with a key that is not a String throws a ClassCastException
A put() of a value that is not of the correct type for the key throws a ClassCastException.
Bean properties which have no set() method are read only, and cannot be modified using the put(). Attempting to do so throws a runtime IllegalArgumentException. PROP_ID, and PROP_*_SELECTED are always read only.
key
- the key of the property to setvalue
- the value of the named property to setjava.lang.NullPointerException
- if key or value is nulljava.lang.ClassCastException
- if key is not a String or value is not of right class for keyjava.lang.IllegalArgumentException
- if attempt is made to change a read only property, or if options or constraint list are not a subset of system allowable options.public void clear()
public java.lang.Object remove(java.lang.Object key)
key
- the property to removejava.lang.ClassCastException
- if key is not a Stringjava.lang.IllegalArgumentException
- if key does not end with Util.CUSTOM or Util.OPTIONS or Util.CONSTRAINTpublic RuleComponent get(java.lang.String tableName, int index)
(RuleComponent)(((RuleComponentTable)(get ("myTable"))).get(i));
tableName
- a String property which must be the name of a RuleComponentTableindex
- of the requested RuleComponentpublic java.lang.Double[] getRange(java.lang.String propertyName)
propertyName
-public void validate() throws RuleEditorException, RuleEditorSDKException
RuleEditorException
- for user input errorsRuleEditorSDKException
- incorrect SDK usagepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
public java.lang.String getID()
public void saveCopy()
public void discardCopy() throws RuleEditorException
RuleEditorException
- if there are no more saved copies on the stack.RuleEditorException
- if there are no more saved copies on the stack.public void restoreCopy() throws RuleEditorException
RuleEditorException
- if there are no more saved copies on the stack.public java.lang.String[] getConstraintList(java.lang.String propertyName)
public java.lang.String getConstraint(java.lang.String propertyName)
(String)(get (propertyName + Util.CONSTRAINT))
propertyName
- a String property with an option listpublic java.lang.String[] getOptions(java.lang.String propertyName)
(String[])(get (propertyName + Util.OPTIONS))
propertyName
- a String property with an option listpublic int getSelected(java.lang.String propertyName)
((Integer)(get (propertyName + Util.SELECTED))).intValue()
propertyName
- a String property with an option listpublic java.lang.String getCustom(java.lang.String propertyName)
(String)(get (propertyName + Util.CUSTOM))
propertyName
- custom property name without the Util.CUSTOM suffixpublic void setCustom(java.lang.String propertyName, java.lang.String value)
put (propertyName + Util.CUSTOM, value))
propertyName
- custom property name without the Util.CUSTOM suffixpublic RuleComponent getParent()
public RuleComponentTable getParentTable()
public java.lang.String[] getPropertyNames()
public java.lang.String toString()
public RuleDictionary getRuleDictionary()
public void setRuleDictionary(RuleDictionary dict)
|
Oracle Business Rules Java API Reference 10g (10.1.3.1.0) B28966-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |