public class HandlerLibrary extends Object
Constructor and Description |
---|
HandlerLibrary(Messager messager)
Creates a new HandlerLibrary that will report any problems or errors to the provided messager.
|
Modifier and Type | Method and Description |
---|---|
void |
callASTVisitors(JavacAST ast,
long priority)
Will call all registered
JavacASTVisitor instances. |
SortedSet<Long> |
getPriorities() |
SortedSet<Long> |
getPrioritiesRequiringResolutionReset() |
void |
handleAnnotation(JCCompilationUnit unit,
JavacNode node,
JCAnnotation annotation,
long priority)
Handles the provided annotation node by first finding a qualifying instance of
JavacAnnotationHandler and if one exists, calling it with a freshly cooked up
instance of AnnotationValues . |
void |
javacError(String message)
Generates an error in the Messager that was used to initialize this HandlerLibrary.
|
void |
javacError(String message,
Throwable t)
Generates an error in the Messager that was used to initialize this HandlerLibrary.
|
void |
javacWarning(String message)
Generates a warning in the Messager that was used to initialize this HandlerLibrary.
|
void |
javacWarning(String message,
Throwable t)
Generates a warning in the Messager that was used to initialize this HandlerLibrary.
|
static HandlerLibrary |
load(Messager messager)
Creates a new HandlerLibrary that will report any problems or errors to the provided messager,
then uses SPI discovery to load all annotation and visitor based handlers so that future calls
to the handle methods will defer to these handlers.
|
public HandlerLibrary(Messager messager)
load(Messager)
instead.public SortedSet<Long> getPrioritiesRequiringResolutionReset()
public static HandlerLibrary load(Messager messager)
public void javacWarning(String message)
public void javacWarning(String message, Throwable t)
public void javacError(String message)
public void javacError(String message, Throwable t)
public void handleAnnotation(JCCompilationUnit unit, JavacNode node, JCAnnotation annotation, long priority)
JavacAnnotationHandler
and if one exists, calling it with a freshly cooked up
instance of AnnotationValues
.
Note that depending on the printASTOnly flag, the PrintAST
annotation
will either be silently skipped, or everything that isn't PrintAST
will be skipped.
The HandlerLibrary will attempt to guess if the given annotation node represents a lombok annotation.
For example, if lombok.*
is in the import list, then this method will guess that
Getter
refers to lombok.Getter
, presuming that HandleGetter
has been loaded.unit
- The Compilation Unit that contains the Annotation AST Node.node
- The Lombok AST Node representing the Annotation AST Node.annotation
- 'node.get()' - convenience parameter.public void callASTVisitors(JavacAST ast, long priority)
JavacASTVisitor
instances.Copyright © 2009-2015 The Project Lombok Authors, licensed under the MIT licence.