package xyz.wbsite.dbtool.javafx.manger;

import xyz.wbsite.dbtool.javafx.JavaFxApplication;

public class ManagerFactory {
    private static XmlManager xmlManager = null;
    private static JsonManager jsonManager = null;
    private static ReflashManager reflashManager = null;
    private static ProjectManager projectManager = null;
    private static FreeMarkerManager freeMarkerManager;

    static {
        xmlManager = new XmlManager();
        jsonManager = new JsonManager();
        projectManager = new ProjectManager();
        freeMarkerManager = new FreeMarkerManager();
    }

    public static ProjectManager getProjectManager() {
        return projectManager;
    }

    public static FreeMarkerManager getFreeMarkerManager() {
        return freeMarkerManager;
    }

    public static XmlManager getXmlManager() {
        return xmlManager;
    }

    public static JsonManager getJsonManager() {
        return jsonManager;
    }

    public static ReflashManager getReflashManager(JavaFxApplication main) {
        if (reflashManager == null) {
            reflashManager = new ReflashManager(main);
        }
        return reflashManager;
    }
}
