Lombok - v0.9.3

lombok.eclipse.handlers
Class HandleSetter

java.lang.Object
  extended by lombok.eclipse.handlers.HandleSetter
All Implemented Interfaces:
EclipseAnnotationHandler<Setter>

@ProviderFor(value=EclipseAnnotationHandler.class)
public class HandleSetter
extends java.lang.Object
implements EclipseAnnotationHandler<Setter>

Handles the lombok.Setter annotation for eclipse.


Constructor Summary
HandleSetter()
           
 
Method Summary
 void generateSetterForField(EclipseNode fieldNode, org.eclipse.jdt.internal.compiler.ast.ASTNode pos, AccessLevel level)
          Generates a setter on the stated field.
 boolean generateSetterForType(EclipseNode typeNode, EclipseNode pos, AccessLevel level, boolean checkForTypeLevelSetter)
           
 boolean handle(AnnotationValues<Setter> annotation, org.eclipse.jdt.internal.compiler.ast.Annotation ast, EclipseNode annotationNode)
          Called when an annotation is found that is likely to match the annotation you're interested in.
 
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 boolean generateSetterForType(EclipseNode typeNode,
                                     EclipseNode pos,
                                     AccessLevel level,
                                     boolean checkForTypeLevelSetter)

generateSetterForField

public void generateSetterForField(EclipseNode fieldNode,
                                   org.eclipse.jdt.internal.compiler.ast.ASTNode 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.


handle

public boolean handle(AnnotationValues<Setter> annotation,
                      org.eclipse.jdt.internal.compiler.ast.Annotation ast,
                      EclipseNode annotationNode)
Description copied from interface: EclipseAnnotationHandler
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 interface EclipseAnnotationHandler<Setter>
Parameters:
annotation - The actual annotation - use this object to retrieve the annotation parameters.
ast - The Eclipse 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.
Returns:
true if you don't want to be called again about this annotation during this compile session (you've handled it), or false to indicate you aren't done yet.

Lombok - v0.9.3

Copyright © 2009 Reinier Zwitserloot and Roel Spilker, licensed under the MIT licence.