public class RuleMatch extends Object implements Comparable<RuleMatch>
ContextTools for displaying errors in their original text context.| Constructor and Description |
|---|
RuleMatch(Rule rule,
int fromPos,
int toPos,
String message)
Creates a RuleMatch object, taking the rule that triggered
this match, position of the match and an explanation message.
|
RuleMatch(Rule rule,
int fromPos,
int toPos,
String message,
String shortMessage)
Creates a RuleMatch object, taking the rule that triggered
this match, position of the match and an explanation message.
|
RuleMatch(Rule rule,
int fromPos,
int toPos,
String message,
String shortMessage,
boolean startWithUppercase,
String suggestionsOutMsg)
Creates a RuleMatch object, taking the rule that triggered
this match, position of the match and an explanation message.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(RuleMatch other)
Compare by start position.
|
boolean |
equals(Object o) |
int |
getColumn()
Get the column number in which the match occurs (zero-based).
|
int |
getEndColumn()
Get the column number in which the match ends (zero-based).
|
int |
getEndLine()
Get the line number in which the match ends (zero-based).
|
int |
getFromPos()
Position of the start of the error (in characters, zero-based).
|
int |
getLine()
Get the line number in which the match occurs (zero-based).
|
String |
getMessage()
A human-readable explanation describing the error.
|
Rule |
getRule() |
String |
getShortMessage()
A shorter human-readable explanation describing the error or an empty string
if no such explanation is available.
|
List<String> |
getSuggestedReplacements()
The text fragments which might be an appropriate fix for the problem.
|
int |
getToPos()
Position of the end of the error (in characters, zero-based).
|
int |
hashCode() |
void |
setColumn(int column)
Set the column number in which the match occurs (zero-based).
|
void |
setEndColumn(int endColumn)
Set the column number in which the match ends (zero-based).
|
void |
setEndLine(int endLine)
Set the line number in which the match ends (zero-based).
|
void |
setLine(int fromLine)
Set the line number in which the match occurs (zero-based).
|
void |
setSuggestedReplacement(String replacement) |
void |
setSuggestedReplacements(List<String> replacements) |
String |
toString() |
public RuleMatch(Rule rule, int fromPos, int toPos, String message)
public RuleMatch(Rule rule, int fromPos, int toPos, String message, String shortMessage)
shortMessage - used for example in OpenOffice/LibreOffice's context menupublic RuleMatch(Rule rule, int fromPos, int toPos, String message, String shortMessage, boolean startWithUppercase, String suggestionsOutMsg)
shortMessage - used for example in OpenOffice/LibreOffice's context menu (may be null)startWithUppercase - whether the original text at the position
of the match starts with an uppercase characterpublic Rule getRule()
public void setLine(int fromLine)
public int getLine()
public void setEndLine(int endLine)
public int getEndLine()
public void setColumn(int column)
public int getColumn()
public void setEndColumn(int endColumn)
public int getEndColumn()
public int getFromPos()
public int getToPos()
public String getMessage()
getSuggestedReplacements(),
getShortMessage()public String getShortMessage()
getMessage()public void setSuggestedReplacement(String replacement)
getSuggestedReplacements()public void setSuggestedReplacements(List<String> replacements)
getSuggestedReplacements()public List<String> getSuggestedReplacements()
getFromPos()
to getToPos().public int compareTo(RuleMatch other)
compareTo in interface Comparable<RuleMatch>