All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.vizjs.VizJsEngine Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// 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);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy