本文整理汇总了Java中com.sun.javadoc.RootDoc.printError方法的典型用法代码示例。如果您正苦于以下问题:Java RootDoc.printError方法的具体用法?Java RootDoc.printError怎么用?Java RootDoc.printError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.javadoc.RootDoc
的用法示例。
在下文中一共展示了RootDoc.printError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import com.sun.javadoc.RootDoc; //导入方法依赖的package包/类
public static boolean start(RootDoc root) {
try {
Configuration cfg = createConfiguration();
Template t = cfg.getTemplate(template.getName());
File f = new File(output);
FileOutputStream fos = new FileOutputStream(f);
OutputStreamWriter w = new OutputStreamWriter(fos, Charset.forName("UTF-8"));
t.process(root, w);
} catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
root.printError(sw.toString());
return false;
}
return true;
}
示例2: start
import com.sun.javadoc.RootDoc; //导入方法依赖的package包/类
public static boolean start(RootDoc root) {
root.printNotice("Parsing Java code");
final Document document = new JavadocToDocumentConverter(root, title, properties).createDocument();
root.printNotice("Generating Markdown output to " + outputFile);
final String error = new DocumentToMarkdownWriter(createOutputWriter()).writeDocument(document);
final boolean result = (error == null);
if (error != null) {
root.printError(error);
}
// Because we're mucking around with static fields, we must ensure we reset them too. Yuck.
title = null;
properties = null;
outputFile = null;
root.printNotice("Done!");
return result;
}
示例3: start
import com.sun.javadoc.RootDoc; //导入方法依赖的package包/类
public static boolean start(RootDoc root) {
// generate 10 errors or warnings
for (int i = 1 ; i <= 10 ; i++) {
if (genErrors)
root.printError(ERROR_MARKER + " " + i);
if (genWarnings)
root.printWarning(WARNING_MARKER + " " + i);
}
return true;
}
示例4: start
import com.sun.javadoc.RootDoc; //导入方法依赖的package包/类
/**
* The entry point for the doclet
*/
public static boolean start(RootDoc root) {
String[][] options = root.options();
File outputFile = null;
for (int i = 0; i < options.length; i++) {
String[] option = options[i];
if (option[0].equals("-output")) {
outputFile = new File(option[1]);
}
}
if (outputFile == null) {
root.printError("Internal Error: No output file");
return false;
} else {
root.printNotice("Generating " + outputFile);
}
try {
PrintWriter pw = new PrintWriter(new FileWriter(outputFile));
Formatter.center("GemFire Unit Test Summary", pw);
Formatter.center(new Date().toString(), pw);
pw.println("");
ClassDoc[] classes = root.classes();
Arrays.sort(classes, new Comparator() {
public int compare(Object o1, Object o2) {
ClassDoc c1 = (ClassDoc) o1;
ClassDoc c2 = (ClassDoc) o2;
return c1.qualifiedName().compareTo(c2.qualifiedName());
}
});
for (int i = 0; i < classes.length; i++) {
ClassDoc c = classes[i];
if (!c.isAbstract() && isUnitTest(c)) {
document(c, pw);
}
}
pw.flush();
pw.close();
} catch (IOException ex) {
StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw, true));
root.printError(sw.toString());
return false;
}
return true;
}