public class RuleContext
extends java.lang.Object
Constructor and Description |
---|
RuleContext()
Default constructor.
|
RuleContext(RuleContext ruleContext)
Constructor which shares attributes with the given RuleContext.
|
Modifier and Type | Method and Description |
---|---|
void |
excludeLines(java.util.Map<java.lang.Integer,java.lang.String> lines) |
java.lang.Object |
getAttribute(java.lang.String name)
Get an attribute value on the RuleContext.
|
Report |
getReport() |
java.io.File |
getSourceCodeFile() |
java.lang.String |
getSourceCodeFilename() |
SourceType |
getSourceType() |
java.lang.Object |
removeAttribute(java.lang.String name)
Remove an attribute value on the RuleContext.
|
boolean |
setAttribute(java.lang.String name,
java.lang.Object value)
Set an attribute value on the RuleContext, if it does not already exist.
|
void |
setReport(Report report) |
void |
setSourceCodeFile(java.io.File sourceCodeFile) |
void |
setSourceCodeFilename(java.lang.String filename) |
void |
setSourceType(SourceType t) |
public RuleContext()
public RuleContext(RuleContext ruleContext)
public Report getReport()
public void setReport(Report report)
public java.io.File getSourceCodeFile()
public void setSourceCodeFile(java.io.File sourceCodeFile)
public java.lang.String getSourceCodeFilename()
public void setSourceCodeFilename(java.lang.String filename)
public void excludeLines(java.util.Map<java.lang.Integer,java.lang.String> lines)
public SourceType getSourceType()
public void setSourceType(SourceType t)
public boolean setAttribute(java.lang.String name, java.lang.Object value)
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.
name
- The attribute name.value
- The attribute value.true
if the attribute was set, false
otherwise.java.lang.IllegalArgumentException
- if name
or value
are null
public java.lang.Object getAttribute(java.lang.String name)
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.
name
- The attribute name.null
if the attribute does not exist.public java.lang.Object removeAttribute(java.lang.String name)
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.
name
- The attribute name.null
if the attribute does not exist.