org.apache.commons.classscan
Interface MetaClassLoader

All Known Subinterfaces:
SpiMetaClassLoader
All Known Implementing Classes:
BootstrapMetaClassLoader, UrlMetaClassLoader

public interface MetaClassLoader

Metadata about a ClassLoader. This includes the jars that a ClassLoader loads from and the Classes that are potentially available.


Method Summary
 Collection<? extends MetaClass> findAllImplementors(String interfaceToFind)
          Find all the implementors of an interface class.
 MetaClass findMetaClass(String className)
          Find metadata about a particular Class.
 MetaClassPathElement getClassLocation(String codeLocation)
          Get metadata about a class locations
 Collection<? extends MetaClassPathElement> getClassLocations()
          Get metadata about the locations from which the associated ClassLoader loads Classes.
 MetaClass getMetaClass(String className)
          Get metadata about a particular Class.
 Iterator<? extends MetaClass> getMetaClasses()
          Get metadata about the Classes from which the associated ClassLoader can load.
 MetaClassLoader getParent()
          Get the metadata about the parent of the associated ClassLoader.
 

Method Detail

getParent

MetaClassLoader getParent()
Get the metadata about the parent of the associated ClassLoader.

Returns:
The parent metadata. This will be null if the associated ClassLoader is the primordial ClassLoader.

getClassLocations

Collection<? extends MetaClassPathElement> getClassLocations()
Get metadata about the locations from which the associated ClassLoader loads Classes.

Returns:
A read-only set of code locations

getClassLocation

MetaClassPathElement getClassLocation(String codeLocation)
Get metadata about a class locations

Parameters:
codeLocation - The location of a folder, jar, or compressed code

getMetaClasses

Iterator<? extends MetaClass> getMetaClasses()
Get metadata about the Classes from which the associated ClassLoader can load.

Returns:
A read-only set of class information

getMetaClass

MetaClass getMetaClass(String className)
Get metadata about a particular Class. This method will return only classes defined by the associated ClassLoader. Classes defined by a parent ClassLoader can be found using findMetaClass(java.lang.String).

Parameters:
className - The name of the Class
Returns:
The metadata about the Class; or null, if the class was not available to the associated ClassLoader

findMetaClass

MetaClass findMetaClass(String className)
Find metadata about a particular Class. This method will first search up the associated parent ClassLoader chain.

Parameters:
className - The name of the Class
Returns:
The metadata about the Class; or null, if the class was not available to the associated ClassLoader not its parent chain

findAllImplementors

Collection<? extends MetaClass> findAllImplementors(String interfaceToFind)
Find all the implementors of an interface class. This method will search in the associated ClassLoader and all parents.

Parameters:
interfaceToFind - The non-null MetaClass associated with the
Returns:
All discovered implementors of the desired interface


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.