net.sourceforge.plantuml.vizjs.VizJsEngine Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.vizjs;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class VizJsEngine {
public static boolean isOk() {
try {
final Class classVizJS = Class.forName("ch.braincell.viz.VizJS");
return true;
} catch (Exception e) {
return false;
}
}
private final Object viz;
private final Method mExecute;
public VizJsEngine() throws ClassNotFoundException, NoSuchMethodException, SecurityException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
final Class classVizJS = Class.forName("ch.braincell.viz.VizJS");
final Method mCreate = classVizJS.getMethod("create");
mExecute = classVizJS.getMethod("execute", String.class);
this.viz = mCreate.invoke(null);
}
public String execute(String dot)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
return (String) mExecute.invoke(viz, dot);
}
}