org.revenj.extensibility.PluginLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of revenj-core Show documentation
Show all versions of revenj-core Show documentation
DSL Platform compatible backend (https://dsl-platform.com)
The newest version!
package org.revenj.extensibility;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Type;
import java.util.List;
public interface PluginLoader {
List> find(Class manifest, Type... types) throws Exception;
@SuppressWarnings("unchecked")
default T[] resolve(Container container, Class manifest) throws Exception {
try (Container scope = container.createScope()) {
List> manifests = find(manifest);
for (Class sc : manifests) {
scope.registerType(manifest, sc, InstanceScope.CONTEXT);
}
return (T[]) scope.resolve((GenericArrayType) () -> manifest);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy