Interface MessagerUtils
-
-
Method Summary
Static Methods Modifier and Type Method Description static void
printError(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints an error message using the providedMessager
.static void
printError(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints an error message using theProcessingEnvironment
'sMessager
.static void
printMandatoryWarning(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints a mandatory warning message using the providedMessager
.static void
printMandatoryWarning(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints a mandatory warning message using theProcessingEnvironment
'sMessager
.static void
printMessage(javax.annotation.processing.Messager messager, javax.tools.Diagnostic.Kind kind, java.lang.String pattern, java.lang.Object... args)
Prints a message of the specified kind using the providedMessager
.static void
printMessage(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.tools.Diagnostic.Kind kind, java.lang.String pattern, java.lang.Object... args)
Prints a message of the specified kind using theProcessingEnvironment
'sMessager
.static void
printNote(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints a note message using the providedMessager
.static void
printNote(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints a note message using theProcessingEnvironment
'sMessager
.static void
printWarning(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints a warning message using the providedMessager
.static void
printWarning(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints a warning message using theProcessingEnvironment
'sMessager
.
-
-
-
Method Detail
-
printNote
static void printNote(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints a note message using theProcessingEnvironment
'sMessager
.This method formats the message using the provided pattern and arguments, and delegates to the underlying
Messager
obtained from the processing environment.Example Usage
ProcessingEnvironment processingEnv = ...; // Obtain processing environment printNote(processingEnv, "Found {0} elements matching criteria", count);
- Parameters:
processingEnv
- the processing environment to obtain the messager frompattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printNote
static void printNote(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints a note message using the providedMessager
.This method formats the message using the provided pattern and arguments, and forwards it to the underlying
Messager
.Example Usage
Messager messager = processingEnv.getMessager(); printNote(messager, "Found {0} elements matching criteria", count);
- Parameters:
messager
- the messager to use for printing the messagepattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printWarning
static void printWarning(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints a warning message using theProcessingEnvironment
'sMessager
.This method formats the message using the provided pattern and arguments, and delegates to the underlying
Messager
obtained from the processing environment. The message will be logged at the warning level through both theMessager
and internal logging utilities.Example Usage
ProcessingEnvironment processingEnv = ...; // Obtain processing environment printWarning(processingEnv, "Found {0} deprecated elements", count);
- Parameters:
processingEnv
- the processing environment to obtain the messager frompattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printWarning
static void printWarning(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints a warning message using the providedMessager
.This method formats the message using the provided pattern and arguments, and forwards it to the underlying
Messager
as a warning level message. The message will also be logged through internal logging utilities at the warning level.Example Usage
Messager messager = processingEnv.getMessager(); printWarning(messager, "Found {0} deprecated elements", count);
- Parameters:
messager
- the messager to use for printing the messagepattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printMandatoryWarning
static void printMandatoryWarning(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints a mandatory warning message using theProcessingEnvironment
'sMessager
.This method formats the message using the provided pattern and arguments, and delegates to the underlying
Messager
obtained from the processing environment. The message will be logged at the warning level through both theMessager
and internal logging utilities.Example Usage
ProcessingEnvironment processingEnv = ...; // Obtain processing environment printMandatoryWarning(processingEnv, "Found {0} obsolete elements", count);
- Parameters:
processingEnv
- the processing environment to obtain the messager frompattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printMandatoryWarning
static void printMandatoryWarning(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints a mandatory warning message using the providedMessager
.This method formats the message using the provided pattern and arguments, and forwards it to the underlying
Messager
as a mandatory warning level message. The message will also be logged through internal logging utilities at the warning level.Example Usage
Messager messager = processingEnv.getMessager(); printMandatoryWarning(messager, "Found {0} obsolete elements", count);
- Parameters:
messager
- the messager to use for printing the messagepattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printError
static void printError(javax.annotation.processing.ProcessingEnvironment processingEnv, java.lang.String pattern, java.lang.Object... args)
Prints an error message using theProcessingEnvironment
'sMessager
.This method formats the message using the provided pattern and arguments, and delegates to the underlying
Messager
obtained from the processing environment. The message will be logged at the error level through both theMessager
and internal logging utilities.Example Usage
ProcessingEnvironment processingEnv = ...; // Obtain processing environment printError(processingEnv, "Failed to process {0} elements", count);
- Parameters:
processingEnv
- the processing environment to obtain the messager frompattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printError
static void printError(javax.annotation.processing.Messager messager, java.lang.String pattern, java.lang.Object... args)
Prints an error message using the providedMessager
.This method formats the message using the provided pattern and arguments, and forwards it to the underlying
Messager
as an error level message. The message will also be logged through internal logging utilities at the error level.Example Usage
Messager messager = processingEnv.getMessager(); printError(messager, "Failed to process {0} elements", count);
- Parameters:
messager
- the messager to use for printing the messagepattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printMessage
static void printMessage(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.tools.Diagnostic.Kind kind, java.lang.String pattern, java.lang.Object... args)
Prints a message of the specified kind using theProcessingEnvironment
'sMessager
.This method retrieves the
Messager
from the providedProcessingEnvironment
and delegates to theprintMessage(Messager, Kind, String, Object...)
method to handle message formatting and output.Example Usage
ProcessingEnvironment processingEnv = ...; // Obtain processing environment printMessage(processingEnv, Kind.WARNING, "Found {0} deprecated elements", count);
- Parameters:
processingEnv
- the processing environment to obtain the messager fromkind
- the kind of message to print (e.g., error, warning, note)pattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
printMessage
static void printMessage(javax.annotation.processing.Messager messager, javax.tools.Diagnostic.Kind kind, java.lang.String pattern, java.lang.Object... args)
Prints a message of the specified kind using the providedMessager
.This method formats the message using the provided pattern and arguments, sends it to the annotation processor's messager, and also logs it using internal logging utilities at the appropriate level.
Example Usage
Messager messager = processingEnv.getMessager(); printMessage(messager, Kind.ERROR, "Failed to process {0} elements", count);
- Parameters:
messager
- the messager to use for printing the messagekind
- the kind of message to print (e.g., error, warning, note)pattern
- the message pattern to format (supportsString.format(java.lang.String, java.lang.Object...)
syntax)args
- the arguments for the message pattern
-
-