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

public Class JavacMessager

extends Object
implements Messager
Class Inheritance
All Implemented Interfaces
javax.annotation.processing.Messager
Imports
com.sun.tools.javac.model.JavacElements, com.sun.tools.javac.resources.CompilerProperties.Errors, .CompilerProperties.Notes, .CompilerProperties.Warnings, com.sun.tools.javac.util.*, .DefinedBy.Api, .JCDiagnostic.DiagnosticFlag, com.sun.tools.javac.tree.JCTree, com.sun.tools.javac.tree.JCTree.*, java.util.Set, javax.lang.model.element.*, javax.tools.JavaFileObject, .Diagnostic, javax.annotation.processing.*

An implementation of the Messager built on top of log.

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

Modifier and TypeField and Description
pack-priv int
pack-priv Log
pack-priv JavacProcessingEnvironment
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
public boolean
public void
public void
printError(String
the message, or an empty string if none
msg
)

Prints an error message.

public void
printMessage(Diagnostic.Kind kind, CharSequence msg)

Implements javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind.

public void
printMessage(Diagnostic.Kind kind, CharSequence msg, Element e)

Implements javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind at the location of the element.

public void
printMessage(Diagnostic.Kind
the kind of message
kind
,
CharSequence
the message, or an empty string if none
msg
,
Element
the annotated element
e
,
AnnotationMirror
the annotation to use as a position hint
a
)

Implements javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind at the location of the annotation mirror of the annotated element.

public void
printMessage(Diagnostic.Kind
the kind of message
kind
,
CharSequence
the message, or an empty string if none
msg
,
Element
the annotated element
e
,
AnnotationMirror
the annotation containing the annotation value
a
,
AnnotationValue
the annotation value to use as a position hint
v
)

Implements javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind at the location of the annotation value inside the annotation mirror of the annotated element.

public void
printNotice(String
the message, or an empty string if none
msg
)

Prints a notice.

public void
printWarning(String
the message, or an empty string if none
msg
)

Prints a warning message.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

errorCountback to summary
pack-priv int errorCount
logback to summary
pack-priv Log log
processingEnvback to summary
pack-priv JavacProcessingEnvironment processingEnv
warningCountback to summary
pack-priv int warningCount

Constructor Detail

JavacMessagerback to summary
pack-priv JavacMessager(Context context, JavacProcessingEnvironment processingEnv)

Method Detail

errorCountback to summary
public int errorCount()
errorRaisedback to summary
public boolean errorRaised()
newRoundback to summary
public void newRound()
printErrorback to summary
public void printError(String msg)

Prints an error message. Equivalent to printError(null, msg).

Parameters
msg:String

the message, or an empty string if none

printMessageback to summary
public void printMessage(Diagnostic.Kind kind, CharSequence msg)

Implements javax.annotation.processing.Messager.printMessage.

Doc from javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind.

Annotations
@DefinedBy:ANNOTATION_PROCESSING
printMessageback to summary
public void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e)

Implements javax.annotation.processing.Messager.printMessage.

Doc from javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind at the location of the element.

Annotations
@DefinedBy:ANNOTATION_PROCESSING
printMessageback to summary
public void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a)

Implements javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind at the location of the annotation mirror of the annotated element.

Parameters
kind:Diagnostic.Kind

the kind of message

msg:CharSequence

the message, or an empty string if none

e:Element

the annotated element

a:AnnotationMirror

the annotation to use as a position hint

Annotations
@DefinedBy:ANNOTATION_PROCESSING
printMessageback to summary
public void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a, AnnotationValue v)

Implements javax.annotation.processing.Messager.printMessage.

Prints a message of the specified kind at the location of the annotation value inside the annotation mirror of the annotated element.

Parameters
kind:Diagnostic.Kind

the kind of message

msg:CharSequence

the message, or an empty string if none

e:Element

the annotated element

a:AnnotationMirror

the annotation containing the annotation value

v:AnnotationValue

the annotation value to use as a position hint

Annotations
@DefinedBy:ANNOTATION_PROCESSING
printNoticeback to summary
public void printNotice(String msg)

Prints a notice.

Parameters
msg:String

the message, or an empty string if none

printWarningback to summary
public void printWarning(String msg)

Prints a warning message. Equivalent to printWarning(null, msg).

Parameters
msg:String

the message, or an empty string if none

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

warningCountback to summary
public int warningCount()