Class SingleFileCodeBaseEntry
java.lang.Object
edu.umd.cs.findbugs.classfile.impl.SingleFileCodeBaseEntry
- All Implemented Interfaces:
ICodeBaseEntry
Codebase entry for a single-file codebase.
- Author:
- David Hovemeyer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the ClassDescriptor of the class resource accessed by this codebase entry.Get the codebase this codebase entry belongs to.intGet the number of bytes in the resource.Get the name of the resource.inthashCode()Open an input stream reading from the resource.voidoverrideResourceName(String resourceName) Override the resource name of this codebase entry.toString()
-
Constructor Details
-
SingleFileCodeBaseEntry
Constructor.- Parameters:
codeBase- parent codebase
-
-
Method Details
-
getNumBytes
public int getNumBytes()Description copied from interface:ICodeBaseEntryGet the number of bytes in the resource. Returns <0 if the number of bytes is not known.- Specified by:
getNumBytesin interfaceICodeBaseEntry- Returns:
- number of bytes in the resource, or <0 if not known.
-
getResourceName
Description copied from interface:ICodeBaseEntryGet the name of the resource.- Specified by:
getResourceNamein interfaceICodeBaseEntry- Returns:
- the name of the resource
-
openResource
Description copied from interface:ICodeBaseEntryOpen an input stream reading from the resource.- Specified by:
openResourcein interfaceICodeBaseEntry- Returns:
- InputStream reading from the resource.
- Throws:
IOException- if an error occurs reading from the resource
-
getCodeBase
Description copied from interface:ICodeBaseEntryGet the codebase this codebase entry belongs to.- Specified by:
getCodeBasein interfaceICodeBaseEntry- Returns:
- the codebase this codebase entry belongs to
-
getClassDescriptor
public ClassDescriptor getClassDescriptor() throws ResourceNotFoundException, InvalidClassFileFormatExceptionDescription copied from interface:ICodeBaseEntryReturn the ClassDescriptor of the class resource accessed by this codebase entry. Do not call this method unless ClassDescriptor.isClassResource() returns true. This method may require the class data to be loaded in order to determine the class.- Specified by:
getClassDescriptorin interfaceICodeBaseEntry- Returns:
- ClassDescriptor of this entry
- Throws:
ResourceNotFoundException- InvalidClassFileFormatException if the codebase entry does not reference a valid classfileInvalidClassFileFormatException
-
overrideResourceName
Description copied from interface:ICodeBaseEntryOverride the resource name of this codebase entry.- Specified by:
overrideResourceNamein interfaceICodeBaseEntry- Parameters:
resourceName- the new resource name
-
equals
-
hashCode
public int hashCode() -
toString
-