|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--oracle.dss.rules.Rule
An object that specifies:
DataView paints an itemThe property values are specified in a Mergeable object. The applies method specifies whether the properties in the Mergeable should be used. In this class, the applies method always returns true, so the rule always applies.
Rule objects are normally stored in RuleBundle objects. RuleBundle objects are stored in vectors, which are then passed to a Manager class, which runs all the rules in all of the rule bundles. The result is a single Mergeable object that specifies all of the settings that the Manager should use to paint an item in a DataView.
Subclasses of this class can override methods, in order to produce more specific rules. For example, the DiscriminatorRule specifies conditions under which the rule applies.
Dynamic rules can be created by overriding the runRule method and the fireRule method. For example, you might want a rule that sets the background color of a table cell, based on a data value. You could have the fireRule method set the Background property of its internal ViewStyle (a Mergeable object) dynamically, based on the data value of the cell that is to be painted.
Mergeable, DiscriminatorRule, RuleBundle, Serialized Form| Field Summary | |
static int |
RESET_EVERYTHINGReset all defaults, so that the rule is equivalent to one that has just been created. |
static int |
RESET_NONEReset no defaults. |
static int |
RESET_XML_PROPERTIESReset defaults for properties that can be set through XML. |
| Constructor Summary | |
Rule()Constructor that does not specify a Mergeable object. | |
Rule(Mergeable mergeable)Constructor that specifies a Mergeable object. | |
| Method Summary | |
boolean |
applies(RuleContext context, Mergeable target)Specifies whether this rule applies in the specified context. |
java.lang.Object |
clone()Clones this object. |
void |
fireRule(RuleContext context, Mergeable target)Modifies the specified Mergeable object to include property settings that this Rule specifies. |
Mergeable |
getFixedMergeable()Retrieves the Mergeable object that specifies property settings that should take effect when this Rule applies. |
interface |
getXML(boolean allProperties, ComponentTypeConverter converter)Retrieves XML that represents properties and their values in the form of and ObjectNode. |
boolean |
runRule(RuleContext context, Mergeable target)Fires this rule if the specified context warrants. |
void |
setFixedMergeable(Mergeable mergeable)Specifies the Mergeable object whose property values should be set whenever this Rule applies. |
boolean |
setXML( objectNode, java.lang.String version, int reset)Specifies XML that represents properties and values. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int RESET_NONE
public static final int RESET_XML_PROPERTIES
public static final int RESET_EVERYTHING
| Constructor Detail |
public Rule()
Mergeable object. If you call this constructor, and the rule needs a Mergeable object, then you must also call the setFixedMergeable method.setFixedMergeable(oracle.dss.rules.Mergeable), Mergeablepublic Rule(Mergeable mergeable)
Mergeable object.mergeable - The Mergeable object whose property values should be used when this rule applies.| Method Detail |
public java.lang.Object clone()
public boolean applies(RuleContext context,
Mergeable target)
throws RuleException
true.context - The context of the item that is to be painted. The DataView provides this parameter.target - The Mergeable object whose properties will be modified when the rule is fired, if this method returns true. Overriding methods may or may not use this parameter. This must be the same class as the object retrieved by calling the getFixedMergeable method.true. Overriding methods should return true or false.RuleException - If context is unusable for some reason or if this Rule has a problem.
public boolean runRule(RuleContext context,
Mergeable target)
throws RuleException
applies method. If the applies method returns true, then this method calls the fireRule method.
The RuleBundle method calls this method for each rule in the bundle. Extending classes may or may not choose to override this method. (An implementation might skip the call to applies altogether and just call fireRule.)
context - The context of the item that is to be painted. The DataView provides this parameter.target - The Mergeable object whose properties will be modified when the rule is fired, if this method returns true. Included in case the applies method wants to examine the Mergeable. This must be the same class as, or a subclass of, the object retrieved by calling the getFixedMergeable method.true if the applies method returns true, false if not.RuleException - If context is unusable for some reason or if this Rule has a problem.
public void fireRule(RuleContext context,
Mergeable target)
throws RuleException
Mergeable object to include property settings that this Rule specifies. This implementation merges the specified Mergeable object with the Mergeable object of this Rule. Merging the two objects adds the property settings from this Rule to those property settings that will be used when the DataView paints an item.context - The context of the item that is to be painted. The DataView provides this parameter. Subclasses might examine the context to determine how to modify the Mergeable object.target - The Mergeable object whose properties will be modified. This must be the same class as, or a subclass of, the object retrieved by calling the getFixedMergeable method.RuleException - If context is unusable for some reason or if this Rule has a problem.public Mergeable getFixedMergeable()
Mergeable object that specifies property settings that should take effect when this Rule applies.Mergeable that specifies the property settings for this Rule.public void setFixedMergeable(Mergeable mergeable)
Mergeable object whose property values should be set whenever this Rule applies.mergeable - The object that specifies property values that should be set whenever this Rule applies.public getXML(boolean allProperties, ComponentTypeConverter converter)
ObjectNode.allProperties - true to store all property values in XML, false to store only values that are different from default values.converter - A class that converts view component identifiers from strings to integers and back. Dataview objects implement the ComponentTypeConverter interface.
public boolean setXML( objectNode,
java.lang.String version,
int reset)
Rule.node - ObjectNode that has the properties and their values.version - The XML version.reset - A constant that indicates how much to reset when XML is applied. Valid values are listed in the See Also section.true if XML is properly applied, false if the XML cannot be applied.RESET_NONE, RESET_XML_PROPERTIES, RESET_EVERYTHING
|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||