Rational Developer for System z

Generated files: Rule and category extensions

This topic describes the rule and category extensions that the COBOL Rule Template wizard adds to the plugin.xml file that is generated for the custom rule plug-in project.
The new plugin.xml file contains extensions to register the new custom rule and its category with Eclipse. Figure 1 shows the extension for a custom rule:
Figure 1. Extension for a custom rule
<extension
    point="com.ibm.rsaz.analysis.core.analysisRule">
  <analysisRule
      category="category_id"
      class="rule_class"
      id="rule_class"
      label="rule_label"
      severity="1">
  </analysisRule>
</extension>
Also the extension for the category is added to the plugin.xml file if the category does not already exist. Figure 2 shows the extension for a category:
Figure 2. Extension for the category of a custom rule
<extension
    point="com.ibm.rsaz.analysis.core.analysisCategory">
  <analysisCategory
      class="com.ibm.rsaz.analysis.core.category.DefaultAnalysisCategory"
      id="category_ID"
      label="category_name"
      provider="codereview.cobol.analysisProvider">
  </analysisCategory>
</extension>
Table 1 shows how the attributes of the <analysisRule> and the <analysisCategory> elements are derived from the values that were entered on the pages of the Plug-in Project wizard:
Table 1. Attributes of analysisRule and analysisCategory
Attribute: Input field on the COBOL Rule Template wizard page: Example:
analysisRule.category Category ID com.example.custom
analysisRule.ruleclass Rule class com.example.CobolRule
analysisRule.ruleid Rule class com.example.CobolRule
analysisRule.rulelabel Rule label My custom COBOL rule
analysisCategory.id Category ID com.example.custom
analysisCategory.label Category name Custom

Feedback