Class ClassPathImpl
- java.lang.Object
-
- edu.umd.cs.findbugs.classfile.impl.ClassPathImpl
-
- All Implemented Interfaces:
IClassPath
public class ClassPathImpl extends java.lang.Object implements IClassPath
Implementation of IClassPath.- Author:
- David Hovemeyer
-
-
Constructor Summary
Constructors Constructor Description ClassPathImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCodeBase(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.voidclose()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.ICodeBaseEntrylookupResource(java.lang.String resourceName)Lookup a resource by name.voidmapResourceNameToCodeBaseEntry(java.lang.String resourceName, ICodeBaseEntry codeBaseEntry)Add a resource name to codebase entry mapping.java.lang.StringtoString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
addCodeBase
public void addCodeBase(ICodeBase codeBase)
Description copied from interface:IClassPathAdd a codebase. The object will be interrogated to determine whether it is an application codebase or an auxiliary codebase. Application codebases must be scannable.- Specified by:
addCodeBasein interfaceIClassPath- Parameters:
codeBase- the codebase to add
-
appCodeBaseIterator
public java.util.Iterator<? extends ICodeBase> appCodeBaseIterator()
Description copied from interface:IClassPathReturn an iterator over the application codebases.- Specified by:
appCodeBaseIteratorin interfaceIClassPath- Returns:
- iterator over the application codebases
-
auxCodeBaseIterator
public java.util.Iterator<? extends ICodeBase> auxCodeBaseIterator()
Description copied from interface:IClassPathReturn an iterator over the auxiliary codebases.- Specified by:
auxCodeBaseIteratorin interfaceIClassPath- Returns:
- iterator over the auxiliary codebases
-
close
public void close()
Description copied from interface:IClassPathClose 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:
closein interfaceIClassPath
-
getApplicationCodebaseEntries
public java.util.Map<java.lang.String,ICodeBaseEntry> getApplicationCodebaseEntries()
Description copied from interface:IClassPathReturns all of the application code base entries that are part of this class path.- Specified by:
getApplicationCodebaseEntriesin interfaceIClassPath- Returns:
- map where the key is slashed (VM) class name with ".class" suffix
-
lookupResource
public ICodeBaseEntry lookupResource(java.lang.String resourceName) throws ResourceNotFoundException
Description copied from interface:IClassPathLookup a resource by name.- Specified by:
lookupResourcein interfaceIClassPath- Parameters:
resourceName- name of the resource to look up- Returns:
- ICodeBaseEntry representing the resource
- Throws:
ResourceNotFoundException- if the resource is not found
-
mapResourceNameToCodeBaseEntry
public void mapResourceNameToCodeBaseEntry(java.lang.String resourceName, ICodeBaseEntry codeBaseEntry)Description copied from interface:IClassPathAdd a resource name to codebase entry mapping. Once this is done, future lookups of this resource will automatically resolve to the given codebase entry.- Specified by:
mapResourceNameToCodeBaseEntryin interfaceIClassPath- Parameters:
resourceName- the resource name to mapcodeBaseEntry- the codebase entry to use for this resource
-
-