com.sun.tools.javac.util
Class JCDiagnostic.Factory

java.lang.Object
  extended by com.sun.tools.javac.util.JCDiagnostic.Factory
Enclosing class:
JCDiagnostic

public static class JCDiagnostic.Factory
extends java.lang.Object

A factory for creating diagnostic objects.


Field Summary
protected static Context.Key<JCDiagnostic.Factory> diagnosticFactoryKey
          The context key for the diagnostic factory.
(package private)  DiagnosticFormatter<JCDiagnostic> formatter
           
(package private)  java.lang.String prefix
           
 
Constructor Summary
protected JCDiagnostic.Factory(Context context)
          Create a new diagnostic factory.
  JCDiagnostic.Factory(JavacMessages messages, java.lang.String prefix)
          Create a new diagnostic factory.
 
Method Summary
 JCDiagnostic error(DiagnosticSource source, JCDiagnostic.DiagnosticPosition pos, java.lang.String key, java.lang.Object... args)
          Create an error diagnostic.
 JCDiagnostic fragment(java.lang.String key, java.lang.Object... args)
          Create a fragment diagnostic, for use as an argument in other diagnostics
static JCDiagnostic.Factory instance(Context context)
          Get the Factory instance for this context.
 JCDiagnostic mandatoryNote(DiagnosticSource source, java.lang.String key, java.lang.Object... args)
          Create a note diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
 JCDiagnostic mandatoryWarning(DiagnosticSource source, JCDiagnostic.DiagnosticPosition pos, java.lang.String key, java.lang.Object... args)
          Create a warning diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
 JCDiagnostic note(DiagnosticSource source, JCDiagnostic.DiagnosticPosition pos, java.lang.String key, java.lang.Object... args)
          Create a note diagnostic.
 JCDiagnostic note(java.lang.String key, java.lang.Object... args)
          Create a note diagnostic.
protected  java.lang.String qualify(JCDiagnostic.DiagnosticType t, java.lang.String key)
           
 JCDiagnostic warning(DiagnosticSource source, JCDiagnostic.DiagnosticPosition pos, java.lang.String key, java.lang.Object... args)
          Create a warning diagnostic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diagnosticFactoryKey

protected static final Context.Key<JCDiagnostic.Factory> diagnosticFactoryKey
The context key for the diagnostic factory.


formatter

DiagnosticFormatter<JCDiagnostic> formatter

prefix

final java.lang.String prefix
Constructor Detail

JCDiagnostic.Factory

protected JCDiagnostic.Factory(Context context)
Create a new diagnostic factory.


JCDiagnostic.Factory

public JCDiagnostic.Factory(JavacMessages messages,
                            java.lang.String prefix)
Create a new diagnostic factory.

Method Detail

instance

public static JCDiagnostic.Factory instance(Context context)
Get the Factory instance for this context.


error

public JCDiagnostic error(DiagnosticSource source,
                          JCDiagnostic.DiagnosticPosition pos,
                          java.lang.String key,
                          java.lang.Object... args)
Create an error diagnostic.

Parameters:
source - The source of the compilation unit, if any, in which to report the error.
pos - The source position at which to report the error.
key - The key for the localized error message.
args - Fields of the error message.

mandatoryWarning

public JCDiagnostic mandatoryWarning(DiagnosticSource source,
                                     JCDiagnostic.DiagnosticPosition pos,
                                     java.lang.String key,
                                     java.lang.Object... args)
Create a warning diagnostic that will not be hidden by the -nowarn or -Xlint:none options.

Parameters:
source - The source of the compilation unit, if any, in which to report the warning.
pos - The source position at which to report the warning.
key - The key for the localized error message.
args - Fields of the error message.
See Also:
MandatoryWarningHandler

warning

public JCDiagnostic warning(DiagnosticSource source,
                            JCDiagnostic.DiagnosticPosition pos,
                            java.lang.String key,
                            java.lang.Object... args)
Create a warning diagnostic.

Parameters:
source - The source of the compilation unit, if any, in which to report the warning.
pos - The source position at which to report the warning.
key - The key for the localized error message.
args - Fields of the error message.

mandatoryNote

public JCDiagnostic mandatoryNote(DiagnosticSource source,
                                  java.lang.String key,
                                  java.lang.Object... args)
Create a note diagnostic that will not be hidden by the -nowarn or -Xlint:none options.

Parameters:
key - The key for the localized error message.
args - Fields of the error message.
See Also:
MandatoryWarningHandler

note

public JCDiagnostic note(java.lang.String key,
                         java.lang.Object... args)
Create a note diagnostic.

Parameters:
key - The key for the localized error message.
args - Fields of the error message.

note

public JCDiagnostic note(DiagnosticSource source,
                         JCDiagnostic.DiagnosticPosition pos,
                         java.lang.String key,
                         java.lang.Object... args)
Create a note diagnostic.

Parameters:
source - The source of the compilation unit, if any, in which to report the note.
pos - The source position at which to report the note.
key - The key for the localized error message.
args - Fields of the error message.

fragment

public JCDiagnostic fragment(java.lang.String key,
                             java.lang.Object... args)
Create a fragment diagnostic, for use as an argument in other diagnostics

Parameters:
key - The key for the localized error message.
args - Fields of the error message.

qualify

protected java.lang.String qualify(JCDiagnostic.DiagnosticType t,
                                   java.lang.String key)