Package edu.umd.cs.findbugs.classfile
Interface IClassPath
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ClassPathImpl
A classpath from which resources (classes and other files) may be loaded.
Essentially, this is just a list of codebases.
- Author:
- David Hovemeyer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCodeBase
(ICodeBase codeBase) Add a codebase.Return an iterator over the application codebases.Return an iterator over the auxiliary codebases.void
close()
Close all of the code bases that are part of this class path.Returns all of the application code base entries that are part of this class path.lookupResource
(String resourceName) Lookup a resource by name.void
mapResourceNameToCodeBaseEntry
(String resourceName, ICodeBaseEntry codeBaseEntry) Add a resource name to codebase entry mapping.
-
Method Details
-
addCodeBase
Add a codebase. The object will be interrogated to determine whether it is an application codebase or an auxiliary codebase. Application codebases must be scannable.- Parameters:
codeBase
- the codebase to add
-
appCodeBaseIterator
Return an iterator over the application codebases.- Returns:
- iterator over the application codebases
-
auxCodeBaseIterator
Return an iterator over the auxiliary codebases.- Returns:
- iterator over the auxiliary codebases
-
lookupResource
Lookup a resource by name.- Parameters:
resourceName
- name of the resource to look up- Returns:
- ICodeBaseEntry representing the resource
- Throws:
ResourceNotFoundException
- if the resource is not found
-
mapResourceNameToCodeBaseEntry
Add a resource name to codebase entry mapping. Once this is done, future lookups of this resource will automatically resolve to the given codebase entry.- Parameters:
resourceName
- the resource name to mapcodeBaseEntry
- the codebase entry to use for this resource
-
getApplicationCodebaseEntries
Map<String,ICodeBaseEntry> getApplicationCodebaseEntries()Returns all of the application code base entries that are part of this class path.- Returns:
- map where the key is slashed (VM) class name with ".class" suffix
-
close
void close()Close all of the code bases that are part of this class path. This should be done once the client is finished with the classpath.- Specified by:
close
in interfaceAutoCloseable
-