classpathhelper
Class ContentDetail

java.lang.Object
  extended byclasspathhelper.ContentDetail
Direct Known Subclasses:
ClassDetail

public class ContentDetail
extends java.lang.Object

Class representing generic content that is loaded via a ClassLoader as either a class or Resource. Subclasses will typically look at the contents of the file and provide more detailed attributes.

Since:
1.1
Author:
bharris

Field Summary
protected  ContentDescription description
           
 
Constructor Summary
protected ContentDetail(CGClassLoader theClassLoader)
           
 
Method Summary
 void addBlockedLocation(java.lang.String location, boolean sameBytes)
          Used during construction to build up the blocked locations of this detail object.
 java.lang.String[] getAllLocations()
          Returns an array of all the locations this content can be cound at (unordered).
 java.lang.String[] getBlockedLocations()
          Returns an array of locations where this class was also located, (but these locations where not used because they where later in the classpath).
 java.lang.String[] getBlockedLocationsWithDifferentByteCode()
          Returns an array of locations where this class was also located and where the bytes loaded are different.
 long getChecksum()
           
 CGClassLoader getClassLoader()
           
 ContentDescription getDescription()
          The description of this content.
 java.lang.String getLocation()
          Returns the location description where this class was loaded from.
 java.lang.String getPath()
           
 void setChecksum(long checksum)
          Sets the checksum for the bytes used to create this class detail.
 void setLocation(java.lang.String location)
          Sets the location for this detail object, typically this is called during object creation.
 void setPath(java.lang.String path)
          The path for this content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

protected ContentDescription description
Constructor Detail

ContentDetail

protected ContentDetail(CGClassLoader theClassLoader)
Parameters:
theClassLoader - The ClassLoader that created this content.
Since:
1.1
Method Detail

getClassLoader

public CGClassLoader getClassLoader()
Returns:
The ClassLoader that this detail was created by.
Since:
1.1

addBlockedLocation

public void addBlockedLocation(java.lang.String location,
                               boolean sameBytes)
Used during construction to build up the blocked locations of this detail object.

Parameters:
location -
sameBytes - Does this location have the same byte code?
Since:
1.1

getChecksum

public long getChecksum()
Returns:
The checksum for the bytes used to create this class detail.
Since:
1.1

setChecksum

public void setChecksum(long checksum)
Sets the checksum for the bytes used to create this class detail.

Parameters:
checksum - The checksum value.
Since:
1.1

getLocation

public java.lang.String getLocation()
Returns the location description where this class was loaded from.

Returns:
The path to the object (typically a jar or directory).
Since:
1.1

setLocation

public void setLocation(java.lang.String location)
Sets the location for this detail object, typically this is called during object creation.

Parameters:
location - The location (such as a path to a jar or directory).
Since:
1.1

getBlockedLocations

public java.lang.String[] getBlockedLocations()
Returns an array of locations where this class was also located, (but these locations where not used because they where later in the classpath).

Returns:
An array of locations where versions of this class are also located (but not used).
Since:
1.1

getBlockedLocationsWithDifferentByteCode

public java.lang.String[] getBlockedLocationsWithDifferentByteCode()
Returns an array of locations where this class was also located and where the bytes loaded are different.

Returns:
An array of locations where the same class was found with different bytes.
Since:
1.1

getPath

public java.lang.String getPath()
Returns:
The path to this content.
Since:
1.1

setPath

public void setPath(java.lang.String path)
The path for this content.

Parameters:
path - The resource path.
Since:
1.1

getDescription

public ContentDescription getDescription()
The description of this content.

Returns:
The description associated with this detail.
Since:
1.1

getAllLocations

public java.lang.String[] getAllLocations()
Returns an array of all the locations this content can be cound at (unordered).

Returns:
Array of locations.
Since:
1.2