public class DefaultParserNotice extends java.lang.Object implements ParserNotice
Parser
implementations can return instances of this in their parse result.Parser
,
ParseResult
ERROR, INFO, WARNING
构造器和说明 |
---|
DefaultParserNotice(Parser parser,
java.lang.String msg,
int line)
Constructor.
|
DefaultParserNotice(Parser parser,
java.lang.String message,
int line,
int offset,
int length)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
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(java.lang.Object obj)
Returns whether this parser notice is equal to another one.
|
java.awt.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.
|
java.lang.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.
|
java.lang.String |
getToolTipText()
Returns the tooltip text to display for this notice.
|
int |
hashCode()
Returns the hash code for this notice.
|
void |
setColor(java.awt.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(java.lang.String text)
Sets the tooltip text to display for this notice.
|
java.lang.String |
toString()
Returns a string representation of this parser notice.
|
public DefaultParserNotice(Parser parser, java.lang.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, java.lang.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
在接口中 java.lang.Comparable<ParserNotice>
other
- Another parser notice.public boolean containsPosition(int pos)
containsPosition
在接口中 ParserNotice
pos
- The position in the document.false
if ParserNotice.getOffset()
returns
-1
.public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
obj
- Another parser notice.public java.awt.Color getColor()
getColor
在接口中 ParserNotice
public int getLength()
getLength
在接口中 ParserNotice
-1
if unknown.ParserNotice.getOffset()
,
ParserNotice.getLine()
public int getLevel()
getLevel
在接口中 ParserNotice
ParserNotice.INFO
, ParserNotice.WARNING
OR ParserNotice.ERROR
.public int getLine()
getLine
在接口中 ParserNotice
public java.lang.String getMessage()
getMessage
在接口中 ParserNotice
public int getOffset()
getOffset
在接口中 ParserNotice
-1
if unknown.ParserNotice.getLength()
,
ParserNotice.getLine()
public Parser getParser()
getParser
在接口中 ParserNotice
public boolean getShowInEditor()
getShowInEditor
在接口中 ParserNotice
public java.lang.String getToolTipText()
getToolTipText
在接口中 ParserNotice
ParserNotice.getMessage()
.public int hashCode()
hashCode
在类中 java.lang.Object
public void setColor(java.awt.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(java.lang.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()
public java.lang.String toString()
toString
在类中 java.lang.Object