|
org.netbeans.modules.parsing.api/1 1.55.0 6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.modules.parsing.spi.Parser
public abstract class Parser
Represents implementation of parser for one language.
Parser is always created by ParserFactory for some concrete
Snapshot or collection of Snapshots.
Parser fires change when some conditions are changed and sources
should be reparsed. One instance of Parser can be reused for more Snapshots
created from one Source.
| Nested Class Summary | |
|---|---|
static class |
Parser.CancelReason
The Parser.CancelReason is passed to cancel(org.netbeans.modules.parsing.spi.Parser.CancelReason, org.netbeans.modules.parsing.spi.SourceModificationEvent)
as a hint. |
static class |
Parser.Result
Represents result of parsing created for one specific Task. |
| Constructor Summary | |
|---|---|
Parser()
|
|
| Method Summary | |
|---|---|
abstract void |
addChangeListener(ChangeListener changeListener)
Registers new listener. |
void |
cancel()
Deprecated. use cancel(CancelReason, org.netbeans.modules.parsing.spi.SourceModificationEvent) |
void |
cancel(Parser.CancelReason reason,
SourceModificationEvent event)
Called by the infrastructure to stop the parser operation. |
abstract Parser.Result |
getResult(Task task)
Called when some task needs some result of parsing. |
abstract void |
parse(Snapshot snapshot,
Task task,
SourceModificationEvent event)
Called by infrastructure when Source
is changed, and a new Snapshot
has been created for it. |
abstract void |
removeChangeListener(ChangeListener changeListener)
Unregisters listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Parser()
| Method Detail |
|---|
public abstract void parse(Snapshot snapshot,
Task task,
SourceModificationEvent event)
throws ParseException
Source
is changed, and a new Snapshot
has been created for it.
snapshot - A snapshot that should be parsed.task - A task asking for parsing result.event - A scheduler event.
ParseException
public abstract Parser.Result getResult(Task task)
throws ParseException
UserTask, or
SchedulerTask instance, that requests Parser.Result.
task - A task asking for parsing result.
ParseException@Deprecated public void cancel()
cancel(CancelReason, org.netbeans.modules.parsing.spi.SourceModificationEvent)
public void cancel(@NonNull
Parser.CancelReason reason,
@NullAllowed
SourceModificationEvent event)
reason - of the cancel, see Parser#CancelReasonevent - an additional info if the reason is SOURCE_MODIFICATION_EVENT, otherwise nullpublic abstract void addChangeListener(ChangeListener changeListener)
changeListener - A change listener to be registered.public abstract void removeChangeListener(ChangeListener changeListener)
changeListener - A change listener to be unregistered.
|
org.netbeans.modules.parsing.api/1 1.55.0 6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||