Class ServiceLoaderUtils


  • public class ServiceLoaderUtils
    extends java.lang.Object
    Service Loading and Ordering related utils
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T newInstance​(java.lang.String className)
      Loads a class and instantiates it
      static <T> T newInstance​(java.lang.String className, java.lang.ClassLoader loader)
      Loads a class and instantiates it
      static <T> void sortLoadedClasses​(java.util.List<T> loaded)
      Sorts a list of loaded classes, so that non-Tika ones come before Tika ones, and otherwise in reverse alphabetical order
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServiceLoaderUtils

        public ServiceLoaderUtils()
    • Method Detail

      • sortLoadedClasses

        public static <T> void sortLoadedClasses​(java.util.List<T> loaded)
        Sorts a list of loaded classes, so that non-Tika ones come before Tika ones, and otherwise in reverse alphabetical order
      • newInstance

        public static <T> T newInstance​(java.lang.String className)
        Loads a class and instantiates it
        Type Parameters:
        T - service type
        Parameters:
        className - service class name
        Returns:
        instance of service
      • newInstance

        public static <T> T newInstance​(java.lang.String className,
                                        java.lang.ClassLoader loader)
        Loads a class and instantiates it
        Type Parameters:
        T - service type
        Parameters:
        className - service class name
        loader - class loader
        Returns:
        instance of service