Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getConstruct()
Gets the model object associated with this issue, if any.
|
Transform |
getDefaultTransform()
Gets the default transform of this violation, or null if none.
|
Location |
getFocusLocation()
Gets the focus location of the violation, or null if none.
|
Location |
getLocation()
Gets the location of the violating construct.
|
int |
getParameterCount()
Gets the number of parameters of this violation.
|
java.lang.String |
getParameterName(int index)
Gets the name of a parameter of this violation.
|
java.lang.Object |
getParameterValue(int index)
Gets the value of a parameter of this violation.
|
java.lang.Object |
getParameterValue(java.lang.String name)
Gets the value of a parameter of this violation by name.
|
Rule |
getRule()
Gets the rule violated by this violation.
|
int |
getSerialNumber()
Gets the serial number of this violation.
|
Suppression |
getSuppression(int index)
Gets a suppression matching this violation.
|
int |
getSuppressionCount()
Gets the number of suppressions matching this violation.
|
Transform |
getTransform(int index)
Gets a transform of this violation.
|
int |
getTransformCount()
Gets the number of transforms of this violation.
|
java.lang.String |
getVariation()
Gets the variation in the rule violated, or null if the default.
|
getHtmlMessage, getLength, getMessage, getOffset, getSeverity, getTransforms, hasTransforms
Rule getRule()
java.lang.String getVariation()
Location getLocation()
Location getFocusLocation()
int getParameterCount()
java.lang.String getParameterName(int index)
index
- The index of the parameter.java.lang.Object getParameterValue(int index)
index
- The index of the parameter.java.lang.Object getParameterValue(java.lang.String name)
int getTransformCount()
Transform getTransform(int index)
index
- The index of the transform.Transform getDefaultTransform()
int getSuppressionCount()
Suppression getSuppression(int index)
index
- The index of the suppression.int getSerialNumber()
java.lang.Object getConstruct()
Violation
interface.
Even though the implementations do not require client locking, the source
models for most Node
types actually do
expect clients to hold a lock, usually the Node
/TextBuffer
lock, while holding constructs of the source model. Consequently, taking
the appropriate lock before calling this method is recommended.
A typical implementation will get the construct using the Location
and should look something like this:
public Object getConstruct()
{
Location location = getLocation();
ModelAdapter model = location.getModel();
boolean locked = false;
try
{
model.beginRead();
locked = true;
return model.getConstruct(location);
}
catch (ModelAccessError e)
{
return null;
}
catch (InterruptedException e)
{
Thread.currentThread().interrupt();
return null;
}
finally
{
if (locked) model.endRead();
}
}
getConstruct
in interface Issue