Home » openjdk-7 » com.sun.tools » javac » util » [javadoc | source]
com.sun.tools.javac.util
public class: Log [javadoc | source]
java.lang.Object
   com.sun.tools.javac.util.AbstractLog
      com.sun.tools.javac.util.Log

Direct Known Subclasses:
    Bark, Messager

A class for error logs. Reports errors and warnings, and keeps track of error numbers and positions.

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.
Field Summary
public static final  Key<Log> logKey    The context key for the log. 
public static final  Key<PrintWriter> outKey    The context key for the output PrintWriter. 
public final  PrintWriter errWriter     
public final  PrintWriter warnWriter     
public final  PrintWriter noticeWriter     
public final  int MaxErrors    The maximum number of errors/warnings that are reported. 
public final  int MaxWarnings     
public  boolean promptOnError    Switch: prompt user on each error. 
public  boolean emitWarnings    Switch: emit warning messages. 
public  boolean suppressNotes    Switch: suppress note messages. 
public  boolean dumpOnError    Print stack trace on errors? 
public  boolean multipleErrors    Print multiple errors for same source locations. 
protected  DiagnosticListener<JavaFileObject> diagListener    Diagnostic listener, if provided through programmatic interface to javac (JSR 199). 
public  Set<String> expectDiagKeys    Keys for expected diagnostics. 
public  boolean deferDiagnostics    Deferred diagnostics 
public  Queue<JCDiagnostic> deferredDiagnostics     
public  int nerrors    The number of errors encountered so far. 
public  int nwarnings    The number of warnings encountered so far. 
Fields inherited from com.sun.tools.javac.util.AbstractLog:
diags,  source,  sourceMap
Constructor:
 protected Log(Context context) 
    Construct a log with default settings.
 protected Log(Context context,
    PrintWriter defaultWriter) 
    Construct a log with all output redirected.
 protected Log(Context context,
    PrintWriter errWriter,
    PrintWriter warnWriter,
    PrintWriter noticeWriter) 
    Construct a log with given I/O redirections.
Method from com.sun.tools.javac.util.Log Summary:
currentSourceFile,   defaultWriter,   directError,   flush,   format,   getDefaultMaxErrors,   getDefaultMaxWarnings,   getDiagnosticFormatter,   getLocalizedString,   getWriterForDiagnosticType,   hasDiagnosticListener,   instance,   localize,   printErrLines,   printLines,   printNoteLines,   printVerbose,   prompt,   rawError,   rawWarning,   report,   reportDeferredDiagnostics,   reportDeferredDiagnostics,   setDiagnosticFormatter,   setEndPosTable,   shouldReport,   strictWarning,   writeDiagnostic
Methods from com.sun.tools.javac.util.AbstractLog:
currentSource,   directError,   error,   error,   error,   error,   getSource,   mandatoryNote,   mandatoryWarning,   mandatoryWarning,   note,   note,   note,   note,   report,   useSource,   warning,   warning,   warning,   warning,   warning
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.util.Log Detail:
 public JavaFileObject currentSourceFile() 
    Return current sourcefile.
 static final PrintWriter defaultWriter(Context context) 
    The default writer for diagnostics
 protected  void directError(String key,
    Object args) 
 public  void flush() 
    Flush the logs
 public static String format(String fmt,
    Object args) 
 protected int getDefaultMaxErrors() 
    Default value for -Xmaxerrs.
 protected int getDefaultMaxWarnings() 
    Default value for -Xmaxwarns.
 public DiagnosticFormatter<JCDiagnostic> getDiagnosticFormatter() 
    Get the current diagnostic formatter.
 public static String getLocalizedString(String key,
    Object args) 
    Find a localized string in the resource bundle. Because this method is static, it ignores the locale. Use localize(key, args) when possible.
 protected PrintWriter getWriterForDiagnosticType(DiagnosticType dt) 
 public boolean hasDiagnosticListener() 
 public static Log instance(Context context) 
    Get the Log instance for this context.
 public String localize(String key,
    Object args) 
    Find a localized string in the resource bundle.
 public  void printErrLines(String key,
    Object args) 
    Print the text of a message to the errWriter stream, translating newlines appropriately for the platform.
 public static  void printLines(PrintWriter writer,
    String msg) 
    Print the text of a message, translating newlines appropriately for the platform.
 public  void printNoteLines(String key,
    Object args) 
    Print the text of a message to the noticeWriter stream, translating newlines appropriately for the platform.
 public  void printVerbose(String key,
    Object args) 
    Print the localized text of a "verbose" message to the noticeWriter stream.
 public  void prompt() 
    Prompt user after an error.
 public  void rawError(int pos,
    String msg) 
    report an error:
 public  void rawWarning(int pos,
    String msg) 
    report a warning:
 public  void report(JCDiagnostic diagnostic) 
    Common diagnostic handling. The diagnostic is counted, and depending on the options and how many diagnostics have been reported so far, the diagnostic may be handed off to writeDiagnostic.
 public  void reportDeferredDiagnostics() 
    Report all deferred diagnostics, and clear the deferDiagnostics flag.
 public  void reportDeferredDiagnostics(Set<Kind> kinds) 
    Report selected deferred diagnostics, and clear the deferDiagnostics flag.
 public  void setDiagnosticFormatter(DiagnosticFormatter<JCDiagnostic> diagFormatter) 
    Set the current diagnostic formatter.
 public  void setEndPosTable(JavaFileObject name,
    Map<JCTree, Integer> table) 
 protected boolean shouldReport(JavaFileObject file,
    int pos) 
    Returns true if an error needs to be reported for a given source name and pos.
 public  void strictWarning(DiagnosticPosition pos,
    String key,
    Object args) 
    Report a warning that cannot be suppressed.
 protected  void writeDiagnostic(JCDiagnostic diag) 
    Write out a diagnostic.