835 for (String s: xdoclintCustom.split("\\s+")) { 836 if (s.isEmpty()) 837 continue; 838 doclintOpts.add(DocLint.XMSGS_CUSTOM_PREFIX + s); 839 } 840 } 841 842 if (doclintOpts.equals(Collections.singleton(DocLint.XMSGS_CUSTOM_PREFIX + "none"))) 843 return List.nil(); 844 845 String checkPackages = options.get(Option.XDOCLINT_PACKAGE); 846 if (checkPackages != null) { 847 doclintOpts.add(DocLint.XCHECK_PACKAGE + checkPackages); 848 } 849 850 String format = options.get(Option.DOCLINT_FORMAT); 851 if (format != null) { 852 doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + format); 853 } 854 855 // standard doclet normally generates H1, H2, 856 // so for now, allow user comments to assume that 857 doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2"); 858 return List.from(doclintOpts.toArray(new String[doclintOpts.size()])); 859 } 860 861 private boolean checkDirectory(Option option) { 862 String value = options.get(option); 863 if (value == null) { 864 return true; 865 } 866 Path file = Paths.get(value); 867 if (Files.exists(file) && !Files.isDirectory(file)) { 868 reportDiag(Errors.FileNotDirectory(value)); 869 return false; 870 } 871 return true; 872 } 873 874 private interface ErrorReporter { 875 void report(Option o); 876 } 877 | 835 for (String s: xdoclintCustom.split("\\s+")) { 836 if (s.isEmpty()) 837 continue; 838 doclintOpts.add(DocLint.XMSGS_CUSTOM_PREFIX + s); 839 } 840 } 841 842 if (doclintOpts.equals(Collections.singleton(DocLint.XMSGS_CUSTOM_PREFIX + "none"))) 843 return List.nil(); 844 845 String checkPackages = options.get(Option.XDOCLINT_PACKAGE); 846 if (checkPackages != null) { 847 doclintOpts.add(DocLint.XCHECK_PACKAGE + checkPackages); 848 } 849 850 String format = options.get(Option.DOCLINT_FORMAT); 851 if (format != null) { 852 doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + format); 853 } 854 855 return List.from(doclintOpts.toArray(new String[doclintOpts.size()])); 856 } 857 858 private boolean checkDirectory(Option option) { 859 String value = options.get(option); 860 if (value == null) { 861 return true; 862 } 863 Path file = Paths.get(value); 864 if (Files.exists(file) && !Files.isDirectory(file)) { 865 reportDiag(Errors.FileNotDirectory(value)); 866 return false; 867 } 868 return true; 869 } 870 871 private interface ErrorReporter { 872 void report(Option o); 873 } 874 |