APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.tools.javac.util

public final Class RawDiagnosticFormatter

extends AbstractDiagnosticFormatter
Class Inheritance
Imports
java.util.Collection, .EnumSet, .Locale, .Set, javax.tools.JavaFileObject, com.sun.tools.javac.api.DiagnosticFormatter.Configuration.*, .Formattable, com.sun.tools.javac.code.Source, com.sun.tools.javac.file.PathFileObject, com.sun.tools.javac.tree.JCTree.*

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.

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
RawDiagnosticFormatter.RawDiagnosticPosHelper

Helper class to generate stable positions for AST nodes occurring in diagnostic arguments.

Field Summary

Modifier and TypeField and Description
private static final Set<String>
pack-priv RawDiagnosticFormatter.RawDiagnosticPosHelper
rawDiagnosticPosHelper

The raw diagnostic helper.

Inherited from com.sun.tools.javac.util.AbstractDiagnosticFormatter:
depthmessagesprinter

Constructor Summary

AccessConstructor and Description
public
RawDiagnosticFormatter(Options
the compiler options
options
)

Create a formatter based on the supplied options.

Method Summary

Modifier and TypeMethod and Description
protected String
formatArgument(JCDiagnostic diag, Object arg, Locale l)

Overrides com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument.

Format a single argument of a given diagnostic.

public String
public String
formatMessage(JCDiagnostic d, Locale l)

Implements com.sun.tools.javac.api.DiagnosticFormatter.formatMessage.

Controls the way in which a diagnostic message is displayed.

public boolean
protected String
localize(Locale l, String key, Object... args)

Overrides com.sun.tools.javac.util.AbstractDiagnosticFormatter.localize.

Converts a String into a locale-dependent representation accordingly to a given locale.

Inherited from com.sun.tools.javac.util.AbstractDiagnosticFormatter:
displaySourceformatformatArgumentsformatIterableformatKindformatLintCategoryformatPositionformatSourceformatSourceLineformatSubdiagnosticformatSubdiagnosticsgetConfigurationgetPrinterindentindentStringsetPrinter

Field Detail

CODES_NEEDING_SOURCE_NORMALIZATIONback to summary
private static final Set<String> CODES_NEEDING_SOURCE_NORMALIZATION
rawDiagnosticPosHelperback to summary
pack-priv RawDiagnosticFormatter.RawDiagnosticPosHelper rawDiagnosticPosHelper

The raw diagnostic helper.

Constructor Detail

RawDiagnosticFormatterback to summary
public RawDiagnosticFormatter(Options options)

Create a formatter based on the supplied options.

Parameters
options:Options

the compiler options

Method Detail

formatArgumentback to summary
protected String formatArgument(JCDiagnostic diag, Object arg, Locale l)

Overrides com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument.

Doc from com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument.

Format a single argument of a given diagnostic.

Annotations
@Override
formatDiagnosticback to summary
public String formatDiagnostic(JCDiagnostic d, Locale l)

Implements abstract com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatDiagnostic.

formatMessageback to summary
public String formatMessage(JCDiagnostic d, Locale l)

Implements com.sun.tools.javac.api.DiagnosticFormatter.formatMessage.

Doc from com.sun.tools.javac.api.DiagnosticFormatter.formatMessage.

Controls the way in which a diagnostic message is displayed.

isRawback to summary
public boolean isRaw()

Overrides com.sun.tools.javac.util.AbstractDiagnosticFormatter.isRaw.

Annotations
@Override
localizeback to summary
protected String localize(Locale l, String key, Object... args)

Overrides com.sun.tools.javac.util.AbstractDiagnosticFormatter.localize.

Doc from com.sun.tools.javac.util.AbstractDiagnosticFormatter.localize.

Converts a String into a locale-dependent representation accordingly to a given locale.

Annotations
@Override
com.sun.tools.javac.util back to summary

pack-priv Class RawDiagnosticFormatter.RawDiagnosticPosHelper

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.tools.javac.util.RawDiagnosticFormatter.RawDiagnosticPosHelper

Helper class to generate stable positions for AST nodes occurring in diagnostic arguments. If the AST node appears in the same line number as the main diagnostic, the line information is omitted. Otherwise, both line and column information is included, using the format line:col.

Note

since subdiagnostics can be created without a diagnostic source, a position helper should always refer to the toplevel diagnostic source.

Field Summary

Modifier and TypeField and Description
private final JCDiagnostic

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

diagback to summary
private final JCDiagnostic diag

Constructor Detail

RawDiagnosticPosHelperback to summary
pack-priv RawDiagnosticPosHelper(JCDiagnostic diag)

Method Detail

getPositionback to summary
pack-priv String getPosition(JCTree.JCExpression exp)