public final class RuleEngine
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
evaluateRule(java.lang.String ruleId, Context ideContext)
Evaluates the rule identified by the given ruleId and returns the boolean result (using a simple RuleEvaluationContext based on the given IDE Context object).
|
boolean |
evaluateRule(java.lang.String ruleId, RuleEvaluationContext ruleContext)
Evaluates the rule identified by the given ruleId and returns the boolean result.
|
boolean |
evaluateRuleOrThrow(java.lang.String ruleId, Context ideContext)
Evaluates the rule identified by the given ruleId (using a RuleEvaluationContext created for the given IDE Context object).
|
boolean |
evaluateRuleOrThrow(java.lang.String ruleId, RuleEvaluationContext ruleContext)
Evaluates the rule identified by the given ruleId and returns the boolean result.
|
static RuleEngine |
getInstance() |
Rule |
getRule(java.lang.String id)
Returns the registered Rule with the given id, or null if no such Rule is registered
|
RuleType |
getRuleType(java.lang.String id)
Returns the registered RuleType with the given id, or null if no such RuleType is registered
|
boolean |
isKnownRule(java.lang.String ruleId)
Returns true if a rule with the given ruleId has previously been registered with the RuleEngine
|
boolean |
matchesType(java.lang.String ruleId, java.util.Set<java.lang.String> ruleTypeIdSet)
Returns true if a rule with the given ruleId has previously been registered and the rule's type is identified in the given ruleTypeIdSet.
|
boolean |
registerRule(Rule rule)
Attempts to register the given Rule with the RuleEngine.
|
boolean |
registerRuleType(RuleType ruleType)
Attempts to register the given RuleType with the RuleEngine.
|
boolean |
validateRuleReference(java.lang.String ruleId, ElementContext referenceContext)
Convenience method for validating a rule reference.
|
boolean |
validateRuleReference(java.lang.String ruleId, java.util.Set<java.lang.String> expectedRuleTypes, ElementContext referenceContext)
Convenience method for validating a rule reference.
|
boolean |
validateRuleReference(java.lang.String ruleId, java.util.Set<java.lang.String> expectedRuleTypes, java.util.logging.Logger logger) |
public static RuleEngine getInstance()
public final boolean evaluateRule(java.lang.String ruleId, Context ideContext)
ruleId
-ideContext
-RuleEvaluationException
public boolean evaluateRule(java.lang.String ruleId, RuleEvaluationContext ruleContext)
ruleId
-ruleContext
-RuleEvaluationException
public final boolean evaluateRuleOrThrow(java.lang.String ruleId, Context ideContext) throws RuleEvaluationException
ruleId
-ideContext
-RuleEvaluationException
public boolean evaluateRuleOrThrow(java.lang.String ruleId, RuleEvaluationContext ruleContext) throws RuleEvaluationException
ruleId
-ruleContext
-RuleEvaluationException
public boolean registerRuleType(RuleType ruleType)
ruleType
-public RuleType getRuleType(java.lang.String id)
id
-public boolean registerRule(Rule rule)
rule
-public Rule getRule(java.lang.String id)
id
-public boolean isKnownRule(java.lang.String ruleId)
ruleId
-public boolean matchesType(java.lang.String ruleId, java.util.Set<java.lang.String> ruleTypeIdSet)
ruleId
-ruleTypeIdSet
-public boolean validateRuleReference(java.lang.String ruleId, ElementContext referenceContext)
ruleId
-referenceContext
-public boolean validateRuleReference(java.lang.String ruleId, java.util.Set<java.lang.String> expectedRuleTypes, ElementContext referenceContext)
ruleId
-expectedRuleTypes
-referenceContext
-public boolean validateRuleReference(java.lang.String ruleId, java.util.Set<java.lang.String> expectedRuleTypes, java.util.logging.Logger logger)