@ProviderFor(value=JavacAnnotationHandler.class) public class HandleSetter extends JavacAnnotationHandler<Setter>
lombok.Setter
annotation for javac.Constructor and Description |
---|
HandleSetter() |
Modifier and Type | Method and Description |
---|---|
static JCMethodDecl |
createSetter(long access,
JavacNode field,
lombok.javac.JavacTreeMaker treeMaker,
JavacNode source,
<any> onMethod,
<any> onParam) |
static JCMethodDecl |
createSetter(long access,
JavacNode field,
lombok.javac.JavacTreeMaker treeMaker,
java.lang.String setterName,
boolean shouldReturnThis,
JavacNode source,
<any> onMethod,
<any> onParam) |
void |
createSetterForField(AccessLevel level,
JavacNode fieldNode,
JavacNode sourceNode,
boolean whineIfExists,
<any> onMethod,
<any> onParam) |
void |
createSetterForFields(AccessLevel level,
java.util.Collection<JavacNode> fieldNodes,
JavacNode errorNode,
boolean whineIfExists,
<any> onMethod,
<any> onParam) |
void |
generateSetterForField(JavacNode fieldNode,
JavacNode sourceNode,
AccessLevel level)
Generates a setter on the stated field.
|
void |
generateSetterForType(JavacNode typeNode,
JavacNode errorNode,
AccessLevel level,
boolean checkForTypeLevelSetter) |
void |
handle(AnnotationValues<Setter> annotation,
JCAnnotation ast,
JavacNode annotationNode)
Called when an annotation is found that is likely to match the annotation you're interested in.
|
getAnnotationHandledByThisHandler
public void generateSetterForType(JavacNode typeNode, JavacNode errorNode, AccessLevel level, boolean checkForTypeLevelSetter)
public void generateSetterForField(JavacNode fieldNode, JavacNode sourceNode, AccessLevel level)
HandleData
.
The difference between this call and the handle method is as follows:
If there is a lombok.Setter
annotation on the field, it is used and the
same rules apply (e.g. warning if the method already exists, stated access level applies).
If not, the setter is still generated if it isn't already there, though there will not
be a warning if its already there. The default access level is used.fieldNode
- The node representing the field you want a setter for.pos
- The node responsible for generating the setter (the @Data
or @Setter
annotation).public void handle(AnnotationValues<Setter> annotation, JCAnnotation ast, JavacNode annotationNode)
JavacAnnotationHandler
handle
in class JavacAnnotationHandler<Setter>
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 createSetterForFields(AccessLevel level, java.util.Collection<JavacNode> fieldNodes, JavacNode errorNode, boolean whineIfExists, <any> onMethod, <any> onParam)
public void createSetterForField(AccessLevel level, JavacNode fieldNode, JavacNode sourceNode, boolean whineIfExists, <any> onMethod, <any> onParam)
public static JCMethodDecl createSetter(long access, JavacNode field, lombok.javac.JavacTreeMaker treeMaker, JavacNode source, <any> onMethod, <any> onParam)
Copyright © 2009-2015 The Project Lombok Authors, licensed under the MIT licence.