|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclasspathhelper.Location
Class representing a location where classes can be loaded from.
Locations use ClassStore
as its DAO object, to actually
retrieve bytes from.
CGClassLoader
and once obtained can be used to find aggregated information
on dependencies, blocked classes, unresolved references or can
be used to locate a specific ClassDetail
object.
mutex
it was
created with.
Constructor Summary | |
Location(CGClassLoader cgClassLoader,
ClassStore theStore)
|
Method Summary | |
void |
addBlockedClass(java.lang.String className,
boolean sameBytes)
Deprecated. Use addBlockedContent(classpathhelper.ContentDescription, boolean) |
void |
addBlockedContent(ContentDescription contDesc,
boolean sameBytes)
|
boolean |
equals(java.lang.Object o)
|
Package |
findPackage(java.lang.String packageName)
Find a specific package at this location. |
java.lang.String[] |
getBlockedClassNames()
Deprecated. Use getBlockedContents() . |
java.lang.String[] |
getBlockedClassNamesWithDifferentByteCode()
Deprecated. Use getBlockedClassNamesWithDifferentByteCode() |
ContentDescription[] |
getBlockedContents()
Retrieves a list of blocked classes at this location. |
ContentDescription[] |
getBlockedContentsWithDifferentByteCode()
Retrieves a list of blocked content at this location that have different bytes than the location where the actual class will be loaded from. |
ClassDescription[] |
getClassesThatDependOnLocation(java.lang.String location)
Returns an array of class descriptions, of classes contained within this locatoin, that depend on the supplied location. |
ClassDescription[] |
getClassesThatWontLoad()
Determines which classes loaded within this location will not load due to unresolved classes somewhere in its dependencies. |
CGClassLoader |
getClassLoader()
|
java.lang.String[] |
getClassNames()
Deprecated. Use getContents() |
java.lang.String[] |
getClassNamesThatDependOnLocation(java.lang.String location)
Deprecated. Use getClassesThatDependOnLocation(java.lang.String) . |
ClassStore |
getClassStore()
|
ContentDescription[] |
getContents()
Returns the contents at this location. |
ClassDescription[] |
getDependsOnClasses()
Returns an array of class names that corresponds to the classes dependend on by classes stored at this location. |
ClassDescription[] |
getDependsOnClassesByLocation(java.lang.String location)
Gets an array of class description that this location depends on by location. |
java.lang.String[] |
getDependsOnLocations()
Method that returns the locations containing classes that classes in this location depend on. |
java.lang.String |
getLocationDescription()
|
java.lang.String |
getLocationType()
A String representing this location type. |
ClassDescription[] |
getNotFoundDependentClasses()
Retrieves an array of class names corresponding to classes not found on the classpath, that are referenced by classes stored at this location. |
Package[] |
getPackages(boolean includeSub)
Gets the packages in this location. |
protected Package[] |
getPackages(PackageStore packageCache,
boolean includeSub)
Internal method that looks up the packages. |
protected void |
getPackages(PackageStore packageCache,
boolean includeSub,
java.util.Set retVal)
Internal method that searches through all content to determine the packages in this location. |
java.lang.String[] |
getReferredFromLocations(CGClassLoader startingClassLoader)
Method that returns the locations that refer to this location. |
ClassDescription[] |
getReferredFromLocationsByLocation(CGClassLoader startingClassLoader,
java.lang.String locationDescription)
Classes from a specific location that refer to classes in this location. |
int |
hashCode()
|
boolean |
isIgnored()
Flag indicating whether or not this location is being ignored by the class loader. |
void |
setIgnored(boolean isIgnored)
Sets the flag indicating whether or not this location is ignored by the class loader. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Location(CGClassLoader cgClassLoader, ClassStore theStore)
cgClassLoader
- The ClassLoader this location is associated with.theStore
- The class store this location will use to
obtain bytes from.Method Detail |
public boolean isIgnored()
true
If this location is ignored,
otherwise false
public void setIgnored(boolean isIgnored)
CGClassLoaderFilter
was supplied to this class loader
and indicated that the class store associated with this
location should be ignored.
isIgnored
- The ignore flag (default is false
).public void addBlockedClass(java.lang.String className, boolean sameBytes)
addBlockedContent(classpathhelper.ContentDescription, boolean)
className
- The class name that is blocked.sameBytes
- Flag indicating whether or not the blocked class
has the same bytes.public void addBlockedContent(ContentDescription contDesc, boolean sameBytes)
public ClassStore getClassStore()
public CGClassLoader getClassLoader()
public java.lang.String getLocationType()
public java.lang.String getLocationDescription()
public java.lang.String[] getReferredFromLocations(CGClassLoader startingClassLoader)
startingClassLoader
- Since this method requires all classes
are resolved, we need to supply the classloader we are starting with.
A location can be referenced by classes from a descendent classloader.
public ClassDescription[] getReferredFromLocationsByLocation(CGClassLoader startingClassLoader, java.lang.String locationDescription)
Classes from a specific location that refer to classes in this location. This method is quite expensive as it requires all classes to be resolved.
startingClassLoader
- Since this method requires all classes
are resolved, we need to supply the classloader we are starting with.
A location can be referenced by classes from a descendent classloader.locationDescription
- The location to take classes from.
public java.lang.String[] getDependsOnLocations()
public java.lang.String[] getClassNames()
getContents()
public ContentDescription[] getContents()
public ClassDescription[] getDependsOnClasses()
public ClassDescription[] getDependsOnClassesByLocation(java.lang.String location)
location
- The location to find all the classes this location depends on.
public ClassDescription[] getNotFoundDependentClasses()
public ClassDescription[] getClassesThatWontLoad()
public java.lang.String[] getClassNamesThatDependOnLocation(java.lang.String location)
getClassesThatDependOnLocation(java.lang.String)
.
Returns an array of class names, of classes contained within this location, that depend on the supplied location.
In other words, which classes from this location depend on the classes in the supplied location.
location
- A location description (typically a path).
public ClassDescription[] getClassesThatDependOnLocation(java.lang.String location)
Returns an array of class descriptions, of classes contained within this locatoin, that depend on the supplied location.
In other words, which classes from this location depend on the classes in the supplied location.
location
- A location description (typically a path).
public java.lang.String[] getBlockedClassNames()
getBlockedContents()
.
public ContentDescription[] getBlockedContents()
public java.lang.String[] getBlockedClassNamesWithDifferentByteCode()
getBlockedClassNamesWithDifferentByteCode()
public ContentDescription[] getBlockedContentsWithDifferentByteCode()
public Package[] getPackages(boolean includeSub)
Gets the packages in this location. The flag indicates whether or not to return extended packages or just immediate subpackages.
Note: If a package contains content like class a.b.c.SomeClasS
this location contains packages a
, a.b
in
addition to a.b.c
. (includeSub flag determines
what gets returned).
includeSub
- If true
packages such as a
,
a.b
and a.b.c
will be returned. If
false
only packages like a
(immediate subpackages)
will be returned.
public Package findPackage(java.lang.String packageName)
packageName
- The package name.
null
if the package cannot be found
at this location.protected Package[] getPackages(PackageStore packageCache, boolean includeSub)
getPackages(boolean)
.
packageCache
- The cache to lookup packages in.includeSub
- true
to include extended sub packages,
false
if only root packages are needed.
protected void getPackages(PackageStore packageCache, boolean includeSub, java.util.Set retVal)
getPackages(PackageStore, boolean)
to build up its cache of content.
packageCache
- The cache to look up items in.includeSub
- true
to include extended sub packages,
false
if only root packages are needed.retVal
- The set that holds the results of repeated calls to this
method.public java.lang.String toString()
public boolean equals(java.lang.Object o)
public int hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |