|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclasspathhelper.ContentDetail
classpathhelper.ClassDetail
Class that extends on the idea of a meta class
such as Class
. This meta class ads
additional information such as dependent classes, blocked
or obscurring classes, as well as unavailable classes that
are required but not visible on the classpath.
ClassDetail objects are created by CGClassLoader
and
can be obtained via CGClassLoader.getClassDetail(String)
.
A given instance of a detail object can be used to obtain
static information about the class, without needing to load
the java.lang.Class
object.
mutex
object.
Field Summary |
Fields inherited from class classpathhelper.ContentDetail |
description |
Constructor Summary | |
ClassDetail(CGClassLoader theClassLoader,
ClassDescription theDescription)
Creates a ClassDetail, typically called by CGClassLoader . |
Method Summary | |
void |
addDependency(ClassDescription theClassname)
Used during construction to build up the dependencies of this detail object. |
void |
clearCache()
Method that clears any cached values within this object. |
void |
dump()
Dumps a description of this object to standard out. |
java.lang.Class |
getClassObject()
Method that gets the associated class object. |
ClassDescription[] |
getDependentsThatWontLoad()
This method builds off the concept of getNotFoundDependentClasses()
however this method also recursively searches all dependents looking for
unresolved references. |
ClassDescription[] |
getDependsOnByLocation(java.lang.String location)
Gets the class names that the associated class depends on given the specified location. |
ClassDescription[] |
getDependsOnClasses()
|
java.lang.String[] |
getDependsOnLocations()
Returns the list of locations (such as jar files or directories) that this class requires. |
ContentDescription |
getDescription()
The description of this content. |
java.lang.String |
getName()
|
ClassDescription[] |
getNotFoundDependentClasses()
Method that finds the classes this class depends on that cannot be resolved on the current classpath. |
ContentDescription[] |
getReferredToBy(CGClassLoader startingClassLoader)
Method for retrieving the classes that refer to this class. |
protected java.util.Set |
getReferredToByCache()
Retrieves the cache that stores class names of the classes that refer to this class. |
ContentDescription[] |
getReferredToByLocation(CGClassLoader startingClassLoader,
java.lang.String locationDescription)
Method for retrieving the classes that refer to this class from the supplied location. |
java.lang.String[] |
getReferredToByLocations(CGClassLoader startingClassLoader)
Method that retrieves the locations that have classes that refer to this class. |
protected ClassDescription[] |
innerDependentsThatWontLoad(java.util.Set endRecursion)
Internal method used by getDependentsThatWontLoad() to
search children for unresolved references. |
boolean |
isInterface()
Flag indicating whether or not the Class associated with
this detail object is an interface. |
protected void |
setIsInterface(boolean isit)
Method used by CGClassLoader to indicate whether
or not this class is an interface. |
protected void |
setReferredToByCache(java.util.Set cache)
Sets the cache that will store the class names of classes that refer to this class. |
java.lang.String |
toString()
|
Methods inherited from class classpathhelper.ContentDetail |
addBlockedLocation, getAllLocations, getBlockedLocations, getBlockedLocationsWithDifferentByteCode, getChecksum, getClassLoader, getLocation, getPath, setChecksum, setLocation, setPath |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClassDetail(CGClassLoader theClassLoader, ClassDescription theDescription)
CGClassLoader
.
theClassLoader
- The classloader that this class was loaded by.theDescription
- The corresponding descriptionMethod Detail |
public void clearCache()
public java.lang.String getName()
public boolean isInterface()
Class
associated with
this detail object is an interface.
true
if the associated class is an interface
otherwise false
.public void addDependency(ClassDescription theClassname)
theClassname
- The description of the dependent class.public java.lang.Class getClassObject() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- If the class cannot be found
or cannot be loaded.public ClassDescription[] getDependsOnClasses()
ClassDescription
objects corresponding
to the classes this class depends on., 1.1public java.lang.String[] getDependsOnLocations()
getDependsOnClasses()
except that its
reporting the locations of those classes (as opposed
to the actual class names).
public ClassDescription[] getDependsOnByLocation(java.lang.String location)
Gets the class names that the associated class depends on given the specified location.
As an example this might be all the classes the associated class depends on within a certain jar
.This method will not include blocked classes.
location
- The classpath location, to look for dependent
classes on.
public ClassDescription[] getNotFoundDependentClasses()
public ClassDescription[] getDependentsThatWontLoad()
getNotFoundDependentClasses()
however this method also recursively searches all dependents looking for
unresolved references. The returned array is the direct dependents
that will not load because of an unresolved reference somewhere in their
dependency chain.
ClassDescription
objects that refer to direct
dependents that will not load due to unresolved references in the
classpath.public ContentDescription[] getReferredToBy(CGClassLoader startingClassLoader)
startingClassLoader
- The root class loader or the
descedent most classloader ot calculate references from.
public java.lang.String[] getReferredToByLocations(CGClassLoader startingClassLoader)
startingClassLoader
- The root class loader or the
descedent most classloader ot calculate references from.
public ContentDescription[] getReferredToByLocation(CGClassLoader startingClassLoader, java.lang.String locationDescription)
Method for retrieving the classes that refer to this class from the supplied location.
This method is expensive because it requires that all classes on the classpath get loaded to determine which classes reference which. Also, because parent class loaders are unaware of how many descendent classloaders they have, this method requires that a root class loader get passed in which is the (potentially descendent) class loader that will be the starting point for determine where to start loading all classes.
startingClassLoader
- The root class loader or the
descedent most classloader ot calculate references from.locationDescription
- The location to return classes from.
public void dump()
protected java.util.Set getReferredToByCache()
protected void setReferredToByCache(java.util.Set cache)
CGClassLoader
because
CGClassLoader actually initiates this cache prior
to the detail object getting created. This means
the the cache passed into this method is often already
populated with some values.
cache
- A set of class names.protected void setIsInterface(boolean isit)
CGClassLoader
to indicate whether
or not this class is an interface.
isit
- true
if the associated class
is an interface, otherwise false
.protected ClassDescription[] innerDependentsThatWontLoad(java.util.Set endRecursion)
getDependentsThatWontLoad()
to
search children for unresolved references.
endRecursion
- The set of classes already searched, this set
is used to prevent circular dependencies.
public ContentDescription getDescription()
ContentDetail
getDescription
in class ContentDetail
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |