接口 ClassLoaderService

    • 方法详细资料

      • classForName

        <T> Class<T> classForName​(String className)
        Locate a class by name.
        类型参数:
        T - The returned class type.
        参数:
        className - The name of the class to locate
        返回:
        The class reference
        抛出:
        ClassLoadingException - Indicates the class could not be found
      • locateResource

        URL locateResource​(String name)
        Locate a resource by name (classpath lookup).
        参数:
        name - The resource name.
        返回:
        The located URL; may return null to indicate the resource was not found
      • locateResourceStream

        InputStream locateResourceStream​(String name)
        Locate a resource by name (classpath lookup) and gets its stream.
        参数:
        name - The resource name.
        返回:
        The stream of the located resource; may return null to indicate the resource was not found
      • locateResources

        List<URL> locateResources​(String name)
        Locate a series of resource by name (classpath lookup).
        参数:
        name - The resource name.
        返回:
        The list of URL matching; may return null to indicate the resource was not found
      • loadJavaServices

        <S> Collection<S> loadJavaServices​(Class<S> serviceContract)
        Discovers and instantiates implementations of the named service contract.

        NOTE : the terms service here is used differently than Service. Instead here we are talking about services as defined by ServiceLoader.

        类型参数:
        S - The type of the service contract
        参数:
        serviceContract - The java type defining the service contract
        返回:
        The ordered set of discovered services.