dev.mccue.tools.javadoc.Javadoc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tools-javadoc Show documentation
Show all versions of tools-javadoc Show documentation
API for working directly with the javadoc tool.
package dev.mccue.tools.javadoc;
import dev.mccue.tools.AbstractToolRunner;
import dev.mccue.tools.ExitStatusException;
import dev.mccue.tools.Tool;
import java.util.function.Consumer;
import java.util.spi.ToolProvider;
public final class Javadoc
extends AbstractToolRunner {
private Javadoc(Tool tool, JavadocArguments arguments) {
super(tool, arguments);
}
private Javadoc() {
super(
Tool.ofToolProvider(ToolProvider.findFirst("javadoc").orElseThrow()),
new JavadocArguments()
);
}
public static Javadoc runner() {
return new Javadoc();
}
public static Javadoc runner(Tool tool) {
return new Javadoc(tool, new JavadocArguments());
}
public static Javadoc runner(Tool tool, JavadocArguments arguments) {
return new Javadoc(tool, arguments);
}
public static Javadoc runner(JavadocArguments arguments) {
return new Javadoc(
Tool.ofToolProvider(ToolProvider.findFirst("javadoc").orElseThrow()),
arguments
);
}
public static Javadoc runner(Consumer super JavadocArguments> consumer) {
var javadoc = runner();
consumer.accept(javadoc.arguments);
return javadoc;
}
public static Javadoc runner(Tool tool, Consumer super JavadocArguments> consumer) {
var javadoc = runner(tool);
consumer.accept(javadoc.arguments);
return javadoc;
}
public static void run(Tool tool, JavadocArguments arguments) throws ExitStatusException {
new Javadoc(tool, arguments).run();
}
public static void run(JavadocArguments arguments) throws ExitStatusException {
runner(arguments).run();
}
public static void run(Tool tool, Consumer super JavadocArguments> consumer) throws ExitStatusException {
runner(tool, consumer).run();
}
public static void run(Consumer super JavadocArguments> consumer) throws ExitStatusException {
runner(consumer).run();
}
}