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

org.minifx.fxmlloading.util.FxmlControllers Maven / Gradle / Ivy

There is a newer version: 2.1.4
Show newest version
/**
 * Copyright (c) 2018 European Organisation for Nuclear Research (CERN), All Rights Reserved.
 */

package org.minifx.fxmlloading.util;

public final class FxmlControllers {

    private static final UniqueUsage UNIQUE_CONTROLLERS = new UniqueUsage();

    public static final  T useOnceOrThrow(T object) {
        return UNIQUE_CONTROLLERS.useOnceOrThrow(object, "The controller " + object
                + " would going to be used for another fxml-defined element. This is not allowed. "
                + "All controllers must be prototypes. "
                + "In case you are using spring, make sure that controllers which have to be looked up are declared as prototypes.");
    }

    public static final boolean isUsed(Object object) {
        return UNIQUE_CONTROLLERS.isUsed(object);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy