180 |
* Option "-source:" should be 1.4 to handle assertions, 1.1 is no more |
* Option "-source:" should be 1.4 to handle assertions, 1.1 is no more |
181 |
* supported. |
* supported. |
182 |
*/ |
*/ |
183 |
private String option_source; |
private String option_source = "1.2"; |
184 |
|
|
185 |
// TODO: add the rest of the options as instance variables |
// TODO: add the rest of the options as instance variables |
186 |
|
|
485 |
|
|
486 |
if (reporter.getWarningCount() > 0) |
if (reporter.getWarningCount() > 0) |
487 |
{ |
{ |
488 |
System.err.println(reporter.getWarningCount() + " warnings"); |
reporter.printNotice(reporter.getWarningCount() + " warnings"); |
489 |
} |
} |
490 |
|
|
491 |
if (reporter.getErrorCount() > 0) |
if (reporter.getErrorCount() > 0) |
492 |
{ |
{ |
493 |
System.err.println(reporter.getErrorCount() + " errors"); |
reporter.printNotice(reporter.getErrorCount() + " errors"); |
494 |
} |
} |
495 |
|
|
496 |
System.gc(); |
System.gc(); |
715 |
|
|
716 |
rootDoc.setSourcePath(option_sourcepath); |
rootDoc.setSourcePath(option_sourcepath); |
717 |
|
|
718 |
|
addJavaLangClasses(); |
719 |
|
|
720 |
startDoclet(customOptions); |
startDoclet(customOptions); |
721 |
} |
} |
722 |
} |
} |
723 |
|
|
724 |
|
private void addJavaLangClasses() |
725 |
|
throws IOException |
726 |
|
{ |
727 |
|
String resourceName = "/java.lang-classes-" + option_source + ".txt"; |
728 |
|
InputStream in = getClass().getResourceAsStream(resourceName); |
729 |
|
BufferedReader reader = new BufferedReader(new InputStreamReader(in)); |
730 |
|
String line; |
731 |
|
while ((line = reader.readLine()) != null) { |
732 |
|
|
733 |
|
String className = line.trim(); |
734 |
|
if (className.length() > 0) { |
735 |
|
ClassDocImpl classDoc = |
736 |
|
new ClassDocImpl(null, new PackageDocImpl("java.lang"), |
737 |
|
ProgramElementDocImpl.ACCESS_PUBLIC, |
738 |
|
false, false); |
739 |
|
classDoc.setClass(className); |
740 |
|
rootDoc.addClassDoc(classDoc); |
741 |
|
} |
742 |
|
} |
743 |
|
} |
744 |
|
|
745 |
/** |
/** |
746 |
* Helper class for parsing command line arguments. An instance of this class |
* Helper class for parsing command line arguments. An instance of this class |
747 |
* represents a particular option accepted by gjdoc (e.g. '-sourcepath') along |
* represents a particular option accepted by gjdoc (e.g. '-sourcepath') along |
874 |
void process(String[] args) |
void process(String[] args) |
875 |
{ |
{ |
876 |
option_source = args[0]; |
option_source = args[0]; |
877 |
|
if (!"1.2".equals(option_source) |
878 |
|
&& !"1.3".equals(option_source) |
879 |
|
&& !"1.4".equals(option_source)) { |
880 |
|
|
881 |
|
throw new RuntimeException("Only he following values are currently" |
882 |
|
+ " supported for option -source: 1.2, 1.3, 1.4."); |
883 |
|
} |
884 |
} |
} |
885 |
}); |
}); |
886 |
options.put("-sourcepath", new OptionProcessor(2) |
options.put("-sourcepath", new OptionProcessor(2) |
912 |
option_verbose = true; |
option_verbose = true; |
913 |
} |
} |
914 |
}); |
}); |
915 |
|
options.put("-quiet", new OptionProcessor(1) |
916 |
|
{ |
917 |
|
|
918 |
|
void process(String[] args) |
919 |
|
{ |
920 |
|
reporter.setQuiet(true); |
921 |
|
} |
922 |
|
}); |
923 |
options.put("-locale", new OptionProcessor(2) |
options.put("-locale", new OptionProcessor(2) |
924 |
{ |
{ |
925 |
|
|
1002 |
/* + " -bootclasspath <path> Where the classes are found\n" */ |
/* + " -bootclasspath <path> Where the classes are found\n" */ |
1003 |
/* + " -extdirs <dirlist> Where the extensions classes are\n" */ |
/* + " -extdirs <dirlist> Where the extensions classes are\n" */ |
1004 |
+ " -verbose Output messages about what Gjdoc is doing\n" |
+ " -verbose Output messages about what Gjdoc is doing\n" |
1005 |
/* + " -quiet Do not print non-error and non-warning messages\n" */ |
+ " -quiet Do not print non-error and non-warning messages\n" |
1006 |
/* + " -locale <name> Locale to be used, e.g. en_US or en_US_WIN\n" */ |
/* + " -locale <name> Locale to be used, e.g. en_US or en_US_WIN\n" */ |
1007 |
/* + " -encoding <name> Source file encoding name\n" */ |
/* + " -encoding <name> Source file encoding name\n" */ |
1008 |
/* + " -J<flag> Passes the flag to the virtual machine\n" */ |
/* + " -J<flag> Passes the flag to the virtual machine\n" */ |
1151 |
*/ |
*/ |
1152 |
public static void releaseRootDoc() |
public static void releaseRootDoc() |
1153 |
{ |
{ |
1154 |
rootDoc = null; |
rootDoc.flush(); |
1155 |
} |
} |
1156 |
|
|
1157 |
} |
} |