Class DelegatingCodeBaseEntry
- java.lang.Object
-
- edu.umd.cs.findbugs.classfile.impl.DelegatingCodeBaseEntry
-
- All Implemented Interfaces:
ICodeBaseEntry
public class DelegatingCodeBaseEntry extends java.lang.Object implements ICodeBaseEntry
Implementation of ICodeBaseEntry that delegates to another codebase entry. This is needed for codebase entries in nested zipfiles, which are implemented using a private zipfile codebase.- Author:
- David Hovemeyer
-
-
Constructor Summary
Constructors Constructor Description DelegatingCodeBaseEntry(ICodeBase frontEndCodeBase, ICodeBaseEntry delegateCodeBaseEntry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
ClassDescriptor
getClassDescriptor()
Return the ClassDescriptor of the class resource accessed by this codebase entry.ICodeBase
getCodeBase()
Get the codebase this codebase entry belongs to.int
getNumBytes()
Get the number of bytes in the resource.java.lang.String
getResourceName()
Get the name of the resource.int
hashCode()
java.io.InputStream
openResource()
Open an input stream reading from the resource.void
overrideResourceName(java.lang.String resourceName)
Override the resource name of this codebase entry.java.lang.String
toString()
-
-
-
Constructor Detail
-
DelegatingCodeBaseEntry
public DelegatingCodeBaseEntry(ICodeBase frontEndCodeBase, ICodeBaseEntry delegateCodeBaseEntry)
-
-
Method Detail
-
getNumBytes
public int getNumBytes()
Description copied from interface:ICodeBaseEntry
Get the number of bytes in the resource. Returns <0 if the number of bytes is not known.- Specified by:
getNumBytes
in interfaceICodeBaseEntry
- Returns:
- number of bytes in the resource, or <0 if not known.
-
getResourceName
public java.lang.String getResourceName()
Description copied from interface:ICodeBaseEntry
Get the name of the resource.- Specified by:
getResourceName
in interfaceICodeBaseEntry
- Returns:
- the name of the resource
-
openResource
public java.io.InputStream openResource() throws java.io.IOException
Description copied from interface:ICodeBaseEntry
Open an input stream reading from the resource.- Specified by:
openResource
in interfaceICodeBaseEntry
- Returns:
- InputStream reading from the resource.
- Throws:
java.io.IOException
- if an error occurs reading from the resource
-
getCodeBase
public ICodeBase getCodeBase()
Description copied from interface:ICodeBaseEntry
Get the codebase this codebase entry belongs to.- Specified by:
getCodeBase
in interfaceICodeBaseEntry
- Returns:
- the codebase this codebase entry belongs to
-
getClassDescriptor
public ClassDescriptor getClassDescriptor() throws ResourceNotFoundException, InvalidClassFileFormatException
Description copied from interface:ICodeBaseEntry
Return 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:
getClassDescriptor
in interfaceICodeBaseEntry
- Returns:
- ClassDescriptor of this entry
- Throws:
ResourceNotFoundException
- InvalidClassFileFormatException if the codebase entry does not reference a valid classfileInvalidClassFileFormatException
-
overrideResourceName
public void overrideResourceName(java.lang.String resourceName)
Description copied from interface:ICodeBaseEntry
Override the resource name of this codebase entry.- Specified by:
overrideResourceName
in interfaceICodeBaseEntry
- Parameters:
resourceName
- the new resource name
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-