aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/javac
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-09-03 02:22:07 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-09-03 02:22:07 +0200
commitb262ed905a299215d99664664930b5e013284d63 (patch)
tree3d156b9c125d8689bd3b7e63a9927e99f884f291 /src/lombok/javac
parentc07196d3d2f1e98c90bb05e9f37bcb00892626a2 (diff)
downloadlombok-b262ed905a299215d99664664930b5e013284d63.tar.gz
lombok-b262ed905a299215d99664664930b5e013284d63.tar.bz2
lombok-b262ed905a299215d99664664930b5e013284d63.zip
Added an AccessLevel.NONE to suppress generating getters and setters (useful in combination with @Data). Addresses issue #37.
Diffstat (limited to 'src/lombok/javac')
-rw-r--r--src/lombok/javac/handlers/HandleGetter.java2
-rw-r--r--src/lombok/javac/handlers/HandleSetter.java2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lombok/javac/handlers/HandleGetter.java b/src/lombok/javac/handlers/HandleGetter.java
index 7fddc0e9..47cd3095 100644
--- a/src/lombok/javac/handlers/HandleGetter.java
+++ b/src/lombok/javac/handlers/HandleGetter.java
@@ -79,6 +79,8 @@ public class HandleGetter implements JavacAnnotationHandler<Getter> {
@Override public boolean handle(AnnotationValues<Getter> annotation, JCAnnotation ast, Node annotationNode) {
Node fieldNode = annotationNode.up();
AccessLevel level = annotation.getInstance().value();
+ if ( level == AccessLevel.NONE ) return true;
+
return createGetterForField(level, fieldNode, annotationNode, annotationNode.get(), true);
}
diff --git a/src/lombok/javac/handlers/HandleSetter.java b/src/lombok/javac/handlers/HandleSetter.java
index 253b0325..44ad0dca 100644
--- a/src/lombok/javac/handlers/HandleSetter.java
+++ b/src/lombok/javac/handlers/HandleSetter.java
@@ -82,6 +82,8 @@ public class HandleSetter implements JavacAnnotationHandler<Setter> {
@Override public boolean handle(AnnotationValues<Setter> annotation, JCAnnotation ast, Node annotationNode) {
Node fieldNode = annotationNode.up();
AccessLevel level = annotation.getInstance().value();
+ if ( level == AccessLevel.NONE ) return true;
+
return createSetterForField(level, fieldNode, annotationNode, annotationNode.get(), true);
}