本文整理汇总了Java中com.sun.tools.javadoc.Main类的典型用法代码示例。如果您正苦于以下问题:Java Main类的具体用法?Java Main怎么用?Java Main使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Main类属于com.sun.tools.javadoc包,在下文中一共展示了Main类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doRunTest
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
void doRunTest(int expectedResult, Predicate<String> validate, String... args) {
System.err.println("running with args: " + Arrays.asList(args));
List<String> options = new ArrayList<>();
options.addAll(Arrays.asList(args));
options.add("-XDrawDiagnostics");
options.add(new File(System.getProperty("test.src", "."), "ReleaseOptionSource.java").getPath());
StringWriter out = new StringWriter();
PrintWriter pw = new PrintWriter(out);
int actualResult = Main.execute("javadoc", pw, pw, pw, "com.sun.tools.doclets.standard.Standard", options.toArray(new String[0]));
System.err.println("actual result=" + actualResult);
System.err.println("actual output=" + out.toString());
if (actualResult != expectedResult)
throw new Error("Exit code not as expected");
if (!validate.test(out.toString())) {
throw new Error("Output not as expected");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:ReleaseOption.java
示例2: doRunTest
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
void doRunTest(int expectedResult, Predicate<String> validate, String... args) {
System.err.println("running with args: " + Arrays.asList(args));
List<String> options = new ArrayList<>();
options.addAll(Arrays.asList(args));
options.add("-XDrawDiagnostics");
options.add(System.getProperty("test.src", ".") + java.io.File.separatorChar + "ReleaseOptionSource.java");
StringWriter out = new StringWriter();
PrintWriter pw = new PrintWriter(out);
int actualResult = Main.execute("javadoc", pw, pw, pw, "com.sun.tools.doclets.formats.html.HtmlDoclet", options.toArray(new String[0]));
System.err.println("actual result=" + actualResult);
System.err.println("actual output=" + out.toString());
if (actualResult != expectedResult)
throw new Error();
if (!validate.test(out.toString())) {
throw new Error("Not an expected error output: " + out.toString());
}
}
开发者ID:campolake,项目名称:openjdk9,代码行数:18,代码来源:ReleaseOption.java
示例3: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
File outputFile = new File(args[0]);
WRITER = new BufferedWriter(new FileWriter(outputFile), 10000);
WRITER.write("digraph G {\n");
Main.execute("JavadocIndexer", "com.solrstart.javadoc.dependencies.Analyzer", new String[]{
"-sourcepath",
"/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/common/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/icu/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/kuromoji/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/morfologik/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/phonetic/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/smartcn/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/stempel/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/analysis/uima/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/codecs/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/core/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/expressions/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/grouping/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/highlighter/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/join/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/memory/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/misc/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/queries/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/queryparser/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/spatial/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/suggest/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/analysis-extras/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/clustering/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/dataimporthandler-extras/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/dataimporthandler/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/extraction/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/langid/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/map-reduce/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/morphlines-cell/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/morphlines-core/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/uima/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/contrib/velocity/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/core/src/java:/Volumes/RAMDisk/source-solr-4.7.0/solr/solrj/src/java",
// "/Volumes/RAMDisk/source-solr-4.7.0/solr/core/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/core/src/java",
// "/Volumes/RAMDisk/source-solr-4.7.0/solr/core/src/java",
"-subpackages",
"org.apache"
// org.tartarus.snowball:org.apache.lucene:org.apache.solr:org.egothor.stemmer
});
WRITER.write("}\n");
WRITER.close();
//Then run graphviz:
// dot -Tsvg -O -Grankdir=LR dependencies.dot
}
开发者ID:arafalov,项目名称:Solr-Javadoc,代码行数:22,代码来源:Analyzer.java
示例4: generateJavadoc
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
/**
* Generate Javadoc and return associated Doclet ID.
* This method is synchronized.
*
* @param programName Name of the program (for error messages).
* @param errWriter PrintWriter to receive error messages.
* @param warnWriter PrintWriter to receive warning messages.
* @param noticeWriter PrintWriter to receive notice messages.
* @param args The command line parameters.
* @return an unique doclet ID which represent the subsequent Main#execute() run.
* @throws IllegalStateException if the generated doclet ID is already used. Try again.
* @throws IllegalArgumentException if Javadoc fails to generate docs.
*/
public static synchronized long generateJavadoc(String programName,
PrintWriter errWriter,
PrintWriter warnWriter,
PrintWriter noticeWriter,
String[] args)
{
if (_docInfo.containsKey(_id))
{
throw new IllegalStateException("Doclet information with ID " + _id + " already exists");
}
final int javadocRetCode = Main.execute(programName, errWriter, warnWriter, noticeWriter, Rest4JDoclet.class.getName(), args);
if (javadocRetCode != 0)
{
throw new IllegalArgumentException("Javadoc failed with return code " + javadocRetCode);
}
final long currentId = _id;
++_id;
return currentId;
}
开发者ID:ppdai,项目名称:rest4j,代码行数:35,代码来源:Rest4JDoclet.java
示例5: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
String[] templateParts = template.split("#");
int sources = templateParts.length / 2;
for (int source = 0; source < sources; source++) {
StringBuilder testSource = new StringBuilder();
for (int i = 0; i < templateParts.length; i += 2) {
testSource.append(templateParts[i]);
if (i == 2 * source) {
testSource.append(templateParts[i + 1]);
}
}
test = 0;
testsDone = false;
while (!testsDone) {
ToolBox tb = new ToolBox();
new JavacTask(tb)
.sources(testSource.toString(),
"public class CompletionErrorMissing {}",
"public interface CompletionErrorIntfMissing {}",
"public class CompletionErrorExcMissing extends Exception {}")
.outdir(".")
.run()
.writeAll();
tb.deleteFiles("CompletionErrorMissing.class", "CompletionErrorIntfMissing.class", "CompletionErrorExcMissing.class");
// run javadoc:
if (Main.execute("javadoc", "CompletionError", CompletionError.class.getClassLoader(),
"-classpath", "." + File.pathSeparator + testClassPath,
new File(testSrc, "CompletionError.java").getPath()) != 0)
throw new Error();
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:CompletionError.java
示例6: doTest
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
static void doTest() {
ByteArrayOutputStream redirectedOutput = new ByteArrayOutputStream();
PrintStream originalOutput = System.out;
// redirect System.out to a buffer
System.setOut(new PrintStream(redirectedOutput));
PrintWriter sink = new PrintWriter(new ByteArrayOutputStream());
// execute javadoc
int result = Main.execute("javadoc", sink, sink, sink,
"com.sun.tools.doclets.standard.Standard",
new String[] {"p"}
);
// test whether javadoc did any output to System.out
if (redirectedOutput.toByteArray().length > 0) {
originalOutput.println("Test failed; here's what javadoc wrote on its standard output:");
originalOutput.println(redirectedOutput.toString());
throw new Error("javadoc output wasn\'t properly redirected");
} else if (result != 0) {
throw new Error("javadoc run failed");
} else {
originalOutput.println("OK, good");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:OutputRedirect.java
示例7: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
String[] templateParts = template.split("#");
int sources = templateParts.length / 2;
for (int source = 0; source < sources; source++) {
StringBuilder testSource = new StringBuilder();
for (int i = 0; i < templateParts.length; i += 2) {
testSource.append(templateParts[i]);
if (i == 2 * source) {
testSource.append(templateParts[i + 1]);
}
}
test = 0;
testsDone = false;
while (!testsDone) {
ToolBox tb = new ToolBox();
new JavacTask(tb)
.sources(testSource.toString(),
"public class CompletionErrorMissing {}",
"public interface CompletionErrorIntfMissing {}",
"public class CompletionErrorExcMissing extends Exception {}")
.outdir(".")
.run()
.writeAll();
tb.deleteFiles("CompletionErrorMissing.class", "CompletionErrorIntfMissing.class", "CompletionErrorExcMissing.class");
// run javadoc:
if (Main.execute("javadoc", "CompletionError", CompletionError.class.getClassLoader(),
"-classpath", ".",
System.getProperty("test.src", ".") + File.separatorChar + "CompletionError.java") != 0)
throw new Error();
}
}
}
开发者ID:campolake,项目名称:openjdk9,代码行数:33,代码来源:CompletionError.java
示例8: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
String[] templateParts = template.split("#");
int sources = templateParts.length / 2;
for (int source = 0; source < sources; source++) {
StringBuilder testSource = new StringBuilder();
for (int i = 0; i < templateParts.length; i += 2) {
testSource.append(templateParts[i]);
if (i == 2 * source) {
testSource.append(templateParts[i + 1]);
}
}
test = 0;
testsDone = false;
while (!testsDone) {
List<JavaSource> fileObjects =
Arrays.asList(new JavaSource("CompletionErrorAuxiliary", testSource.toString()),
new JavaSource("CompletionErrorMissing", "public class CompletionErrorMissing {}"),
new JavaSource("CompletionErrorIntfMissing", "public interface CompletionErrorIntfMissing {}"),
new JavaSource("CompletionErrorExcMissing", "public class CompletionErrorExcMissing extends Exception {}"));
Boolean result = compiler.getTask(null, null, null, Arrays.asList("-d", "."), null, fileObjects).call();
if (!result)
throw new Error();
for (String delete : new String[] {"CompletionErrorMissing.class", "CompletionErrorIntfMissing.class", "CompletionErrorExcMissing.class"}) {
Files.delete(Paths.get(delete));
}
// run javadoc:
if (Main.execute("javadoc", "CompletionError", CompletionError.class.getClassLoader(),
"-classpath", ".",
System.getProperty("test.src", ".") + File.separatorChar + "CompletionError.java") != 0)
throw new Error();
}
}
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:35,代码来源:CompletionError.java
示例9: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
/***
* This is a doclet driver that triggers Javadoc repeatedly with passed-in parameters
* @param args - comes in groups of three: module sourcepath subpackages.
* sourcepath and subpackages both accept the list separated by colons (':')
*/
public static void main(String[] args) throws IOException, SolrServerException {
SOLR_SERVER = new HttpSolrServer( "http://localhost:8983/solr/JavadocCollection");
if (args.length % 3 != 1){
System.err.println("We are expecting parameters start from solr version label and then in groups of 3: module sourcepath subpackages");
}
API_VERSION = args[0]; //should be 4.8 or 4.7.1 or similar
SOLR_SERVER.deleteByQuery("apiVersion:" + API_VERSION); //we trust this parameter not to be a hack...
SOLR_SERVER.commit();
for(int offset = 1; offset<args.length; offset+=3){
MODULE = args[offset]; //set for global access
String sourcepath = args[offset+1];
String subpackages = args[offset+2];
Main.execute("JavadocIndexer", "com.solrstart.javadoc.indexer.Index", new String[]{
"-sourcepath", sourcepath,
"-subpackages", subpackages
});
}
// Main.execute("JavadocIndexer", "com.solrstart.javadoc.indexer.Index", new String[]{
// "-sourcepath",
// "/Volumes/RAMDisk/source-solr-4.7.0/solr/core/src/java:/Volumes/RAMDisk/source-solr-4.7.0/lucene/core/src/java",
// "-subpackages",
// "org.apache.solr"
// });
SOLR_SERVER.shutdown(); //just easier that tryin
}
开发者ID:arafalov,项目名称:Solr-Javadoc,代码行数:40,代码来源:Index.java
示例10: runJavaDoclet
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
private List<StepImplementationsDescriptor> runJavaDoclet(final String classToDocument) {
final List<StepImplementationsDescriptor> classStepTagList = new ArrayList<StepImplementationsDescriptor>();
project.getBasedir();
String sourceRoot = null;
// what's the path to this class ?
String path = resolveClassToPath(classToDocument, project.getBuild().getSourceDirectory());
if (path != null) {
// file is in the source path
sourceRoot = project.getBuild().getSourceDirectory();
} else {
path = resolveClassToPath(classToDocument, project.getBuild().getTestSourceDirectory());
if (path != null) {
// file is in the test tree
sourceRoot = project.getBuild().getTestSourceDirectory();
}
}
if (sourceRoot == null || path == null) {
log.error("unabled to locate source file");
// TODO exception ?
} else {
CustomDoclet.setExpressionList(classStepTagList);
final String[] args = {"-doclet", "com.technophobia.substeps.glossary.CustomDoclet",
"-sourcepath", sourceRoot,
path
};
// the custom doclet generates quite a lot of noise around things missing from the classpath etc -
// not important in this context, so consume and discard apart from the errors..
StringWriter esw = new StringWriter();
PrintWriter err = new PrintWriter(esw);
StringWriter wsw = new StringWriter();
PrintWriter warn = new PrintWriter(wsw);
StringWriter nsw = new StringWriter();
PrintWriter notice = new PrintWriter(nsw);
String warnings = esw.toString();
if (!warnings.isEmpty()) {
getLog().warn("Substeps CustomDoclet warnings:\n" + warnings);
}
Main.execute("SubstepsDoclet", err, warn, notice, "com.technophobia.substeps.glossary.CustomDoclet", args);
}
return classStepTagList;
}
开发者ID:Substeps,项目名称:substeps-framework,代码行数:56,代码来源:SubstepsGlossaryMojo.java
示例11: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) throws FileNotFoundException {
String name = FilterDoclet.class.getName();
Main.execute(name, args);
}
开发者ID:google,项目名称:conscrypt,代码行数:5,代码来源:FilterDoclet.java
示例12: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) {
String name = JavadocFilter.class.getName();
Main.execute(name, name, args);
}
开发者ID:SUPENTA,项目名称:flitchio-sdk,代码行数:5,代码来源:JavadocFilter.java
示例13: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args)
{
String name = ExcludeDoclet.class.getName();
Main.execute(name, name, args);
}
开发者ID:sojamo,项目名称:controlp5,代码行数:6,代码来源:ExcludeDoclet.java
示例14: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main (String[] args) {
String name = PublicApiDoclet.class.getName();
Main.execute(name, name, args);
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:5,代码来源:PublicApiDoclet.java
示例15: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) {
Main.main(new String[] { "-d", "target", "-doclet", DocumentationDoclet.class.getName(), "-sourcepath", "../minium-elements/src/main/java;../minium-webelements/src/main/java;../minium-actions/src/main/java",
// "minium.web", "minium", "minium.actions"
"minium.web.actions"
});
}
开发者ID:viltgroup,项目名称:minium,代码行数:7,代码来源:DocumentationDoclet.java
示例16: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
public static void main(String[] args) {
Main.execute(new String[]{"-doclet", "org.kuali.rice.krad.demo.uif.library.tools.KRADLibraryPropertiesDoclet",
"-sourcepath", "C:/Java/Projects/Rice/Trunk/krad/krad-web-framework/src/main/java", "-subpackages",
"org.kuali.rice.krad.uif:org.kuali.rice.krad.datadictionary.validation.constraint"});
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:6,代码来源:KRADLibraryPropertiesDoclet.java
示例17: main
import com.sun.tools.javadoc.Main; //导入依赖的package包/类
/**
* Just a main method for debugging.
*
* @param args The command line arguments.
*
* @throws Exception If anything goes wrong.
*/
public static void main(String[] args) throws Exception {
args = Arrays.copyOf(args, args.length + 2);
args[args.length - 2] = "-doclet";
args[args.length - 1] = MarkdownDoclet.class.getName();
Main.main(args);
}
开发者ID:Abnaxos,项目名称:markdown-doclet,代码行数:14,代码来源:MarkdownDoclet.java
注:本文中的com.sun.tools.javadoc.Main类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论