59
60 /** JDK 8. */
61 JDK1_8("8", 52, 0),
62
63 /** JDK 9. */
64 JDK1_9("9", 53, 0),
65
66 /** JDK 10. */
67 JDK1_10("10", 54, 0),
68
69 /** JDK 11. */
70 JDK1_11("11", 55, 0),
71
72 /** JDK 12. */
73 JDK1_12("12", 56, 0),
74
75 /** JDK 13. */
76 JDK1_13("13", 57, 0),
77
78 /** JDK 14. */
79 JDK1_14("14", 58, 0);
80
81 private static final Context.Key<Target> targetKey = new Context.Key<>();
82
83 public static Target instance(Context context) {
84 Target instance = context.get(targetKey);
85 if (instance == null) {
86 Options options = Options.instance(context);
87 String targetString = options.get(TARGET);
88 if (targetString != null) instance = lookup(targetString);
89 if (instance == null) instance = DEFAULT;
90 context.put(targetKey, instance);
91 }
92 return instance;
93 }
94
95 public static final Target MIN = Target.JDK1_7;
96
97 private static final Target MAX = values()[values().length - 1];
98
99 private static final Map<String,Target> tab = new HashMap<>();
|
59
60 /** JDK 8. */
61 JDK1_8("8", 52, 0),
62
63 /** JDK 9. */
64 JDK1_9("9", 53, 0),
65
66 /** JDK 10. */
67 JDK1_10("10", 54, 0),
68
69 /** JDK 11. */
70 JDK1_11("11", 55, 0),
71
72 /** JDK 12. */
73 JDK1_12("12", 56, 0),
74
75 /** JDK 13. */
76 JDK1_13("13", 57, 0),
77
78 /** JDK 14. */
79 JDK1_14("14", 58, 0),
80
81 /** JDK 15. */
82 JDK1_15("15", 59, 0);
83
84 private static final Context.Key<Target> targetKey = new Context.Key<>();
85
86 public static Target instance(Context context) {
87 Target instance = context.get(targetKey);
88 if (instance == null) {
89 Options options = Options.instance(context);
90 String targetString = options.get(TARGET);
91 if (targetString != null) instance = lookup(targetString);
92 if (instance == null) instance = DEFAULT;
93 context.put(targetKey, instance);
94 }
95 return instance;
96 }
97
98 public static final Target MIN = Target.JDK1_7;
99
100 private static final Target MAX = values()[values().length - 1];
101
102 private static final Map<String,Target> tab = new HashMap<>();
|