com.sun.tools.javac.util
Class RawDiagnosticFormatter
java.lang.Object
com.sun.tools.javac.util.AbstractDiagnosticFormatter
com.sun.tools.javac.util.RawDiagnosticFormatter
- All Implemented Interfaces:
- DiagnosticFormatter<JCDiagnostic>
public class RawDiagnosticFormatter
- extends AbstractDiagnosticFormatter
A raw formatter for diagnostic messages.
The raw formatter will format a diagnostic according to one of two format patterns, depending on whether
or not the source name and position are set. This formatter provides a standardized, localize-independent
implementation of a diagnostic formatter; as such, this formatter is best suited for testing purposes.
|
Method Summary |
java.lang.String |
format(JCDiagnostic d,
java.util.Locale l)
Format the contents of a diagnostics |
protected java.lang.String |
formatArgument(JCDiagnostic diag,
java.lang.Object arg,
java.util.Locale l)
Format a single argument of a given diagnostic. |
protected java.lang.String |
formatSubdiagnostics(JCDiagnostic d,
java.util.Locale l)
Format all the subdiagnostics attached to a given diagnostic |
protected java.lang.String |
localize(java.util.Locale l,
java.lang.String s,
java.lang.Object... args)
Converts a String into a locale-dependent representation accordingly to a given locale |
| Methods inherited from class com.sun.tools.javac.util.AbstractDiagnosticFormatter |
displaySource, formatArguments, formatIterable, formatKind, formatMessage, formatPosition, formatSource, formatSourceLine, getPosition, indent, indentString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RawDiagnosticFormatter
public RawDiagnosticFormatter(Options opts)
- Create a formatter based on the supplied options.
- Parameters:
msgs -
format
public java.lang.String format(JCDiagnostic d,
java.util.Locale l)
- Description copied from interface:
DiagnosticFormatter
- Format the contents of a diagnostics
- Parameters:
d - the diagnostic to be formattedl - locale object to be used for i18n
- Returns:
- a string representing the diagnostic
formatArgument
protected java.lang.String formatArgument(JCDiagnostic diag,
java.lang.Object arg,
java.util.Locale l)
- Description copied from class:
AbstractDiagnosticFormatter
- Format a single argument of a given diagnostic.
- Overrides:
formatArgument in class AbstractDiagnosticFormatter
- Parameters:
diag - diagnostic whose argument is to be formattedarg - argument to be formattedl - locale object to be used for i18n
- Returns:
- string representation of the diagnostic argument
formatSubdiagnostics
protected java.lang.String formatSubdiagnostics(JCDiagnostic d,
java.util.Locale l)
- Description copied from class:
AbstractDiagnosticFormatter
- Format all the subdiagnostics attached to a given diagnostic
- Overrides:
formatSubdiagnostics in class AbstractDiagnosticFormatter
- Parameters:
d - diagnostic whose subdiagnostics are to be formattedl - locale object to be used for i18n
- Returns:
- string representation of the subdiagnostics
localize
protected java.lang.String localize(java.util.Locale l,
java.lang.String s,
java.lang.Object... args)
- Description copied from class:
AbstractDiagnosticFormatter
- Converts a String into a locale-dependent representation accordingly to a given locale
- Overrides:
localize in class AbstractDiagnosticFormatter
- Parameters:
l - locale object to be used for i18ns - locale-independent key used for looking up in a resource fileargs - localization arguments
- Returns:
- a locale-dependent string