public class RichDiagnosticFormatter extends ForwardingDiagnosticFormatter<JCDiagnostic,AbstractDiagnosticFormatter>
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 |
---|---|
protected class |
RichDiagnosticFormatter.ClassNameSimplifier
A name simplifier keeps track of class names usages in order to determine
whether a class name can be compacted or not.
|
static class |
RichDiagnosticFormatter.RichConfiguration
Configuration object provided by the rich formatter.
|
protected class |
RichDiagnosticFormatter.RichPrinter
Enhanced type/symbol printer that provides support for features like simple names
and type variable disambiguation.
|
ForwardingDiagnosticFormatter.ForwardingConfiguration
DiagnosticFormatter.Configuration, DiagnosticFormatter.PositionKind
Modifier and Type | Field and Description |
---|---|
protected RichDiagnosticFormatter.ClassNameSimplifier |
nameSimplifier |
protected Types.DefaultSymbolVisitor<Void,Void> |
symbolPreprocessor |
protected Types.UnaryVisitor<Void> |
typePreprocessor |
configuration, formatter
Modifier | Constructor and Description |
---|---|
protected |
RichDiagnosticFormatter(Context context) |
Modifier and Type | Method and Description |
---|---|
String |
format(JCDiagnostic diag,
Locale l)
Format the contents of a diagnostics.
|
String |
formatMessage(JCDiagnostic diag,
Locale l)
Controls the way in which a diagnostic message is displayed.
|
RichDiagnosticFormatter.RichConfiguration |
getConfiguration()
Get a list of all the enabled verbosity options.
|
protected RichDiagnosticFormatter.RichPrinter |
getRichPrinter()
Gets the type/symbol printer used by this formatter.
|
protected List<JCDiagnostic> |
getWhereClauses()
Build a list of multiline diagnostics containing detailed info about
type-variables, captured types, and intersection types
|
static RichDiagnosticFormatter |
instance(Context context)
Get the DiagnosticFormatter instance for this context.
|
protected void |
preprocessArgument(Object arg)
Preprocess a diagnostic argument.
|
protected void |
preprocessDiagnostic(JCDiagnostic diag)
Preprocess a given diagnostic by looking both into its arguments and into
its subdiagnostics (if any).
|
protected void |
preprocessSymbol(Symbol s)
Preprocess a given symbol looking for (i) additional info (where clauses) to be
added to the main diagnostic (ii) names to be compacted
|
protected void |
preprocessType(Type t)
Preprocess a given type looking for (i) additional info (where clauses) to be
added to the main diagnostic (ii) names to be compacted.
|
protected void |
setRichPrinter(RichDiagnosticFormatter.RichPrinter printer)
Sets the type/symbol printer used by this formatter.
|
displaySource, formatKind, formatPosition, formatSource, getDelegatedFormatter
protected RichDiagnosticFormatter.ClassNameSimplifier nameSimplifier
protected Types.UnaryVisitor<Void> typePreprocessor
protected Types.DefaultSymbolVisitor<Void,Void> symbolPreprocessor
protected RichDiagnosticFormatter(Context context)
public static RichDiagnosticFormatter instance(Context context)
public String format(JCDiagnostic diag, Locale l)
DiagnosticFormatter
format
in interface DiagnosticFormatter<JCDiagnostic>
format
in class ForwardingDiagnosticFormatter<JCDiagnostic,AbstractDiagnosticFormatter>
diag
- the diagnostic to be formattedl
- locale object to be used for i18npublic String formatMessage(JCDiagnostic diag, Locale l)
DiagnosticFormatter
formatMessage
in interface DiagnosticFormatter<JCDiagnostic>
formatMessage
in class ForwardingDiagnosticFormatter<JCDiagnostic,AbstractDiagnosticFormatter>
diag
- diagnostic to be formattedl
- locale object to be used for i18nprotected void setRichPrinter(RichDiagnosticFormatter.RichPrinter printer)
printer
- the rich printer to be setprotected RichDiagnosticFormatter.RichPrinter getRichPrinter()
protected void preprocessDiagnostic(JCDiagnostic diag)
diag
- the diagnostic to be preprocessedprotected void preprocessArgument(Object arg)
arg
- the argument to be translatedprotected List<JCDiagnostic> getWhereClauses()
protected void preprocessType(Type t)
protected void preprocessSymbol(Symbol s)
public RichDiagnosticFormatter.RichConfiguration getConfiguration()
DiagnosticFormatter
getConfiguration
in interface DiagnosticFormatter<JCDiagnostic>
getConfiguration
in class ForwardingDiagnosticFormatter<JCDiagnostic,AbstractDiagnosticFormatter>
Copyright © 2015. All rights reserved.