@ProviderFor(value=JavacAnnotationHandler.class) public class HandleDelegate extends JavacAnnotationHandler<Delegate>
Modifier and Type | Class and Description |
---|---|
static class |
HandleDelegate.CantMakeDelegates |
static class |
HandleDelegate.DelegateReceiver |
static class |
HandleDelegate.MethodSig |
Constructor and Description |
---|
HandleDelegate() |
Modifier and Type | Method and Description |
---|---|
void |
addMethodBindings(List<HandleDelegate.MethodSig> signatures,
ClassType ct,
JavacTypes types,
Set<String> banList) |
void |
checkConflictOfTypeVarNames(HandleDelegate.MethodSig sig,
JavacNode annotation)
There's a rare but problematic case if a delegate method has its own type variables, and the delegated type does too, and the method uses both.
|
JCMethodDecl |
createDelegateMethod(HandleDelegate.MethodSig sig,
JavacNode annotation,
Name delegateName,
HandleDelegate.DelegateReceiver delegateReceiver) |
void |
generateAndAdd(HandleDelegate.MethodSig sig,
JavacNode annotation,
Name delegateName,
HandleDelegate.DelegateReceiver delegateReceiver) |
void |
handle(AnnotationValues<Delegate> annotation,
JCAnnotation ast,
JavacNode annotationNode)
Called when an annotation is found that is likely to match the annotation you're interested in.
|
static String |
printSig(ExecutableType method,
Name name,
JavacTypes types) |
static <T> <any> |
toList(<any> collection) |
static String |
typeBindingToSignature(TypeMirror binding,
JavacTypes types) |
getAnnotationHandledByThisHandler
public void handle(AnnotationValues<Delegate> annotation, JCAnnotation ast, JavacNode annotationNode)
JavacAnnotationHandler
handle
in class JavacAnnotationHandler<Delegate>
annotation
- The actual annotation - use this object to retrieve the annotation parameters.ast
- The javac AST node representing the annotation.annotationNode
- The Lombok AST wrapper around the 'ast' parameter. You can use this object
to travel back up the chain (something javac AST can't do) to the parent of the annotation, as well
as access useful methods such as generating warnings or errors focused on the annotation.public void generateAndAdd(HandleDelegate.MethodSig sig, JavacNode annotation, Name delegateName, HandleDelegate.DelegateReceiver delegateReceiver)
public void checkConflictOfTypeVarNames(HandleDelegate.MethodSig sig, JavacNode annotation) throws HandleDelegate.CantMakeDelegates
<E>
, and the method has <T>
, but in our class we have a <T>
at the class level, then we have two different
type variables both named T
. We detect this situation and error out asking the programmer to rename their type variable.HandleDelegate.CantMakeDelegates
- If there's a conflict. Conflict list is in ex.conflicted.public JCMethodDecl createDelegateMethod(HandleDelegate.MethodSig sig, JavacNode annotation, Name delegateName, HandleDelegate.DelegateReceiver delegateReceiver) throws JavacResolution.TypeNotConvertibleException, HandleDelegate.CantMakeDelegates
public static <T> <any> toList(<any> collection)
public void addMethodBindings(List<HandleDelegate.MethodSig> signatures, ClassType ct, JavacTypes types, Set<String> banList) throws lombok.javac.handlers.HandleDelegate.DelegateRecursion
lombok.javac.handlers.HandleDelegate.DelegateRecursion
public static String printSig(ExecutableType method, Name name, JavacTypes types)
public static String typeBindingToSignature(TypeMirror binding, JavacTypes types)
Copyright © 2009-2015 The Project Lombok Authors, licensed under the MIT licence.