www.sdmetrics.com

com.sdmetrics.metrics
Class Rule

java.lang.Object
  extended by com.sdmetrics.metrics.MetricEntry
      extended by com.sdmetrics.metrics.Rule

public class Rule
extends MetricEntry

Represents a design rule. An instance of this class corresponds to one rule element in the metrics definition file.


Field Summary
 
Fields inherited from class com.sdmetrics.metrics.MetricEntry
attributes, description, id, location, name, procedureName
 
Constructor Summary
Rule(java.lang.String name, MetaModelElement type, java.lang.String category, java.lang.String criticality, java.util.Collection<java.lang.String> appAreas, boolean enabled)
          Creates a new rule.
 
Method Summary
 java.util.Collection<java.lang.String> getApplicableAreas()
          Gets the application areas of the rule.
 java.lang.String getCategory()
          Gets the category of this rule.
 java.lang.String getCriticality()
          Gets the criticality of this rule.
 MetaModelElement getType()
          Gets the element type for which this rule is defined.
 boolean isEnabled()
          Tests whether this rule is enabled to not.
 java.lang.String toString()
          Returns a string representation of the rule.
 
Methods inherited from class com.sdmetrics.metrics.MetricEntry
getAttributes, getBriefDescription, getFullDescription, getLocation, getName, getProcedureName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(java.lang.String name,
            MetaModelElement type,
            java.lang.String category,
            java.lang.String criticality,
            java.util.Collection<java.lang.String> appAreas,
            boolean enabled)
Creates a new rule.

Parameters:
name - Name of the rule.
type - Metamodel element type of the elements for which this rule is defined.
category - The category of the rule.
criticality - The criticality of the rule.
appAreas - The application areas of the rule.
enabled - Indicates whether or not this rule is enabled and should be checked.
Method Detail

getCategory

public java.lang.String getCategory()
Gets the category of this rule.

Returns:
The category of the rule.

getCriticality

public java.lang.String getCriticality()
Gets the criticality of this rule.

Returns:
The criticality of the rule.

getType

public MetaModelElement getType()
Gets the element type for which this rule is defined.

Returns:
The element type of this rule.

isEnabled

public boolean isEnabled()
Tests whether this rule is enabled to not. When a rule is disabled, it is not checked for rule violations.

Returns:
true if this rule is enabled.

getApplicableAreas

public java.util.Collection<java.lang.String> getApplicableAreas()
Gets the application areas of the rule.

Returns:
The application areas of the rule, or null if none have been specified.

toString

public java.lang.String toString()
Returns a string representation of the rule.

Overrides:
toString in class java.lang.Object
Returns:
String with the name of rule, its type, and the line number of the definition

www.sdmetrics.com