
io.virtdata.docsys.core.DocsysPathLoader Maven / Gradle / Ivy
package io.virtdata.docsys.core;
import io.virtdata.docsys.api.*;
import java.util.ServiceLoader;
/**
* The standard way to load and use all of the {@link DocsPath}
* instances which are present in the runtime via SPI.
*
* This implementation ensures that names space collisions are known.
*/
public class DocsysPathLoader {
public static DocsInfo loadStaticPaths() {
ServiceLoader loader = ServiceLoader.load(DocsysStaticManifest.class);
Docs docs = new Docs();
for (DocsysStaticManifest docPathInfos : loader) {
docs.merge(docPathInfos.getDocs());
}
return docs;
}
public static DocsInfo loadDynamicPaths() {
ServiceLoader loader = ServiceLoader.load(DocsysDynamicManifest.class);
Docs docs = new Docs();
for (DocsysDynamicManifest docPathInfos : loader) {
docs.merge(docPathInfos.getDocs());
}
return docs;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy