
jdplus.toolkit.desktop.plugin.ui.processing.IProcDocumentItemFactoryLoader Maven / Gradle / Ivy
package jdplus.toolkit.desktop.plugin.ui.processing;
import java.lang.Iterable;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import jdplus.toolkit.desktop.plugin.util.NetBeansServiceBackend;
/**
* Custom service loader for {@link jdplus.toolkit.desktop.plugin.ui.processing.IProcDocumentItemFactory}.
*
This class is thread-safe.
* Properties:
*
* - Quantifier: MULTIPLE
* - Fallback: null
* - Preprocessing: wrapper: none filters:[] sorters:[getPosition]
* - Mutability: NONE
* - Singleton: true
* - Name: null
* - Backend: jdplus.toolkit.desktop.plugin.util.NetBeansServiceBackend
* - Cleaner: null
* - Batch: false
* - Batch name: null
*
*/
public final class IProcDocumentItemFactoryLoader {
private static final Iterable SOURCE = NetBeansServiceBackend.INSTANCE.apply(IProcDocumentItemFactory.class);
private static final List RESOURCE = doLoad();
private IProcDocumentItemFactoryLoader() {
}
private static List doLoad() {
return StreamSupport.stream(SOURCE.spliterator(), false)
.sorted(Comparator.comparingInt(IProcDocumentItemFactory::getPosition))
.collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
}
/**
* Gets a list of {@link jdplus.toolkit.desktop.plugin.ui.processing.IProcDocumentItemFactory} instances.
*
This method is thread-safe.
* @return the current non-null value
*/
public static List get() {
return RESOURCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy