You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JavadocRunner.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * Mik Kersten port to AspectJ 1.1+ code base
  13. * ******************************************************************/
  14. package org.aspectj.tools.ajdoc;
  15. import java.util.List;
  16. import java.util.Vector;
  17. import javax.tools.DocumentationTool;
  18. import javax.tools.DocumentationTool.DocumentationTask;
  19. import javax.tools.JavaFileObject;
  20. import javax.tools.StandardJavaFileManager;
  21. import javax.tools.ToolProvider;
  22. /**
  23. * @author Mik Kersten
  24. */
  25. class JavadocRunner {
  26. public static void callJavadocViaToolProvider(Vector<String> options, List<String> files) {
  27. DocumentationTool doctool = ToolProvider.getSystemDocumentationTool();
  28. StandardJavaFileManager fm = doctool.getStandardFileManager(null, null, null);
  29. Iterable<? extends JavaFileObject> jfos = fm.getJavaFileObjects(files.toArray(new String[0]));
  30. DocumentationTask task = doctool.getTask(null/*standard System.err*/, null/*standard file manager*/,
  31. null/*default diagnostic listener*/, null/*standard doclet*/, options, jfos);
  32. task.call();
  33. }
  34. }