org.apache.commons.classscan.spi.model
Interface SpiMetaRegistry

All Superinterfaces:
MetaRegistry
All Known Implementing Classes:
DefaultMetaRegistry

public interface SpiMetaRegistry
extends MetaRegistry

The entry point for providers to find/create information about the ClassPath and the classes available from the ClassPath.


Field Summary
 
Fields inherited from interface org.apache.commons.classscan.MetaRegistry
DEFAULT_REGISTRY
 
Method Summary
 SpiClassPathElement createClassPathElement(URL url)
          Create a ClassPathElement from a URL.
 SpiMetaClass createMetaClass(MetaClassPathElement metaClassPathElement, String className, InputStream byteStream)
          Create SpiMetaClass from a MetaClassPathElement.
 SpiMetaClassPathElement createMetaClassPathElement(ClassPathElement pathElement)
          Create SpiMetaClassPathElement from a ClassPathElement.
 
Methods inherited from interface org.apache.commons.classscan.MetaRegistry
getClassPath, getMetaClassLoader
 

Method Detail

createMetaClassPathElement

SpiMetaClassPathElement createMetaClassPathElement(ClassPathElement pathElement)
Create SpiMetaClassPathElement from a ClassPathElement. The ClassPathElement has just the raw class path definition. The SpiMetaClassPathElement contains the metadata about classes available at the class path location.

Parameters:
pathElement - A location in the class path
Returns:
metadata for classes available at the given location

createMetaClass

SpiMetaClass createMetaClass(MetaClassPathElement metaClassPathElement,
                             String className,
                             InputStream byteStream)
                             throws IOException
Create SpiMetaClass from a MetaClassPathElement. The MetaClassPathElement has the metadata about a base location. The SpiMetaClass contains the metadata about the class defined in a stream of bytes.

Parameters:
metaClassPathElement - The location of a class
className - The canonical name of the class
byteStream - The byte stream containing the class definition. This stream should be closed when finished.
Returns:
The metadata about the class in the stream
Throws:
IOException

createClassPathElement

SpiClassPathElement createClassPathElement(URL url)
                                           throws IOException
Create a ClassPathElement from a URL. The registry will invoke ClassPathElementFactory(s) sequentially until a factory returns a ClassPathElement for the given URL.

Parameters:
url - The base location of the class files
Returns:
null, if no ClassPathElementFactory supports the given URL; otherwise, a ClassPathElement
Throws:
IOException


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