edu.umd.cs.findbugs.classfile

Interface ICodeBase

public interface ICodeBase

Interface for a basic code base in which we can look up resources but not necessarily scan for the list of all resources.

Author: David Hovemeyer

Field Summary
static intIN_JAR_MANIFEST
Codebase was referenced in the Class-Path attribute of a Jar manifest of another codebase.
static intIN_SYSTEM_CLASSPATH
Codebase was discovered in the system classpath.
static intNESTED
Codebase was discovered as a nested archive in another codebase.
static intSPECIFIED
Codebase was explicitly specified.
Method Summary
voidclose()
This method should be called when done using the code base.
booleancontainsSourceFiles()
Return whether or not this code base contains any source files.
ICodeBaseLocatorgetCodeBaseLocator()
Get the codebase locator describing the location of this codebase.
intgetHowDiscovered()
Return how this codebase was discovered.
longgetLastModifiedTime()
Get timestamp indicating the most recent time when any of the files in the codebase were modified.
StringgetPathName()
Get the filesystem pathname of this codebase.
booleanisApplicationCodeBase()
Return whether or not this codebase is an application codebase.
ICodeBaseEntrylookupResource(String resourceName)
Look up a resource in this code base.
voidsetApplicationCodeBase(boolean isAppCodeBase)
Designate this code base as an application codebase.
voidsetHowDiscovered(int howDiscovered)
Set how this codebase was discovered.
voidsetLastModifiedTime(long lastModifiedTime)
Set timestamp indicating the most recent time when any of the files in the codebase were modified.

Field Detail

IN_JAR_MANIFEST

public static final int IN_JAR_MANIFEST
Codebase was referenced in the Class-Path attribute of a Jar manifest of another codebase.

IN_SYSTEM_CLASSPATH

public static final int IN_SYSTEM_CLASSPATH
Codebase was discovered in the system classpath.

NESTED

public static final int NESTED
Codebase was discovered as a nested archive in another codebase.

SPECIFIED

public static final int SPECIFIED
Codebase was explicitly specified.

Method Detail

close

public void close()
This method should be called when done using the code base.

containsSourceFiles

public boolean containsSourceFiles()
Return whether or not this code base contains any source files.

Returns: true if the code base contains source file(s), false if it does not contain source files

getCodeBaseLocator

public ICodeBaseLocator getCodeBaseLocator()
Get the codebase locator describing the location of this codebase.

Returns: the ICodeBaseLocator

getHowDiscovered

public int getHowDiscovered()
Return how this codebase was discovered.

Returns: one of the constants SPECIFIED, NESTED, IN_JAR_MANIFEST, or IN_SYSTEM_CLASSPATH

getLastModifiedTime

public long getLastModifiedTime()
Get timestamp indicating the most recent time when any of the files in the codebase were modified. This information is only likely to be accurate if an ICodeBaseIterator has been used to scan the resources in the codebase (scannable codebases only, obviously).

Returns: timestamp when any codebase files were most-recently modified, -1 if unknown

getPathName

public String getPathName()
Get the filesystem pathname of this codebase.

Returns: the filesystem pathname of this codebase, or null if this codebase is not accessible via the filesystem

isApplicationCodeBase

public boolean isApplicationCodeBase()
Return whether or not this codebase is an application codebase.

Returns: true if this is an application codebase, false if not

lookupResource

public ICodeBaseEntry lookupResource(String resourceName)
Look up a resource in this code base.

Parameters: resourceName name of the resource to look up

Returns: ICodeBaseEntry representing the resource

Throws: ResourceNotFoundException if the resource cannot be found in this code base

setApplicationCodeBase

public void setApplicationCodeBase(boolean isAppCodeBase)
Designate this code base as an application codebase.

Parameters: isAppCodeBase true if this is an application codebase, false if not

setHowDiscovered

public void setHowDiscovered(int howDiscovered)
Set how this codebase was discovered.

Parameters: howDiscovered one of the constants SPECIFIED, NESTED, IN_JAR_MANIFEST, or IN_SYSTEM_CLASSPATH

setLastModifiedTime

public void setLastModifiedTime(long lastModifiedTime)
Set timestamp indicating the most recent time when any of the files in the codebase were modified.

Parameters: lastModifiedTime timestamp when any codebase files were most-recently modified

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.