Java Doc for Log.java in  » 6.0-JDK-Modules-com.sun » tools » com » sun » tools » javac » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules com.sun » tools » com.sun.tools.javac.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tools.javac.util.Log

All known Subclasses:   com.sun.tools.javadoc.Messager,  com.sun.tools.apt.util.Bark,
Log
public class Log (Code)
A class for error logs. Reports errors and warnings, and keeps track of error numbers and positions.

This is NOT part of any API supported by Sun Microsystems. 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
final public  intMaxErrors
     The maximum number of errors/warnings that are reported.
final public  intMaxWarnings
    
protected  DiagnosticListener<? super JavaFileObject>diagListener
     Diagnostic listener, if provided through programmatic interface to javac (JSR 199).
public  booleandumpOnError
    
public  booleanemitWarnings
     Switch: emit warning messages.
final public  PrintWritererrWriter
    
final public static  Context.Key<Log>logKey
     The context key for the log.
public  booleanmultipleErrors
     Print multiple errors for same source locations.
public  intnerrors
     The number of errors encountered so far.
final public  PrintWriternoticeWriter
    
public  intnwarnings
     The number of warnings encountered so far.
final public static  Context.Key<PrintWriter>outKey
     The context key for the output PrintWriter.
public  booleanpromptOnError
     Switch: prompt user on each error.
protected  JCDiagnostic.DiagnosticSourcesource
     The file that's currently translated.
final public  PrintWriterwarnWriter
    

Constructor Summary
protected  Log(Context context, PrintWriter errWriter, PrintWriter warnWriter, PrintWriter noticeWriter)
     Construct a log with given I/O redirections.
protected  Log(Context context)
     Construct a log with default settings.
protected  Log(Context context, PrintWriter defaultWriter)
     Construct a log with all output redirected.

Method Summary
public  JavaFileObjectcurrentSource()
     Return current source name.
final static  PrintWriterdefaultWriter(Context context)
    
public  voiderror(String key, Object... args)
     Report an error, unless another error was already reported at same source position.
public  voiderror(DiagnosticPosition pos, String key, Object... args)
     Report an error, unless another error was already reported at same source position.
public  voiderror(int pos, String key, Object... args)
     Report an error, unless another error was already reported at same source position.
public  voidflush()
    
public static  Stringformat(String fmt, Object... args)
    
protected  char[]getBuf()
    
protected static  char[]getCharContent(JavaFileObject fileObject)
    
protected  intgetColumnNumber(int pos)
     Return the one-based column number associated with a given pos for the current source file.
protected  intgetLineNumber(int pos)
     Return the one-based line number associated with a given pos for the current source file.
public static  StringgetLocalizedString(String key, Object... args)
     Find a localized string in the resource bundle.
protected  PrintWritergetWriterForDiagnosticType(DiagnosticType dt)
    
public  booleanhasDiagnosticListener()
    
public static  Loginstance(Context context)
     Get the Log instance for this context.
public  voidmandatoryNote(JavaFileObject file, String key, Object... args)
     Provide a non-fatal notification, unless suppressed by the -nowarn option.
public  voidmandatoryWarning(DiagnosticPosition pos, String key, Object... args)
     Report a warning.
public  voidnote(String key, Object... args)
     Provide a non-fatal notification, unless suppressed by the -nowarn option.
public  voidnote(DiagnosticPosition pos, String key, Object... args)
     Provide a non-fatal notification, unless suppressed by the -nowarn option.
public  voidnote(int pos, String key, Object... args)
     Provide a non-fatal notification, unless suppressed by the -nowarn option.
public static  voidprintLines(PrintWriter writer, String msg)
     Print the text of a message, translating newlines appropriately for the platform.
public  voidprompt()
     Prompt user after an error.
public  voidrawError(int pos, String msg)
    
public  voidrawWarning(int pos, String msg)
    
public  voidreport(JCDiagnostic diagnostic)
     Common diagnostic handling.
protected  voidsetBuf(char[] newBuf)
     Re-assign source buffer for existing source name.
public  voidsetEndPosTable(JavaFileObject name, Map<JCTree, Integer> table)
    
protected  booleanshouldReport(JavaFileObject file, int pos)
     Returns true if an error needs to be reported for a given source name and pos.
public  voidstrictWarning(DiagnosticPosition pos, String key, Object... args)
     Report a warning that cannot be suppressed.
public  JavaFileObjectuseSource(JavaFileObject name)
     Re-assign source, returning previous setting.
public  voidwarning(String key, Object... args)
     Report a warning, unless suppressed by the -nowarn option or the maximum number of warnings has been reached.
public  voidwarning(DiagnosticPosition pos, String key, Object... args)
     Report a warning, unless suppressed by the -nowarn option or the maximum number of warnings has been reached.
public  voidwarning(int pos, String key, Object... args)
     Report a warning, unless suppressed by the -nowarn option or the maximum number of warnings has been reached.
protected  voidwriteDiagnostic(JCDiagnostic diag)
     Write out a diagnostic.

Field Detail
MaxErrors
final public int MaxErrors(Code)
The maximum number of errors/warnings that are reported.



MaxWarnings
final public int MaxWarnings(Code)



diagListener
protected DiagnosticListener<? super JavaFileObject> diagListener(Code)
Diagnostic listener, if provided through programmatic interface to javac (JSR 199).



dumpOnError
public boolean dumpOnError(Code)
Print stack trace on errors?



emitWarnings
public boolean emitWarnings(Code)
Switch: emit warning messages.



errWriter
final public PrintWriter errWriter(Code)



logKey
final public static Context.Key<Log> logKey(Code)
The context key for the log.



multipleErrors
public boolean multipleErrors(Code)
Print multiple errors for same source locations.



nerrors
public int nerrors(Code)
The number of errors encountered so far.



noticeWriter
final public PrintWriter noticeWriter(Code)



nwarnings
public int nwarnings(Code)
The number of warnings encountered so far.



outKey
final public static Context.Key<PrintWriter> outKey(Code)
The context key for the output PrintWriter.



promptOnError
public boolean promptOnError(Code)
Switch: prompt user on each error.



source
protected JCDiagnostic.DiagnosticSource source(Code)
The file that's currently translated.



warnWriter
final public PrintWriter warnWriter(Code)




Constructor Detail
Log
protected Log(Context context, PrintWriter errWriter, PrintWriter warnWriter, PrintWriter noticeWriter)(Code)
Construct a log with given I/O redirections.



Log
protected Log(Context context)(Code)
Construct a log with default settings.



Log
protected Log(Context context, PrintWriter defaultWriter)(Code)
Construct a log with all output redirected.




Method Detail
currentSource
public JavaFileObject currentSource()(Code)
Return current source name.



defaultWriter
final static PrintWriter defaultWriter(Context context)(Code)
The default writer for diagnostics



error
public void error(String key, Object... args)(Code)
Report an error, unless another error was already reported at same source position.
Parameters:
  key - The key for the localized error message.
Parameters:
  args - Fields of the error message.



error
public void error(DiagnosticPosition pos, String key, Object... args)(Code)
Report an error, unless another error was already reported at same source position.
Parameters:
  pos - The source position at which to report the error.
Parameters:
  key - The key for the localized error message.
Parameters:
  args - Fields of the error message.



error
public void error(int pos, String key, Object... args)(Code)
Report an error, unless another error was already reported at same source position.
Parameters:
  pos - The source position at which to report the error.
Parameters:
  key - The key for the localized error message.
Parameters:
  args - Fields of the error message.



flush
public void flush()(Code)
Flush the logs



format
public static String format(String fmt, Object... args)(Code)



getBuf
protected char[] getBuf()(Code)



getCharContent
protected static char[] getCharContent(JavaFileObject fileObject) throws IOException(Code)



getColumnNumber
protected int getColumnNumber(int pos)(Code)
Return the one-based column number associated with a given pos for the current source file. Zero is returned if no column exists for the given position.



getLineNumber
protected int getLineNumber(int pos)(Code)
Return the one-based line number associated with a given pos for the current source file. Zero is returned if no line exists for the given position.



getLocalizedString
public static String getLocalizedString(String key, Object... args)(Code)
Find a localized string in the resource bundle.
Parameters:
  key - The key for the localized string.
Parameters:
  args - Fields to substitute into the string.



getWriterForDiagnosticType
protected PrintWriter getWriterForDiagnosticType(DiagnosticType dt)(Code)



hasDiagnosticListener
public boolean hasDiagnosticListener()(Code)



instance
public static Log instance(Context context)(Code)
Get the Log instance for this context.



mandatoryNote
public void mandatoryNote(JavaFileObject file, String key, Object... args)(Code)
Provide a non-fatal notification, unless suppressed by the -nowarn option.
Parameters:
  key - The key for the localized notification message.
Parameters:
  args - Fields of the notification message.



mandatoryWarning
public void mandatoryWarning(DiagnosticPosition pos, String key, Object... args)(Code)
Report a warning.
Parameters:
  pos - The source position at which to report the warning.
Parameters:
  key - The key for the localized warning message.
Parameters:
  args - Fields of the warning message.



note
public void note(String key, Object... args)(Code)
Provide a non-fatal notification, unless suppressed by the -nowarn option.
Parameters:
  key - The key for the localized notification message.
Parameters:
  args - Fields of the notification message.



note
public void note(DiagnosticPosition pos, String key, Object... args)(Code)
Provide a non-fatal notification, unless suppressed by the -nowarn option.
Parameters:
  key - The key for the localized notification message.
Parameters:
  args - Fields of the notification message.



note
public void note(int pos, String key, Object... args)(Code)
Provide a non-fatal notification, unless suppressed by the -nowarn option.
Parameters:
  key - The key for the localized notification message.
Parameters:
  args - Fields of the notification message.



printLines
public static void printLines(PrintWriter writer, String msg)(Code)
Print the text of a message, translating newlines appropriately for the platform.



prompt
public void prompt()(Code)
Prompt user after an error.



rawError
public void rawError(int pos, String msg)(Code)
report an error:



rawWarning
public void rawWarning(int pos, String msg)(Code)
report a warning:



report
public void report(JCDiagnostic diagnostic)(Code)
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.



setBuf
protected void setBuf(char[] newBuf)(Code)
Re-assign source buffer for existing source name.



setEndPosTable
public void setEndPosTable(JavaFileObject name, Map<JCTree, Integer> table)(Code)



shouldReport
protected boolean shouldReport(JavaFileObject file, int pos)(Code)
Returns true if an error needs to be reported for a given source name and pos.



strictWarning
public void strictWarning(DiagnosticPosition pos, String key, Object... args)(Code)
Report a warning that cannot be suppressed.
Parameters:
  pos - The source position at which to report the warning.
Parameters:
  key - The key for the localized warning message.
Parameters:
  args - Fields of the warning message.



useSource
public JavaFileObject useSource(JavaFileObject name)(Code)
Re-assign source, returning previous setting.



warning
public void warning(String key, Object... args)(Code)
Report a warning, unless suppressed by the -nowarn option or the maximum number of warnings has been reached.
Parameters:
  pos - The source position at which to report the warning.
Parameters:
  key - The key for the localized warning message.
Parameters:
  args - Fields of the warning message.



warning
public void warning(DiagnosticPosition pos, String key, Object... args)(Code)
Report a warning, unless suppressed by the -nowarn option or the maximum number of warnings has been reached.
Parameters:
  pos - The source position at which to report the warning.
Parameters:
  key - The key for the localized warning message.
Parameters:
  args - Fields of the warning message.



warning
public void warning(int pos, String key, Object... args)(Code)
Report a warning, unless suppressed by the -nowarn option or the maximum number of warnings has been reached.
Parameters:
  pos - The source position at which to report the warning.
Parameters:
  key - The key for the localized warning message.
Parameters:
  args - Fields of the warning message.



writeDiagnostic
protected void writeDiagnostic(JCDiagnostic diag)(Code)
Write out a diagnostic.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.