public class ComponentFinder
extends java.lang.Object
Constructor | Description |
---|---|
ComponentFinder(com.structurizr.model.Container container,
java.lang.String packageName,
ComponentFinderStrategy... componentFinderStrategies) |
Create a new component finder.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addPackageName(java.lang.String packageName) |
Adds a package name to be scanned.
|
void |
clearExclusions() |
Clears the set of exclusions.
|
void |
exclude(java.lang.String... regexes) |
Adds one or more regexes to the set of regexes that define which types should be excluded during the component finding process.
|
java.util.Set<com.structurizr.model.Component> |
findComponents() |
Find components, using all of the configured component finder strategies
in the order they were added.
|
com.structurizr.model.Container |
getContainer() |
Gets the Container that components will be added to.
|
java.util.Set<java.util.regex.Pattern> |
getExclusions() |
Gets the set of regexes that define which types should be excluded during the component finding process.
|
java.util.List<java.lang.String> |
getPackageNames() |
Gets the names of the packages to be scanned.
|
TypeRepository |
getTypeRepository() |
Gets the type repository used to analyse java classes.
|
java.net.URLClassLoader |
getUrlClassLoader() |
Gets the classloader used to load classes.
|
void |
setTypeRepository(TypeRepository typeRepository) |
Sets the type repository used to analyse java classes.
|
void |
setUrlClassLoader(java.net.URLClassLoader urlClassLoader) |
Sets a classloader to load classes from instead of the system classloader.
|
public ComponentFinder(com.structurizr.model.Container container, java.lang.String packageName, ComponentFinderStrategy... componentFinderStrategies)
container
- the Container that components will be added topackageName
- the Java package name to be scanned (e.g. "com.mycompany.myapp")componentFinderStrategies
- one or more ComponentFinderStrategy objects, describing how to find componentspublic java.util.Set<com.structurizr.model.Component> findComponents() throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic com.structurizr.model.Container getContainer()
public void addPackageName(java.lang.String packageName)
packageName
- the package name as a Stringpublic java.util.List<java.lang.String> getPackageNames()
public java.util.Set<java.util.regex.Pattern> getExclusions()
public void exclude(java.lang.String... regexes)
regexes
- one or more regular expressions, as Stringspublic void clearExclusions()
public void setUrlClassLoader(java.net.URLClassLoader urlClassLoader)
urlClassLoader
- the classloader to usepublic java.net.URLClassLoader getUrlClassLoader()
public void setTypeRepository(TypeRepository typeRepository)
typeRepository
- the type repository to use when analysingpublic TypeRepository getTypeRepository()