Package io.github.classgraph.utils
Class ClasspathOrder
- java.lang.Object
-
- io.github.classgraph.utils.ClasspathOrder
-
public class ClasspathOrder extends Object
A class to find the unique ordered classpath elements.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddClasspathElement(String pathElement, ClassLoader classLoader, LogNode log)Add a classpath element relative to a base file.booleanaddClasspathElementObject(Object pathObject, ClassLoader classLoader, LogNode log)Add classpath elements from an object obtained from reflection.booleanaddClasspathElements(ClasspathOrder subsequentOrder)Add all classpath elements in another ClasspathElementOrder after the elements in this order.booleanaddClasspathElements(String pathStr, ClassLoader[] classLoaders, LogNode log)Add classpath elements, separated by the system path separator character.booleanaddClasspathElements(String pathStr, ClassLoader classLoader, LogNode log)Add classpath elements, separated by the system path separator character.
-
-
-
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 whosetoString()method returns a path or URL string (including theURLandPathtypes).- 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.
-
-