Class ClasspathOrder


  • public class ClasspathOrder
    extends Object
    A class to find the unique ordered classpath elements.
    • Method Detail

      • addClasspathElements

        public boolean addClasspathElements​(String pathStr,
                                            ClassLoader[] classLoaders,
                                            LogNode log)
        Add classpath elements, separated by the system path separator character. May be called by a ClassLoaderHandler to add a path string that it knows about.
        Parameters:
        pathStr - the delimited string of URLs or paths of the classpath.
        classLoaders - the ClassLoader(s) that this classpath was obtained from.
        log - the LogNode instance to use if logging in verbose mode.
        Returns:
        true (and add the classpath element) if pathElement is not null or empty, otherwise return false.
      • addClasspathElement

        public boolean addClasspathElement​(String pathElement,
                                           ClassLoader classLoader,
                                           LogNode log)
        Add a classpath element relative to a base file. May be called by a ClassLoaderHandler to add classpath elements that it knows about.
        Parameters:
        pathElement - the URL or path of the classpath element.
        classLoader - the ClassLoader that this classpath element was obtained from.
        log - the LogNode instance to use if logging in verbose mode.
        Returns:
        true (and add the classpath element) if pathElement is not null or empty, otherwise return false.
      • addClasspathElementObject

        public boolean addClasspathElementObject​(Object pathObject,
                                                 ClassLoader classLoader,
                                                 LogNode log)
        Add classpath elements from an object obtained from reflection. The object may be a String (containing a single path, or several paths separated with File.pathSeparator), a List or other Iterable, or an array object. In the case of Iterables and arrays, the elements may be any type whose toString() method returns a path or URL string (including the URL and Path types).
        Parameters:
        pathObject - the object containing a classpath string or strings.
        classLoader - the ClassLoader that this classpath was obtained from.
        log - the LogNode instance to use if logging in verbose mode.
        Returns:
        true (and add the classpath element) if pathEl)ement is not null or empty, otherwise return false.
      • addClasspathElements

        public boolean addClasspathElements​(String pathStr,
                                            ClassLoader classLoader,
                                            LogNode log)
        Add classpath elements, separated by the system path separator character. May be called by a ClassLoaderHandler to add a path string that it knows about.
        Parameters:
        pathStr - the delimited string of URLs or paths of the classpath.
        classLoader - the ClassLoader that this classpath was obtained from.
        log - the LogNode instance to use if logging in verbose mode.
        Returns:
        true (and add the classpath element) if pathEl)ement is not null or empty, otherwise return false.
      • addClasspathElements

        public boolean addClasspathElements​(ClasspathOrder subsequentOrder)
        Add all classpath elements in another ClasspathElementOrder after the elements in this order.
        Parameters:
        subsequentOrder - the ordering to add after this one.
        Returns:
        true (and add the classpath element) if pathElement is not null or empty, otherwise return false.