Class AbstractServiceProvider

  • All Implemented Interfaces:
    Comparable<javax.measure.spi.ServiceProvider>
    Direct Known Subclasses:
    DefaultServiceProvider

    public abstract class AbstractServiceProvider
    extends javax.measure.spi.ServiceProvider
    implements Comparable<javax.measure.spi.ServiceProvider>
    This class extends the ServiceProvider class and hereby uses the JDK ServiceLoader to load the required services.
    Since:
    2.0
    Version:
    1.2
    Author:
    Werner Keil
    • Method Detail

      • getServices

        protected <T> List<T> getServices​(Class<T> serviceType)
        Loads and registers services.
        Type Parameters:
        T - the concrete type.
        Parameters:
        serviceType - The service type.
        Returns:
        the items found, never null.
      • compareTo

        public int compareTo​(javax.measure.spi.ServiceProvider o)
        Specified by:
        compareTo in interface Comparable<javax.measure.spi.ServiceProvider>
      • getSystemOfUnitsService

        public javax.measure.spi.SystemOfUnitsService getSystemOfUnitsService()
        Specified by:
        getSystemOfUnitsService in class javax.measure.spi.ServiceProvider
      • getUnitFormatService

        public javax.measure.spi.UnitFormatService getUnitFormatService()
        Specified by:
        getUnitFormatService in class javax.measure.spi.ServiceProvider
      • getFormatService

        public javax.measure.spi.FormatService getFormatService()
        Specified by:
        getFormatService in class javax.measure.spi.ServiceProvider
      • getQuantityFactory

        public final <Q extends javax.measure.Quantity<Q>> javax.measure.spi.QuantityFactory<Q> getQuantityFactory​(Class<Q> quantity)
        Return a factory for this quantity
        Specified by:
        getQuantityFactory in class javax.measure.spi.ServiceProvider
        Parameters:
        quantity - the quantity type
        Returns:
        the QuantityFactory
        Throws:
        NullPointerException - if quantity is null