com.sun.tools.javac.processing
Class JavacMessager

java.lang.Object
  extended by com.sun.tools.javac.processing.JavacMessager
All Implemented Interfaces:
Messager

public class JavacMessager
extends java.lang.Object
implements Messager

An implementation of the Messager built on top of log.

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
(package private)  int errorCount
           
(package private)  Log log
           
(package private)  JavacProcessingEnvironment processingEnv
           
 
Constructor Summary
JavacMessager(Context context, JavacProcessingEnvironment processingEnv)
           
 
Method Summary
 int errorCount()
           
 boolean errorRaised()
           
 void newRound(Context context)
           
 void printError(java.lang.String msg)
          Prints an error message.
 void printMessage(Diagnostic.Kind kind, java.lang.CharSequence msg)
          Prints a message of the specified kind.
 void printMessage(Diagnostic.Kind kind, java.lang.CharSequence msg, Element e)
          Prints a message of the specified kind at the location of the element.
 void printMessage(Diagnostic.Kind kind, java.lang.CharSequence msg, Element e, AnnotationMirror a)
          Prints a message of the specified kind at the location of the annotation mirror of the annotated element.
 void printMessage(Diagnostic.Kind kind, java.lang.CharSequence msg, Element e, AnnotationMirror a, AnnotationValue v)
          Prints a message of the specified kind at the location of the annotation value inside the annotation mirror of the annotated element.
 void printNotice(java.lang.String msg)
          Prints a notice.
 void printWarning(java.lang.String msg)
          Prints a warning message.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

Log log

processingEnv

JavacProcessingEnvironment processingEnv

errorCount

int errorCount
Constructor Detail

JavacMessager

JavacMessager(Context context,
              JavacProcessingEnvironment processingEnv)
Method Detail

printMessage

public void printMessage(Diagnostic.Kind kind,
                         java.lang.CharSequence msg)
Description copied from interface: Messager
Prints a message of the specified kind.

Specified by:
printMessage in interface Messager
Parameters:
kind - the kind of message
msg - the message, or an empty string if none

printMessage

public void printMessage(Diagnostic.Kind kind,
                         java.lang.CharSequence msg,
                         Element e)
Description copied from interface: Messager
Prints a message of the specified kind at the location of the element.

Specified by:
printMessage in interface Messager
Parameters:
kind - the kind of message
msg - the message, or an empty string if none
e - the element to use as a position hint

printMessage

public void printMessage(Diagnostic.Kind kind,
                         java.lang.CharSequence msg,
                         Element e,
                         AnnotationMirror a)
Prints a message of the specified kind at the location of the annotation mirror of the annotated element.

Specified by:
printMessage in interface Messager
Parameters:
kind - the kind of message
msg - the message, or an empty string if none
e - the annotated element
a - the annotation to use as a position hint

printMessage

public void printMessage(Diagnostic.Kind kind,
                         java.lang.CharSequence msg,
                         Element e,
                         AnnotationMirror a,
                         AnnotationValue v)
Prints a message of the specified kind at the location of the annotation value inside the annotation mirror of the annotated element.

Specified by:
printMessage in interface Messager
Parameters:
kind - the kind of message
msg - the message, or an empty string if none
e - the annotated element
a - the annotation containing the annotaiton value
v - the annotation value to use as a position hint

printError

public void printError(java.lang.String msg)
Prints an error message. Equivalent to printError(null, msg).

Parameters:
msg - the message, or an empty string if none

printWarning

public void printWarning(java.lang.String msg)
Prints a warning message. Equivalent to printWarning(null, msg).

Parameters:
msg - the message, or an empty string if none

printNotice

public void printNotice(java.lang.String msg)
Prints a notice.

Parameters:
msg - the message, or an empty string if none

errorRaised

public boolean errorRaised()

errorCount

public int errorCount()

newRound

public void newRound(Context context)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object