The New Plug-in Project wizard generates
a plugin.xml file that includes a rule extension
for each new user-written code rule. The wizard also creates a category extension
if the category to which the rule belongs does not exist.
The extensions are used to register the new user-written
rule and its category with Eclipse.
Figure 1 shows the form of a
rule extension:
Figure 1. Extension for a user-written 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>
Note: The attribute values are described in
Table 1 following.
If the category does not exist, the wizard also adds
an extension for the category to the plugin.xml file. Figure 2 shows the form of a
category extension:
Figure 2. Extension for the category of a
user-written 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.egl.analysisProvider">
</analysisCategory>
</extension>
Note: The attribute values are described in
Table 1 following.
Table 1 shows how the attributes of the
<analysisRule> and
the
<analysisCategory> elements are derived
from the values that you enter in the
Plug-in Project wizard:
- In the <analysisRule> element, the category, ruleclass, ruleid,
and rulelabel attributes are set to the values that
you entered on the EGL Rule Template page of
the wizard. The wizard also uses the ruleclass value
to set the rule ID.
- In the <analysisCategory> element, the id and label attributes
are set to the values that you entered on the EGL Rule Template page
of the wizard.
- The package name is set to the string that you specified in the ID field
of the package definition, on the Content page
of the New Plug-in Project wizard. It is shown
in the Example value column of the table as com.example
Table 1. Attributes values for analysisRule
and analysisCategory| Attribute: |
Field on the EGL Rule Template wizard
page: |
Example value: |
| analysisRule.category |
Category ID |
com.example.custom |
| analysisRule.ruleclass |
Rule class |
com.example.EglRule |
| analysisRule.ruleid |
Rule class |
com.example.EglRule |
| analysisRule.rulelabel |
Rule label |
My custom EGL rule |
| analysisCategory.id |
Category ID |
com.example.custom |
| analysisCategory.label |
Category name |
Custom |