net.sourceforge.pmd
public class RuleContext extends Object
| Constructor Summary | |
|---|---|
| RuleContext()
Default constructor. | |
| RuleContext(RuleContext ruleContext)
Constructor which shares attributes with the given RuleContext. | |
| Method Summary | |
|---|---|
| void | excludeLines(Map<Integer,String> lines) |
| Object | getAttribute(String name)
Get an attribute value on the RuleContext.
|
| Report | getReport() |
| File | getSourceCodeFile() |
| String | getSourceCodeFilename() |
| SourceType | getSourceType() |
| Object | removeAttribute(String name)
Remove an attribute value on the RuleContext.
|
| boolean | setAttribute(String name, Object value)
Set an attribute value on the RuleContext, if it does not already exist.
|
| void | setReport(Report report) |
| void | setSourceCodeFile(File sourceCodeFile) |
| void | setSourceCodeFilename(String filename) |
| void | setSourceType(SourceType t) |
Attributes can be shared between RuleContext instances. This operation is thread-safe.
Attribute values should be modified directly via the reference provided.
It is not necessary to call setAttribute(String, Object) to
update an attribute value. Modifications made to the attribute value
will automatically be seen by other threads. Because of this, you must
ensure the attribute values are themselves thread safe.
Parameters: name The attribute name.
Returns: The current attribute value, or null if the attribute does not exist.
Attributes can be shared between RuleContext instances. This operation is thread-safe.
Attribute values should be modified directly via the reference provided.
It is not necessary to call setAttribute(String, Object) to
update an attribute value. Modifications made to the attribute value
will automatically be seen by other threads. Because of this, you must
ensure the attribute values are themselves thread safe.
Parameters: name The attribute name.
Returns: The current attribute value, or null if the attribute does not exist.
Attributes can be shared between RuleContext instances. This operation is thread-safe.
Attribute values should be modified directly via the reference provided.
It is not necessary to call setAttribute(String, Object) to
update an attribute value. Modifications made to the attribute value
will automatically be seen by other threads. Because of this, you must
ensure the attribute values are themselves thread safe.
Parameters: name The attribute name. value The attribute value.
Returns: true if the attribute was set, false otherwise.
Throws: IllegalArgumentException if name or value are null