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 booleanequals(java.lang.Object obj)ClassDescriptorgetClassDescriptor()Return the ClassDescriptor of the class resource accessed by this codebase entry.ICodeBasegetCodeBase()Get the codebase this codebase entry belongs to.intgetNumBytes()Get the number of bytes in the resource.java.lang.StringgetResourceName()Get the name of the resource.inthashCode()java.io.InputStreamopenResource()Open an input stream reading from the resource.voidoverrideResourceName(java.lang.String resourceName)Override the resource name of this codebase entry.java.lang.StringtoString()
-
-
-
Constructor Detail
-
DelegatingCodeBaseEntry
public DelegatingCodeBaseEntry(ICodeBase frontEndCodeBase, ICodeBaseEntry delegateCodeBaseEntry)
-
-
Method Detail
-
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
public java.lang.String getResourceName()
Description copied from interface:ICodeBaseEntryGet the name of the resource.- Specified by:
getResourceNamein interfaceICodeBaseEntry- Returns:
- the name of the resource
-
openResource
public java.io.InputStream openResource() throws java.io.IOExceptionDescription copied from interface:ICodeBaseEntryOpen an input stream reading from the resource.- Specified by:
openResourcein 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: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, InvalidClassFileFormatException
Description 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:
ResourceNotFoundExceptionInvalidClassFileFormatException
-
overrideResourceName
public void overrideResourceName(java.lang.String resourceName)
Description copied from interface:ICodeBaseEntryOverride the resource name of this codebase entry.- Specified by:
overrideResourceNamein interfaceICodeBaseEntry- Parameters:
resourceName- the new resource name
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-