当前位置: 首页>>代码示例>>Java>>正文


Java RootDoc.printError方法代码示例

本文整理汇总了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;
}
 
开发者ID:diogoko,项目名称:freemarker-doclet,代码行数:21,代码来源:FreeMarkerDoclet.java

示例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;
}
 
开发者ID:voostindie,项目名称:markdoclet,代码行数:17,代码来源:Markdoclet.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:Test.java

示例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;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:56,代码来源:UnitTestDoclet.java


注:本文中的com.sun.javadoc.RootDoc.printError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。