public class DefaultParserNotice extends Object implements ParserNotice
Parser
implementations can return instances of this in their parse result.Parser,
ParseResultERROR, INFO, WARNING| Constructor and Description |
|---|
DefaultParserNotice(Parser parser,
String msg,
int line)
Constructor.
|
DefaultParserNotice(Parser parser,
String message,
int line,
int offset,
int length)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ParserNotice other)
Compares this parser notice to another.
|
boolean |
containsPosition(int pos)
Returns whether this parser notice contains the specified location
in the document.
|
boolean |
equals(Object obj)
Returns whether this parser notice is equal to another one.
|
Color |
getColor()
Returns the color to use when painting this notice.
|
int |
getLength()
Returns the length of the code the message is concerned with.
|
int |
getLevel()
Returns the level of this notice.
|
int |
getLine()
Returns the line number the notice is about.
|
String |
getMessage()
Returns the message from the parser.
|
int |
getOffset()
Returns the offset of the code the message is concerned with.
|
Parser |
getParser()
Returns the parser that created this message.
|
boolean |
getShowInEditor()
Whether a squiggle underline should be drawn in the editor for this
notice.
|
String |
getToolTipText()
Returns the tooltip text to display for this notice.
|
int |
hashCode()
Returns the hash code for this notice.
|
void |
setColor(Color color)
Sets the color to use when painting this notice.
|
void |
setLevel(int level)
Sets the level of this notice.
|
void |
setShowInEditor(boolean show)
Sets whether a squiggle underline should be drawn in the editor for
this notice.
|
void |
setToolTipText(String text)
Sets the tooltip text to display for this notice.
|
String |
toString()
Returns a string representation of this parser notice.
|
public DefaultParserNotice(Parser parser, String msg, int line)
parser - The parser that created this notice.msg - The text of the message.line - The line number for the message.public DefaultParserNotice(Parser parser, String message, int line, int offset, int length)
parser - The parser that created this notice.message - The message.line - The line number corresponding to the message.offset - The offset in the input stream of the code the
message is concerned with, or -1 if unknown.length - The length of the code the message is concerned with,
or -1 if unknown.public int compareTo(ParserNotice other)
compareTo in interface Comparable<ParserNotice>other - Another parser notice.public boolean containsPosition(int pos)
containsPosition in interface ParserNoticepos - The position in the document.false if ParserNotice.getOffset() returns
-1.public boolean equals(Object obj)
public Color getColor()
getColor in interface ParserNoticepublic int getLength()
getLength in interface ParserNotice-1 if unknown.ParserNotice.getOffset(),
ParserNotice.getLine()public int getLevel()
getLevel in interface ParserNoticeParserNotice.INFO, ParserNotice.WARNING OR ParserNotice.ERROR.public int getLine()
getLine in interface ParserNoticepublic String getMessage()
getMessage in interface ParserNoticepublic int getOffset()
getOffset in interface ParserNotice-1 if unknown.ParserNotice.getLength(),
ParserNotice.getLine()public Parser getParser()
getParser in interface ParserNoticepublic boolean getShowInEditor()
getShowInEditor in interface ParserNoticepublic String getToolTipText()
getToolTipText in interface ParserNoticeParserNotice.getMessage().public int hashCode()
public void setColor(Color color)
color - The color to use.getColor()public void setLevel(int level)
level - The new level.getLevel()public void setShowInEditor(boolean show)
show - Whether to draw a squiggle underline.getShowInEditor()public void setToolTipText(String text)
text - The new tooltip text. This can be HTML. If this is
null, then tooltips will return the same text as
getMessage().getToolTipText()