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

flabbergast.BuiltInLibraries Maven / Gradle / Ivy

package flabbergast;

import flabbergast.TaskMaster.LibraryFailure;

public class BuiltInLibraries implements UriLoader {
    public static final BuiltInLibraries INSTANCE = new BuiltInLibraries();

    private BuiltInLibraries() {
    }

    @Override
    public String getUriName() {
        return "built-in libraries";
    }

    @Override
    @SuppressWarnings("unchecked")
    public Class resolveUri(String uri,
            Ptr failure) {
        if (!uri.startsWith("lib:")) {
            return null;
        }
        String type_name = "flabbergast.library."
                           + uri.substring(4).replace('/', '.');
        try {
            return (Class) Class.forName(type_name);
        } catch (ClassNotFoundException e) {
            failure.set(LibraryFailure.MISSING);
            return null;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy