protected void javadoc(String... args){
  int result;
  PrintStream old=System.out;
  try {
    println("Javadoc");
    if (quiet) {
      System.setOut(filter(System.out,new String[]{"Loading source files for package","Constructing Javadoc information...","Generating ","Standard Doclet","Building tree for all the packages and classes...","Building index for all the packages and classes...","Building index for all classes..."}));
    }
 else {
      System.setOut(filter(System.out,new String[]{"Loading source files for package ","Generating "}));
    }
    Class<?> clazz=Class.forName("com.sun.tools.javadoc.Main");
    Method execute=clazz.getMethod("execute",String[].class);
    result=(Integer)invoke(execute,null,new Object[]{args});
  }
 catch (  Exception e) {
    result=exec("javadoc",args(args));
  }
 finally {
    System.setOut(old);
  }
  if (result != 0) {
    throw new RuntimeException("An error occurred, result=" + result);
  }
}

protected void javadoc ( String ... args ) { int result ; PrintStream old = System . out ; try { println ( "Javadoc" ) ; if ( quiet ) { System . setOut ( filter ( System . out , new String [ ] { "Loading source files for package" , "Constructing Javadoc information..." , "Generating " , "Standard Doclet" , "Building tree for all the packages and classes..." , "Building index for all the packages and classes..." , "Building index for all classes..." } ) ) ; } else { System . setOut ( filter ( System . out , new String [ ] { "Loading source files for package " , "Generating " } ) ) ; } Class < ? > clazz = Class . forName ( "com.sun.tools.javadoc.Main" ) ; Method execute = clazz . getMethod ( "execute" , String [ ] . class ) ; result = ( Integer ) invoke ( execute , null , new Object [ ] { args } ) ; } catch ( Exception e ) { result = exec ( "javadoc" , args ( args ) ) ; } finally { System . setOut ( old ) ; } if ( result != 0 ) { throw new RuntimeException ( "An error occurred, result=" + result ) ; } }
run a javadoc task .
