无法使用GroovyRootDocBuilder获取方法文档

时间:2018-11-23 12:08:51

标签: groovy groovydoc

我正在尝试使用GroovyRootDocBuilder获取类文档

 Properties properties = new Properties();
    properties.setProperty("publicScope", "true");
    properties.setProperty("protectedScope", "true");
    properties.setProperty("packageScope", "true");
    properties.setProperty("privateScope", "true");
    GroovyRootDocBuilder rootDocBuilder = new GroovyRootDocBuilder(null, null, null, properties);
    String filename = "D:\\git\\pdf-enricher\\src\\main\\groovy\\com\\pdfflow\\enricher\\operations\\PageOperations.groovy"
    String src = ResourceGroovyMethods.getText(new File(filename));
    String file = GroovyDocTool.getFile(filename);
    Map<String, GroovyClassDoc> ret = rootDocBuilder.getClassDocsFromSingleSource("com.pdfflow.enricher.operations", src, file);
    System.out.println(ret);

我仅获得类文档和构造函数文档,无法获取有关方法和字段文档的任何信息。

1 个答案:

答案 0 :(得分:0)

我的错误...我在getClassDocsFromSingleSource中以错误的顺序传递了src和文件