aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/LombokOptions.java
diff options
context:
space:
mode:
authorRobbert Jan Grootjans <grootjans@gmail.com>2013-03-08 16:54:02 +0100
committerRobbert Jan Grootjans <grootjans@gmail.com>2013-03-08 16:54:02 +0100
commit4be46113e81292a88cd5fdb3a5ce18fbcffd570d (patch)
treebf7d19e2121472d0d0370f3908fd6ac5f995e98b /src/core/lombok/javac/LombokOptions.java
parent12771880260d57209afcda15fd2b00f3181c38a6 (diff)
downloadlombok-4be46113e81292a88cd5fdb3a5ce18fbcffd570d.tar.gz
lombok-4be46113e81292a88cd5fdb3a5ce18fbcffd570d.tar.bz2
lombok-4be46113e81292a88cd5fdb3a5ce18fbcffd570d.zip
Compiler options can now be specified for JDK 8 or JDK 6/7 or lower.
After this was finalized I realize that we might consider moving entirely to String based options, instead of inferring the options from the provided enum. This setup does have the benefit of throwing exceptions when options are not present.
Diffstat (limited to 'src/core/lombok/javac/LombokOptions.java')
-rw-r--r--src/core/lombok/javac/LombokOptions.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/core/lombok/javac/LombokOptions.java b/src/core/lombok/javac/LombokOptions.java
index 1a73a8cc..66e42fe7 100644
--- a/src/core/lombok/javac/LombokOptions.java
+++ b/src/core/lombok/javac/LombokOptions.java
@@ -28,18 +28,10 @@ import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.Options;
-public class LombokOptions extends Options {
+public abstract class LombokOptions extends Options {
private boolean deleteLombokAnnotations = true;
private final Set<JCCompilationUnit> changed = new HashSet<JCCompilationUnit>();
- public static LombokOptions replaceWithDelombokOptions(Context context) {
- Options options = Options.instance(context);
- context.put(optionsKey, (Options)null);
- LombokOptions result = new LombokOptions(context);
- result.putAll(options);
- return result;
- }
-
public boolean isChanged(JCCompilationUnit ast) {
return changed.contains(ast);
}
@@ -54,7 +46,9 @@ public class LombokOptions extends Options {
return (options instanceof LombokOptions) && ((LombokOptions) options).deleteLombokAnnotations;
}
- private LombokOptions(Context context) {
+ protected LombokOptions(Context context) {
super(context);
}
+
+ public abstract void putJavacOption(String optionName, String value);
}