|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fife.ui.rsyntaxtextarea.parser.AbstractParser
org.fife.rsta.ac.java.JavaParser
public class JavaParser
Parses Java code in an RSyntaxTextArea.
Like all RSTA Parsers, a JavaParser instance is notified
when the RSTA's text content changes. After a small delay, it will parse
the content as Java code, building an AST and looking for any errors. When
parsing is complete, a property change event of type
PROPERTY_COMPILATION_UNIT is fired. Listeners can check the new
value of the property for the CompilationUnit built that represents
the source code in the text area. Note that the CompilationUnit
may be incomplete if there were parsing/syntax errors (it will usually be
complete "up to" the error in the content).
This parser cannot be shared amongst multiple instances of RSyntaxTextArea.
Please keep in mind that this class is a work-in-progress!
| Field Summary | |
|---|---|
static String |
PROPERTY_COMPILATION_UNIT
The property change event that's fired when the document is re-parsed. |
| Constructor Summary | |
|---|---|
JavaParser(RSyntaxTextArea textArea)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(String prop,
PropertyChangeListener l)
|
CompilationUnit |
getCompilationUnit()
Returns the compilation unit from the last time the text area was parsed. |
int |
getOffset(RSyntaxDocument doc,
ParserNotice notice)
|
ParseResult |
parse(RSyntaxDocument doc,
String style)
|
void |
removePropertyChangeListener(String prop,
PropertyChangeListener l)
|
| Methods inherited from class org.fife.ui.rsyntaxtextarea.parser.AbstractParser |
|---|
getHyperlinkListener, getImageBase, isEnabled, setEnabled, setHyperlinkListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROPERTY_COMPILATION_UNIT
| Constructor Detail |
|---|
public JavaParser(RSyntaxTextArea textArea)
| Method Detail |
|---|
public void addPropertyChangeListener(String prop,
PropertyChangeListener l)
public CompilationUnit getCompilationUnit()
null if it hasn't yet
been parsed or an unexpected error occurred while parsing.
public int getOffset(RSyntaxDocument doc,
ParserNotice notice)
public ParseResult parse(RSyntaxDocument doc,
String style)
public void removePropertyChangeListener(String prop,
PropertyChangeListener l)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||