aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lombok/AccessLevel.java4
-rw-r--r--src/lombok/eclipse/handlers/HandleGetter.java2
-rw-r--r--src/lombok/eclipse/handlers/HandleSetter.java2
-rw-r--r--src/lombok/javac/handlers/HandleGetter.java2
-rw-r--r--src/lombok/javac/handlers/HandleSetter.java2
5 files changed, 11 insertions, 1 deletions
diff --git a/src/lombok/AccessLevel.java b/src/lombok/AccessLevel.java
index 973b3c18..16edd108 100644
--- a/src/lombok/AccessLevel.java
+++ b/src/lombok/AccessLevel.java
@@ -25,5 +25,7 @@ package lombok;
* Represents an AccessLevel. Used e.g. to specify the access level for generated methods and fields.
*/
public enum AccessLevel {
- PUBLIC, MODULE, PROTECTED, PACKAGE, PRIVATE;
+ PUBLIC, MODULE, PROTECTED, PACKAGE, PRIVATE,
+ /** Represents not generating anything or the complete lack of a method. */
+ NONE;
}
diff --git a/src/lombok/eclipse/handlers/HandleGetter.java b/src/lombok/eclipse/handlers/HandleGetter.java
index 2ba3876a..e83b2cc5 100644
--- a/src/lombok/eclipse/handlers/HandleGetter.java
+++ b/src/lombok/eclipse/handlers/HandleGetter.java
@@ -77,6 +77,8 @@ public class HandleGetter implements EclipseAnnotationHandler<Getter> {
public boolean handle(AnnotationValues<Getter> annotation, Annotation 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/eclipse/handlers/HandleSetter.java b/src/lombok/eclipse/handlers/HandleSetter.java
index 8c47a43b..636226bd 100644
--- a/src/lombok/eclipse/handlers/HandleSetter.java
+++ b/src/lombok/eclipse/handlers/HandleSetter.java
@@ -85,6 +85,8 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> {
Node fieldNode = annotationNode.up();
if ( fieldNode.getKind() != Kind.FIELD ) return false;
AccessLevel level = annotation.getInstance().value();
+ if ( level == AccessLevel.NONE ) return true;
+
return createSetterForField(level, fieldNode, annotationNode, annotationNode.get(), true);
}
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);
}