Skip navigation links
oracle.ide.extension.rules
Class SimpleRule
java.lang.Object
oracle.ide.extension.rules.Rule
oracle.ide.extension.rules.SimpleRule
-
public class SimpleRule
- extends Rule
A SimpleRule consists of a reference to a RuleType and a set of parameters. When evaluate() is called, the RuleType's RuleFunction is instantiated and the RuleFunction's evaluate method is passed the parameters (resulting in a boolean return value). This class is the parsed representation of the <rule> element in extension.xml files.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleRule
public SimpleRule(java.lang.String id,
Extension extension,
RuleType type)
getType
public RuleType getType()
hasParameter
public boolean hasParameter(java.lang.String name)
addParameter
public boolean addParameter(RuleFunctionParameter parameter)
- Attempts to add a parameter to this Rule. Returns false if a parameter of the same name already existed.
-
- Parameters:
parameter
-
- Returns:
evaluate
public boolean evaluate(RuleEvaluationContext ruleContext)
throws RuleEvaluationException
-
- Specified by:
evaluate
in class Rule
-
- Throws:
RuleEvaluationException
matchesType
public boolean matchesType(java.util.Set<java.lang.String> ruleTypeIdSet)
- Description copied from class:
Rule
- Returns true if the type of this rule is identified in the given ruleTypeId set
-
- Specified by:
matchesType
in class Rule
-
- Returns:
Skip navigation links
Copyright © 1997, 2012, Oracle. All rights reserved.