32
33 import java.io.*;
34 import java.nio.*;
35 import java.util.*;
36 import java.util.regex.*;
37
38 /*
39 * If not explicitly specified the latest source and latest target
40 * values are the defaults. If explicitly specified, the target value
41 * has to be greater than or equal to the source value.
42 */
43 public class ClassVersionChecker {
44 private static enum Version {
45 SEVEN("7", 51),
46 EIGHT("8", 52),
47 NINE("9", 53),
48 TEN("10", 54),
49 ELEVEN("11", 55),
50 TWELVE("12", 56),
51 THIRTEEN("13", 57),
52 FOURTEEN("14", 58);
53
54 private Version(String release, int classFileVer) {
55 this.release = release;
56 this.classFileVer = classFileVer;
57 }
58 private final String release;
59 private final int classFileVer;
60
61 String release() {return release;}
62 int classFileVer() {return classFileVer;}
63 }
64
65 static final Version CURRENT;
66 static {
67 Version[] versions = Version.values();
68 int index = versions.length;
69 CURRENT = versions[index - 1];
70 }
71
72 int errors;
|
32
33 import java.io.*;
34 import java.nio.*;
35 import java.util.*;
36 import java.util.regex.*;
37
38 /*
39 * If not explicitly specified the latest source and latest target
40 * values are the defaults. If explicitly specified, the target value
41 * has to be greater than or equal to the source value.
42 */
43 public class ClassVersionChecker {
44 private static enum Version {
45 SEVEN("7", 51),
46 EIGHT("8", 52),
47 NINE("9", 53),
48 TEN("10", 54),
49 ELEVEN("11", 55),
50 TWELVE("12", 56),
51 THIRTEEN("13", 57),
52 FOURTEEN("14", 58),
53 FIFTEEN("15", 59);
54
55 private Version(String release, int classFileVer) {
56 this.release = release;
57 this.classFileVer = classFileVer;
58 }
59 private final String release;
60 private final int classFileVer;
61
62 String release() {return release;}
63 int classFileVer() {return classFileVer;}
64 }
65
66 static final Version CURRENT;
67 static {
68 Version[] versions = Version.values();
69 int index = versions.length;
70 CURRENT = versions[index - 1];
71 }
72
73 int errors;
|