Class ClassResolverFromClasspath
java.lang.Object
com.tngtech.archunit.core.importer.resolvers.ClassResolverFromClasspath
- All Implemented Interfaces:
ClassResolver
A
ClassResolver that tries to locate missing dependencies on the classpath.
I.e. uses Class.getResource(String) to find the URI of the classfile for the missing
type, then uses the supplied ClassResolver.ClassUriImporter to import the type.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.importer.resolvers.ClassResolver
ClassResolver.ClassUriImporter, ClassResolver.Factory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetClassUriImporter(ClassResolver.ClassUriImporter classUriImporter) Always called BEFOREClassResolver.tryResolve(String).tryResolve(String typeName) ArchUnit will call this method, to resolve any missingJavaClasses, needed to build the class graph (i.e.
-
Constructor Details
-
ClassResolverFromClasspath
public ClassResolverFromClasspath()
-
-
Method Details
-
setClassUriImporter
Description copied from interface:ClassResolverAlways called BEFOREClassResolver.tryResolve(String).- Specified by:
setClassUriImporterin interfaceClassResolver- Parameters:
classUriImporter- to import aJavaClassfrom any suppliedURI
-
tryResolve
Description copied from interface:ClassResolverArchUnit will call this method, to resolve any missingJavaClasses, needed to build the class graph (i.e. targets of method calls, field accesses, super classes, interfaces, ...)- Specified by:
tryResolvein interfaceClassResolver- Parameters:
typeName- The type name to resolve asJavaClass- Returns:
- Optional.of(resolvedClass), if the
JavaClasscould be successfully imported, otherwise Optional.absent()
-