<!ELEMENT extension (codeCheck+ | categoryName*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
Allows for additional code checks
<!ELEMENT codeCheck (option)*>
<!ATTLIST codeCheck
id CDATA #REQUIRED
defaultSeverity (WARNING|ERROR|IGNORE) "WARNING"
class CDATA #REQUIRED
categoryId CDATA #IMPLIED
description CDATA #REQUIRED
requiresBinding (true | false) "false">
All data about the code check should be published in this element. This includes the implementing class, and the problem description.
<markerGroupingEntry>
, or may be a predefined category. If the referenced category does not exist, it is categorized under "miscellaneous"<!ELEMENT option EMPTY>
<!ATTLIST option
id CDATA #REQUIRED
description CDATA #REQUIRED
type (boolean|string|visibility)
defaultValue CDATA #IMPLIED>
If the codeCheck requires additional settings, they may be specified here. They will be shown on the preferencePage, linked to the codeCheck.
In this example, the class DummyCheck can query the value of its option via a call to<extension point=
"net.sourceforge.arguscodewatch.codeCheck"
>
<codeCheck class=
"net.sourceforge.arguscodewatch.DummyCheck"
id=
"dummyCheck"
default_severity=
"WARNING"
description=
"allow dummy code blocks"
categoryId=
"net.sourceforge.arguscodewatch.category.dangerousCode"
>
<option id=
"ignoreDuplicates"
type=
"boolean"
/>
</codeCheck>
</extension>
parent.getProperty("dummyCheck.ignoreDuplicates")
. This will return a String representation of Boolean.
The class must be a subclass of net.sourceforge.arguscodewatch.CodewatchVisitor
. This abstract class extends ASTVisitor and adds a number of convenience methods. Like the ASTVisitor
class, implementing classes only need to override the corresponding visit()
methods. Markers can be easily created via the parent.createMarker()
methods.
Unlike the ASTVisitor class, subclasses of CodewatchVisitor have access to the corresponding source code via the source
field. Current preference settings can be obtained via the parent.getProperty()
method.
Clients that want to implement additional preference settings, can use net.sourceforge.arguscodewatch.preferences as their page category.
Copyright (C) 2005, TOP Informatie Systemen bv and others
All source is made available under the terms of the Eclipse Public License v1.0, a copy of which is available at http://www.eclipse.org/legal/epl-v10.html