public class DeferredLintHandler extends Object
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Class and Description |
---|---|
static interface |
DeferredLintHandler.LintLogger
An interface for deferred lint reporting - loggers passed to
report(LintLogger) will be called when
#flush(DiagnosticPosition) is invoked. |
Modifier and Type | Field and Description |
---|---|
protected static Context.Key<DeferredLintHandler> |
deferredLintHandlerKey |
Modifier | Constructor and Description |
---|---|
protected |
DeferredLintHandler(Context context) |
Modifier and Type | Method and Description |
---|---|
void |
flush(JCDiagnostic.DiagnosticPosition pos)
Invoke all
DeferredLintHandler.LintLogger s that were associated with the provided pos . |
JCDiagnostic.DiagnosticPosition |
immediate()
DeferredLintHandler.LintLogger s passed to subsequent invocations of
report(LintLogger) will be invoked immediately. |
static DeferredLintHandler |
instance(Context context) |
void |
report(DeferredLintHandler.LintLogger logger)
Associate the given logger with the current position as set by
#setPos(DiagnosticPosition) . |
JCDiagnostic.DiagnosticPosition |
setPos(JCDiagnostic.DiagnosticPosition currentPos)
Sets the current position to the provided
currentPos . |
protected static final Context.Key<DeferredLintHandler> deferredLintHandlerKey
protected DeferredLintHandler(Context context)
public static DeferredLintHandler instance(Context context)
public void report(DeferredLintHandler.LintLogger logger)
#setPos(DiagnosticPosition)
.
Will be invoked when #flush(DiagnosticPosition)
will be invoked with the same position.
immediate()
was called
instead of #setPos(DiagnosticPosition)
.public void flush(JCDiagnostic.DiagnosticPosition pos)
DeferredLintHandler.LintLogger
s that were associated with the provided pos
.public JCDiagnostic.DiagnosticPosition setPos(JCDiagnostic.DiagnosticPosition currentPos)
currentPos
. DeferredLintHandler.LintLogger
s
passed to subsequent invocations of report(LintLogger)
will be associated
with the given position.public JCDiagnostic.DiagnosticPosition immediate()
DeferredLintHandler.LintLogger
s passed to subsequent invocations of
report(LintLogger)
will be invoked immediately.Copyright © 2015. All rights reserved.