Interface Parser
-
- All Known Implementing Classes:
AbstractParser
,TaskTagParser
,XmlParser
public interface Parser
An interface for a parser for content in anRSyntaxTextArea
. AParser
returns a list of issues it finds in the text area's content, which the text area can flag (e.g. squiggle underline). It can also return descriptions of the issues, to be used in tool tips.To install a
Parser
, simply callRSyntaxTextArea.addParser(Parser)
.- See Also:
AbstractParser
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExtendedHyperlinkListener
getHyperlinkListener()
Returns the listener for hyperlink events fromFocusableTip
s, ornull
if none.URL
getImageBase()
Returns the base URL for any images displayed in returnedParserNotice
HTML text.boolean
isEnabled()
Returns whether this parser is enabled.ParseResult
parse(RSyntaxDocument doc, String style)
Parses input from the specified document.
-
-
-
Method Detail
-
getHyperlinkListener
ExtendedHyperlinkListener getHyperlinkListener()
Returns the listener for hyperlink events fromFocusableTip
s, ornull
if none.- Returns:
- The listener.
-
getImageBase
URL getImageBase()
Returns the base URL for any images displayed in returnedParserNotice
HTML text. Note that if a parser notice's text is not HTML, this URL is not used.- Returns:
- The URL. This may be
null
.
-
isEnabled
boolean isEnabled()
Returns whether this parser is enabled. If this returnsfalse
, it will not be run.- Returns:
- Whether this parser is enabled.
-
parse
ParseResult parse(RSyntaxDocument doc, String style)
Parses input from the specified document.- Parameters:
doc
- The document to parse. This document is in a read lock, so it cannot be modified while parsing is occurring.style
- The language being rendered, such asSyntaxConstants.SYNTAX_STYLE_JAVA
.- Returns:
- An object describing the section of the document parsed and the
results. This is guaranteed to be non-
null
.
-
-