Interface ParserNotice
-
- All Superinterfaces:
Comparable<ParserNotice>
- All Known Implementing Classes:
DefaultParserNotice,TaskTagParser.TaskNotice
public interface ParserNotice extends Comparable<ParserNotice>
A notice (e.g., a warning or error) from a parser.Since different parsers have different levels of precision when it comes to identifying errors in code, this class supports marking parser notices on either a per-line basis or arbitrary regions of a document. For any
ParserNotice,getLine()is guaranteed to return the (primary) line containing the notice, butgetOffset()andgetLength()are allowed to return-1if that particular notice isn't mapped to a specific region of code. Applications can check whether an instance of this class only has line-level information with the- See Also:
DefaultParserNotice
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classParserNotice.LevelDenotes the severity of a parser notice.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsPosition(int pos)Returns whether this parser notice contains the specified location in the document.ColorgetColor()Returns the color to use when painting this notice.booleangetKnowsOffsetAndLength()Returns whether this parser notice has offset and length information (as opposed to just what line number to mark).intgetLength()Returns the length of the code the message is concerned with.ParserNotice.LevelgetLevel()Returns the level of this notice.intgetLine()Returns the line number the notice is about.StringgetMessage()Returns the message from the parser.intgetOffset()Returns the offset of the code the message is concerned with.ParsergetParser()Returns the parser that created this message.booleangetShowInEditor()Whether a squiggle underline should be drawn in the editor for this notice.StringgetToolTipText()Returns the tool tip text to display for this notice.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
containsPosition
boolean containsPosition(int pos)
Returns whether this parser notice contains the specified location in the document.- Parameters:
pos- The position in the document.- Returns:
- Whether the position is contained. This will always return
falseifgetOffset()returns-1.
-
getColor
Color getColor()
Returns the color to use when painting this notice.- Returns:
- The color.
-
getLength
int getLength()
Returns the length of the code the message is concerned with.- Returns:
- The length of the code the message is concerned with, or
-1if unknown. - See Also:
getOffset(),getLine()
-
getLevel
ParserNotice.Level getLevel()
Returns the level of this notice.- Returns:
- A value from the
ParserNotice.Levelenumeration.
-
getLine
int getLine()
Returns the line number the notice is about.- Returns:
- The line number.
-
getKnowsOffsetAndLength
boolean getKnowsOffsetAndLength()
Returns whether this parser notice has offset and length information (as opposed to just what line number to mark).- Returns:
- Whether the offset and length of the notice are specified.
- See Also:
getLine(),getOffset(),getLength()
-
getMessage
String getMessage()
Returns the message from the parser.- Returns:
- The message from the parser.
-
getOffset
int getOffset()
Returns the offset of the code the message is concerned with.- Returns:
- The offset, or
-1if unknown. - See Also:
getLength(),getLine()
-
getParser
Parser getParser()
Returns the parser that created this message.- Returns:
- The parser.
-
getShowInEditor
boolean getShowInEditor()
Whether a squiggle underline should be drawn in the editor for this notice.- Returns:
- Whether a squiggle underline should be drawn.
-
getToolTipText
String getToolTipText()
Returns the tool tip text to display for this notice.- Returns:
- The tool tip text. If none has been explicitly set, this
method returns the same text as
getMessage().
-
-