public class JCDiagnostic extends Object implements Diagnostic<JavaFileObject>
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 class |
JCDiagnostic.DiagnosticFlag |
static interface |
JCDiagnostic.DiagnosticPosition
A DiagnosticPosition provides information about the positions in a file
that gave rise to a diagnostic.
|
static class |
JCDiagnostic.DiagnosticType
A DiagnosticType defines the type of the diagnostic.
|
static class |
JCDiagnostic.Factory
A factory for creating diagnostic objects.
|
static class |
JCDiagnostic.MultilineDiagnostic |
static class |
JCDiagnostic.SimpleDiagnosticPosition
A DiagnosticPosition that simply identifies a position, but no related
tree node, as the location for a diagnostic.
|
Diagnostic.Kind
Modifier and Type | Field and Description |
---|---|
protected Object[] |
args |
NOPOS
Modifier | Constructor and Description |
---|---|
protected |
JCDiagnostic(DiagnosticFormatter<JCDiagnostic> formatter,
JCDiagnostic.DiagnosticType dt,
Lint.LintCategory lc,
Set<JCDiagnostic.DiagnosticFlag> flags,
DiagnosticSource source,
JCDiagnostic.DiagnosticPosition pos,
String key,
Object... args)
Create a diagnostic object.
|
Modifier and Type | Method and Description |
---|---|
static JCDiagnostic |
fragment(String key,
Object... args)
Deprecated.
|
Object[] |
getArgs()
Get the arguments to be included in the text of the diagnostic.
|
String |
getCode() |
long |
getColumnNumber()
Get the column number within the line of source referred to by this diagnostic.
|
JCDiagnostic.DiagnosticPosition |
getDiagnosticPosition() |
DiagnosticSource |
getDiagnosticSource()
Get the source referred to by this diagnostic.
|
long |
getEndPosition() |
static DiagnosticFormatter<JCDiagnostic> |
getFragmentFormatter()
Deprecated.
|
protected int |
getIntEndPosition() |
protected int |
getIntPosition() |
protected int |
getIntStartPosition() |
Diagnostic.Kind |
getKind() |
long |
getLineNumber()
Get the line number within the source referred to by this diagnostic.
|
Lint.LintCategory |
getLintCategory()
Get the associated lint category, or null if none.
|
String |
getMessage(Locale locale) |
long |
getPosition() |
String |
getPrefix()
Get the prefix string associated with this type of diagnostic.
|
String |
getPrefix(JCDiagnostic.DiagnosticType dt)
Get the prefix string associated with a particular type of diagnostic.
|
JavaFileObject |
getSource()
Get the name of the source file referred to by this diagnostic.
|
long |
getStartPosition() |
List<JCDiagnostic> |
getSubdiagnostics()
Get the subdiagnostic list
|
JCDiagnostic.DiagnosticType |
getType()
Get the type of this diagnostic.
|
boolean |
hasLintCategory()
Check whether this diagnostic has an associated lint category.
|
boolean |
isFlagSet(JCDiagnostic.DiagnosticFlag flag) |
boolean |
isMandatory()
Check whether or not this diagnostic is required to be shown.
|
boolean |
isMultiline() |
void |
setFlag(JCDiagnostic.DiagnosticFlag flag) |
String |
toString()
Return the standard presentation of this diagnostic.
|
protected final Object[] args
protected JCDiagnostic(DiagnosticFormatter<JCDiagnostic> formatter, JCDiagnostic.DiagnosticType dt, Lint.LintCategory lc, Set<JCDiagnostic.DiagnosticFlag> flags, DiagnosticSource source, JCDiagnostic.DiagnosticPosition pos, String key, Object... args)
formatter
- the formatter to use for the diagnosticdt
- the type of diagnosticlc
- the lint category for the diagnosticsource
- the name of the source file, or null if none.pos
- the character offset within the source file, if given.key
- a resource key to identify the text of the diagnosticargs
- arguments to be included in the text of the diagnostic@Deprecated public static JCDiagnostic fragment(String key, Object... args)
key
- The key for the localized error message.args
- Fields of the error message.@Deprecated public static DiagnosticFormatter<JCDiagnostic> getFragmentFormatter()
public JCDiagnostic.DiagnosticType getType()
public List<JCDiagnostic> getSubdiagnostics()
public boolean isMultiline()
public boolean isMandatory()
public boolean hasLintCategory()
public Lint.LintCategory getLintCategory()
public JavaFileObject getSource()
getSource
in interface Diagnostic<JavaFileObject>
public DiagnosticSource getDiagnosticSource()
protected int getIntStartPosition()
protected int getIntPosition()
protected int getIntEndPosition()
public long getStartPosition()
getStartPosition
in interface Diagnostic<JavaFileObject>
public long getPosition()
getPosition
in interface Diagnostic<JavaFileObject>
public long getEndPosition()
getEndPosition
in interface Diagnostic<JavaFileObject>
public JCDiagnostic.DiagnosticPosition getDiagnosticPosition()
public long getLineNumber()
getLineNumber
in interface Diagnostic<JavaFileObject>
public long getColumnNumber()
getColumnNumber
in interface Diagnostic<JavaFileObject>
public Object[] getArgs()
public String getPrefix()
public String getPrefix(JCDiagnostic.DiagnosticType dt)
public String toString()
public Diagnostic.Kind getKind()
getKind
in interface Diagnostic<JavaFileObject>
public String getCode()
getCode
in interface Diagnostic<JavaFileObject>
public String getMessage(Locale locale)
getMessage
in interface Diagnostic<JavaFileObject>
public void setFlag(JCDiagnostic.DiagnosticFlag flag)
public boolean isFlagSet(JCDiagnostic.DiagnosticFlag flag)
Copyright © 2017 earcam. All rights reserved.