Lombok - v0.10.8

lombok.javac.handlers
Class HandleSetter

java.lang.Object
  extended by lombok.javac.JavacAnnotationHandler<Setter>
      extended by lombok.javac.handlers.HandleSetter

@ProviderFor(value=JavacAnnotationHandler.class)
public class HandleSetter
extends JavacAnnotationHandler<Setter>

Handles the lombok.Setter annotation for javac.


Constructor Summary
HandleSetter()
           
 
Method Summary
 void generateSetterForField(JavacNode fieldNode, com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition pos, AccessLevel level)
          Generates a setter on the stated field.
 void generateSetterForType(JavacNode typeNode, JavacNode errorNode, AccessLevel level, boolean checkForTypeLevelSetter)
           
 void handle(AnnotationValues<Setter> annotation, com.sun.tools.javac.tree.JCTree.JCAnnotation ast, JavacNode annotationNode)
          Called when an annotation is found that is likely to match the annotation you're interested in.
 
Methods inherited from class lombok.javac.JavacAnnotationHandler
isResolutionBased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandleSetter

public HandleSetter()
Method Detail

generateSetterForType

public void generateSetterForType(JavacNode typeNode,
                                  JavacNode errorNode,
                                  AccessLevel level,
                                  boolean checkForTypeLevelSetter)

generateSetterForField

public void generateSetterForField(JavacNode fieldNode,
                                   com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition pos,
                                   AccessLevel level)
Generates a setter on the stated field. Used by 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.

Parameters:
fieldNode - The node representing the field you want a setter for.
pos - The node responsible for generating the setter (the @Data or @Setter annotation).

handle

public void handle(AnnotationValues<Setter> annotation,
                   com.sun.tools.javac.tree.JCTree.JCAnnotation ast,
                   JavacNode annotationNode)
Description copied from class: JavacAnnotationHandler
Called when an annotation is found that is likely to match the annotation you're interested in. Be aware that you'll be called for ANY annotation node in the source that looks like a match. There is, for example, no guarantee that the annotation node belongs to a method, even if you set your TargetType in the annotation to methods only.

Specified by:
handle in class JavacAnnotationHandler<Setter>
Parameters:
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.

Lombok - v0.10.8

Copyright © 2009-2011 The Project Lombok Authors, licensed under the MIT licence.