public class Classpath extends Object
This is used by the Injector
to discover and register all classes in the
component model. Additionally Babelfish
uses this to load all relevant .properties files.
The method used, is to provide a name of a resource which is placed in every component root (jar file etc.) which then can be discovered using Class.getResources.
Once a file pattern is given, all files in the classpath are scanned, starting from the detected roots.
Modifier and Type | Field and Description |
---|---|
protected static Log |
LOG
Logger used to log problems when scanning the classpath
|
Constructor and Description |
---|
Classpath(ClassLoader loader,
String componentName,
List<String> customizations)
Creates a new Classpath, scanning for component roots with the given name
|
Modifier and Type | Method and Description |
---|---|
Stream<Matcher> |
find(Pattern pattern)
Scans the classpath for files which relative path match the given patter
|
List<URL> |
getComponentRoots()
Returns all detected component roots
|
ClassLoader |
getLoader()
Returns the class loader used to load the classpath
|
protected static final Log LOG
public Classpath(ClassLoader loader, String componentName, List<String> customizations)
loader
- the class loader used to load the componentscomponentName
- the file name to identify component rootscustomizations
- the list of active customizations to filter visible resourcespublic ClassLoader getLoader()
public List<URL> getComponentRoots()
Copyright © 2018. All rights reserved.