本文整理汇总了Java中com.sun.tools.javadoc.api.JavadocTaskImpl类的典型用法代码示例。如果您正苦于以下问题:Java JavadocTaskImpl类的具体用法?Java JavadocTaskImpl怎么用?Java JavadocTaskImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JavadocTaskImpl类属于com.sun.tools.javadoc.api包,在下文中一共展示了JavadocTaskImpl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDirectAccess1
import com.sun.tools.javadoc.api.JavadocTaskImpl; //导入依赖的package包/类
@Test
public void testDirectAccess1() throws Exception {
JavaFileObject srcFile = createSimpleJavaFileObject();
Iterable<? extends JavaFileObject> files = Arrays.asList(srcFile);
Context c = new Context();
Messager.preRegister(c, "javadoc");
StandardJavaFileManager fm = new JavacFileManager(c, true, null);
File outDir = getOutDir();
fm.setLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(outDir));
DocumentationTask t = new JavadocTaskImpl(c, null, null, files);
if (t.call()) {
System.err.println("task succeeded");
} else {
throw new Exception("task failed");
}
}
示例2: testDirectAccess2
import com.sun.tools.javadoc.api.JavadocTaskImpl; //导入依赖的package包/类
@Test
public void testDirectAccess2() throws Exception {
JavaFileObject srcFile = null; // error, provokes NPE
Iterable<? extends JavaFileObject> files = Arrays.asList(srcFile);
Context c = new Context();
Messager.preRegister(c, "javadoc");
StandardJavaFileManager fm = new JavacFileManager(c, true, null);
File outDir = getOutDir();
fm.setLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(outDir));
try {
DocumentationTask t = new JavadocTaskImpl(c, null, null, files);;
error("getTask succeeded, no exception thrown");
} catch (NullPointerException e) {
System.err.println("exception caught as expected: " + e);
}
}