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 |
---|---|
public static class |
Modifier and Type | Field and Description |
---|---|
private List | allCaptured
All captured types that have been encountered during diagnostic formatting. |
private AbstractDiagnosticFormatter. | config
Configuration object used by this formatter |
protected int | depth
Current depth level of the diagnostic being formatted (!= 0 for subdiagnostics) |
protected JavacMessages | messages
JavacMessages object used by this formatter for i18n. |
protected Printer | printer
An enhanced printer for formatting types/symbols used by AbstractDiagnosticFormatter. |
Access | Constructor and Description |
---|---|
protected | AbstractDiagnosticFormatter(JavacMessages messages, AbstractDiagnosticFormatter.
Initialize an AbstractDiagnosticFormatter by setting its JavacMessages object. |
Modifier and Type | Method and Description |
---|---|
public boolean | displaySource(JCDiagnostic
diagnostic to be formatted d)Implements com. Whether the source code output for this diagnostic is to be displayed. |
private String | |
public String | format(JCDiagnostic
the diagnostic to be formatted d, Locale locale object to be used for i18n locale)Implements com. Format the contents of a diagnostics. |
protected String | Returns: string representation of the diagnostic argumentdiagnostic whose argument is to be formatted d, Object argument to be formatted arg, Locale locale object to be used for i18n l)Format a single argument of a given diagnostic. |
protected Collection | Returns: a Collection whose elements are the formatted arguments of the diagnosticdiagnostic whose arguments are to be formatted d, Locale locale object to be used for i18n l)Format the arguments of a given diagnostic. |
protected abstract String | |
protected String | Returns: string representation of the diagnostic iterable argumentdiagnostic whose argument is to be formatted d, Iterable<?> iterable argument to be formatted it, Locale locale object to be used for i18n l)Format an iterable argument of a given diagnostic. |
public String | formatKind(JCDiagnostic
diagnostic to be formatted d, Locale locale object to be used for i18n l)Implements com. Controls the way in which a diagnostic kind is displayed. |
protected String | |
public String | formatPosition(JCDiagnostic
diagnostic to be formatted d, DiagnosticFormatter.enum constant representing the position kind pk,locale object to be used for i18n l)Implements com. Controls the way in which a diagnostic position is displayed. |
public String | formatSource(JCDiagnostic
diagnostic to be formatted d, boolean whether the source fullname should be printed fullname, Locale locale object to be used for i18n l)Implements com. Controls the way in which a diagnostic source is displayed. |
protected String | formatSourceLine(JCDiagnostic
The diagnostic for which the error line should be printed d, int nSpaces)Format the faulty source code line and point to the error. |
protected String | Returns: string representation of the subdiagnosticsmultiline diagnostic whose subdiagnostics is to be formatted parent, JCDiagnostic subdiagnostic to be formatted sub, Locale locale object to be used for i18n l)Format a subdiagnostics attached to a given diagnostic. |
protected List | Returns: list of all string representations of the subdiagnosticsdiagnostic whose subdiagnostics are to be formatted d, Locale locale object to be used for i18n l)Format all the subdiagnostics attached to a given diagnostic. |
public AbstractDiagnosticFormatter. | getConfiguration()
Implements com. Get a list of all the enabled verbosity options. |
private long | |
public Printer | |
protected String | |
protected String | Returns: the indentation stringthe amount of spaces to be added to the result string nSpaces)Creates a string with a given amount of empty spaces. |
public boolean | |
protected String | |
public void |
allCaptured | back to summary |
---|---|
private List<Type> allCaptured All captured types that have been encountered during diagnostic formatting. This info is used by the FormatterPrinter in order to print friendly unique ids for captured types |
config | back to summary |
---|---|
private AbstractDiagnosticFormatter. Configuration object used by this formatter |
depth | back to summary |
---|---|
protected int depth Current depth level of the diagnostic being formatted (!= 0 for subdiagnostics) |
messages | back to summary |
---|---|
protected JavacMessages messages JavacMessages object used by this formatter for i18n. |
printer | back to summary |
---|---|
protected Printer printer An enhanced printer for formatting types/symbols used by AbstractDiagnosticFormatter. Provides alternate numbering of captured types (they are numbered starting from 1 on each new diagnostic, instead of relying on the underlying hashcode() method which generates unstable output). Also detects cycles in wildcard messages (e.g. if the wildcard type referred by a given captured type C contains C itself) which might lead to infinite loops. |
AbstractDiagnosticFormatter | back to summary |
---|---|
protected AbstractDiagnosticFormatter(JavacMessages messages, AbstractDiagnosticFormatter. Initialize an AbstractDiagnosticFormatter by setting its JavacMessages object. |
displaySource | back to summary |
---|---|
public boolean displaySource(JCDiagnostic d) Implements com. Doc from com. Whether the source code output for this diagnostic is to be displayed.
|
expr2String | back to summary |
---|---|
private String expr2String(JCTree. |
format | back to summary |
---|---|
public String format(JCDiagnostic d, Locale locale) Implements com. Doc from com. Format the contents of a diagnostics.
|
formatArgument | back to summary |
---|---|
protected String formatArgument(JCDiagnostic d, Object arg, Locale l) Format a single argument of a given diagnostic.
|
formatArguments | back to summary |
---|---|
protected Collection Format the arguments of a given diagnostic.
|
formatDiagnostic | back to summary |
---|---|
protected abstract String formatDiagnostic(JCDiagnostic d, Locale locale) |
formatIterable | back to summary |
---|---|
protected String formatIterable(JCDiagnostic d, Iterable<?> it, Locale l) Format an iterable argument of a given diagnostic.
|
formatKind | back to summary |
---|---|
public String formatKind(JCDiagnostic d, Locale l) Implements com. Doc from com. Controls the way in which a diagnostic kind is displayed.
|
formatLintCategory | back to summary |
---|---|
protected String formatLintCategory(JCDiagnostic d, Locale l) |
formatPosition | back to summary |
---|---|
public String formatPosition(JCDiagnostic d, DiagnosticFormatter. Implements com. Doc from com. Controls the way in which a diagnostic position is displayed.
|
formatSource | back to summary |
---|---|
public String formatSource(JCDiagnostic d, boolean fullname, Locale l) Implements com. Doc from com. Controls the way in which a diagnostic source is displayed.
|
formatSourceLine | back to summary |
---|---|
protected String formatSourceLine(JCDiagnostic d, int nSpaces) Format the faulty source code line and point to the error.
|
formatSubdiagnostic | back to summary |
---|---|
protected String formatSubdiagnostic(JCDiagnostic parent, JCDiagnostic sub, Locale l) Format a subdiagnostics attached to a given diagnostic.
|
formatSubdiagnostics | back to summary |
---|---|
protected List Format all the subdiagnostics attached to a given diagnostic.
|
getConfiguration | back to summary |
---|---|
public AbstractDiagnosticFormatter. Implements com. Doc from com. Get a list of all the enabled verbosity options.
|
getPosition | back to summary |
---|---|
private long getPosition(JCDiagnostic d, DiagnosticFormatter. |
getPrinter | back to summary |
---|---|
public Printer getPrinter() |
indent | back to summary |
---|---|
protected String indent(String s, int nSpaces) Indent a string by prepending a given amount of empty spaces to each line of the string. |
indentString | back to summary |
---|---|
protected String indentString(int nSpaces) Creates a string with a given amount of empty spaces. Useful for indenting the text of a diagnostic message.
|
isRaw | back to summary |
---|---|
public boolean isRaw() |
localize | back to summary |
---|---|
protected String localize(Locale l, String key, Object... args) Converts a String into a locale-dependent representation accordingly to a given locale. |
setPrinter | back to summary |
---|---|
public void setPrinter(Printer printer) |
Modifier and Type | Field and Description |
---|---|
protected boolean | |
protected Map | |
protected EnumSet |
Access | Constructor and Description |
---|---|
public | |
public |
Modifier and Type | Method and Description |
---|---|
public int | getMultilineLimit(DiagnosticFormatter.
the kind of limit to be retrieved limitImplements com. Get a multiline diagnostic limit. |
public EnumSet | getVisible()
Implements com. Retrieve the set of diagnostic parts that should be displayed by the formatter. |
public boolean | Returns: true if the caret is enabledTells whether the caret display is active or not. |
public void | setCaretEnabled(boolean
if true enables caret caretEnabled)Shows a '^' sign under the source line displayed by the formatter (if applicable). |
public void | setMultilineLimit(DiagnosticFormatter.
the kind of limit to be set limit,the limit value value)Implements com. Set a limit for multiline diagnostics. |
public void | setVisible(Set<DiagnosticFormatter.
the parts to be set diagPartsImplements com. Configure the set of diagnostic parts that should be displayed by the formatter. |
public void |
caretEnabled | back to summary |
---|---|
protected boolean caretEnabled |
multilineLimits | back to summary |
---|---|
protected Map<DiagnosticFormatter. |
visibleParts | back to summary |
---|---|
protected EnumSet<DiagnosticFormatter. |
SimpleConfiguration | back to summary |
---|---|
public SimpleConfiguration(Set<DiagnosticFormatter.
|
SimpleConfiguration | back to summary |
---|---|
public SimpleConfiguration(Options options, Set<DiagnosticFormatter.
|
getMultilineLimit | back to summary |
---|---|
public int getMultilineLimit(DiagnosticFormatter. Implements com. Doc from com. Get a multiline diagnostic limit.
|
getVisible | back to summary |
---|---|
public EnumSet Implements com. Doc from com. Retrieve the set of diagnostic parts that should be displayed by the formatter.
|
isCaretEnabled | back to summary |
---|---|
public boolean isCaretEnabled() Tells whether the caret display is active or not.
|
setCaretEnabled | back to summary |
---|---|
public void setCaretEnabled(boolean caretEnabled) Shows a '^' sign under the source line displayed by the formatter (if applicable).
|
setMultilineLimit | back to summary |
---|---|
public void setMultilineLimit(DiagnosticFormatter. Implements com. Doc from com. Set a limit for multiline diagnostics. Note Setting a limit has no effect if multiline diagnostics are either fully enabled or disabled.
|
setVisible | back to summary |
---|---|
public void setVisible(Set<DiagnosticFormatter. Implements com. Doc from com. Configure the set of diagnostic parts that should be displayed by the formatter.
|
setVisiblePart | back to summary |
---|---|
public void setVisiblePart(DiagnosticFormatter. |