Class CompoundClassResolver

    • Constructor Detail

      • CompoundClassResolver

        public CompoundClassResolver()
    • Method Detail

      • resolveClass

        public Class<?> resolveClass​(String className)
                              throws ClassNotFoundException
        Resolves a class by name (which may or may not involve loading it; thus the name class *resolver* not *loader*).

        This implementation iterates through all the IClassResolver trying to load the class until the class is found.

        Specified by:
        resolveClass in interface IClassResolver
        Parameters:
        className - The name of the class to resolve.
        Returns:
        The Class, if it is found.
        Throws:
        ClassNotFoundException - If the class was not found
      • getResources

        public Iterator<URL> getResources​(String name)
        Tries to load all the resources by the name that is given.

        This implementation iterates through all IClassResolvers added, and combines the results into one Set of URLs, and returns an Iterator for the set. URLs are unique in the set.

        Specified by:
        getResources in interface IClassResolver
        Parameters:
        name - The name of the resource to find.
        Returns:
        An Iterator of all the URLs matching the resource name.
      • getClassLoader

        public ClassLoader getClassLoader()
        Description copied from interface: IClassResolver
        Returns the ClassLoader to be used for resolving classes
        Specified by:
        getClassLoader in interface IClassResolver
        Returns:
        the class loader returned by the first registered IClassResolver. If there is no registered IClassResolver then the current thread's context class loader will be returned.