www.sdmetrics.com

com.sdmetrics.metrics
Class RuleFilter

java.lang.Object
  extended by com.sdmetrics.metrics.RuleFilter

public class RuleFilter
extends java.lang.Object

Represents and evaluates a design rule filter expression.

A design rule can be assigned one or more "application areas", for example, rules aimed at the analysis phase, the design phase, rules for real time systems, etc. The rule filter selects rules based on their application areas.


Constructor Summary
RuleFilter()
          Constructs a new empty rule filter that accepts all application areas.
RuleFilter(java.lang.String filter)
          Construct a new rule filter from a filter string.
 
Method Summary
 java.lang.String checkIdentifiers(MetricStore metricStore)
          Checks the identifiers of the rule filter for plausibility.
 boolean match(Rule rule)
          Checks if the application area(s) of a design rule match this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleFilter

public RuleFilter()
Constructs a new empty rule filter that accepts all application areas.


RuleFilter

public RuleFilter(java.lang.String filter)
           throws SDMetricsException
Construct a new rule filter from a filter string.

Parameters:
filter - The rule filter string.
Throws:
SDMetricsException - The filter string could not be parsed or contains illegal operations.
Method Detail

match

public boolean match(Rule rule)
Checks if the application area(s) of a design rule match this filter.

Parameters:
rule - The design rule to check.
Returns:
true if the design rule matches and should be checked according to this filter.

checkIdentifiers

public java.lang.String checkIdentifiers(MetricStore metricStore)
Checks the identifiers of the rule filter for plausibility.

An identifier is valid if it is explicitly defined as the application area of at least one rule. Otherwise, the identifier is suspect because it is not listed by any of the rules.

Parameters:
metricStore - Contains the definitions of the rules
Returns:
Empty string if all application areas of the filter string are valid, otherwise the name of a suspect application area in the filter string.

www.sdmetrics.com