Package edu.umd.cs.findbugs.classfile
Interface IClassPath
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
ClassPathImpl
public interface IClassPath extends java.lang.AutoCloseable
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addCodeBase(ICodeBase codeBase)
Add a codebase.java.util.Iterator<? extends ICodeBase>
appCodeBaseIterator()
Return an iterator over the application codebases.java.util.Iterator<? extends ICodeBase>
auxCodeBaseIterator()
Return an iterator over the auxiliary codebases.void
close()
Close all of the code bases that are part of this class path.java.util.Map<java.lang.String,ICodeBaseEntry>
getApplicationCodebaseEntries()
Returns all of the application code base entries that are part of this class path.ICodeBaseEntry
lookupResource(java.lang.String resourceName)
Lookup a resource by name.void
mapResourceNameToCodeBaseEntry(java.lang.String resourceName, ICodeBaseEntry codeBaseEntry)
Add a resource name to codebase entry mapping.
-
-
-
Method Detail
-
addCodeBase
void addCodeBase(ICodeBase codeBase)
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
java.util.Iterator<? extends ICodeBase> appCodeBaseIterator()
Return an iterator over the application codebases.- Returns:
- iterator over the application codebases
-
auxCodeBaseIterator
java.util.Iterator<? extends ICodeBase> auxCodeBaseIterator()
Return an iterator over the auxiliary codebases.- Returns:
- iterator over the auxiliary codebases
-
lookupResource
ICodeBaseEntry lookupResource(java.lang.String resourceName) throws ResourceNotFoundException
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
void mapResourceNameToCodeBaseEntry(java.lang.String resourceName, ICodeBaseEntry codeBaseEntry)
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
java.util.Map<java.lang.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 interfacejava.lang.AutoCloseable
-
-