com.acciente.commons.loader
Interface ClassDefLoader

All Known Implementing Classes:
JavaCompiledClassDefLoader

public interface ClassDefLoader

This is an interface that abstracts the loading of class definitions.

Author:
Adinath Raveendra Raj

Method Summary
 Set findClassNames(String[] asPackageNames, Pattern oClassNamePattern)
          Searches for class names that match the specified package root and regex.
 ClassDef getClassDef(String sClassName)
          Load the byte code and other information about the specified class
 ResourceDef getResourceDef(String sResourceName)
          Load the data and other information about the specified resource
 

Method Detail

getClassDef

ClassDef getClassDef(String sClassName)
                     throws ClassNotFoundException
Load the byte code and other information about the specified class

Parameters:
sClassName - the name of the class for which a definition is requested
Returns:
a class definition if this class definition loader is able to locate and successfully load the byte code for the class. If the class could not be located a null is returned, if the class was located but the load failed an exception is thrown.
Throws:
ClassNotFoundException - if this loader was able to locate the class definition was unable to sucessfully load it

getResourceDef

ResourceDef getResourceDef(String sResourceName)
Load the data and other information about the specified resource

Parameters:
sResourceName - the name of the class for which a definition is requested
Returns:
a resource definition if this class definition loader is able to locate and successfully load the data for the resource. If the resource could not be located a null is returned, if the resource was located but the load failed again a null is returned (since the getResource() and getResourceAsStreamMethods() do not have checked exceptions in their signature).

findClassNames

Set findClassNames(String[] asPackageNames,
                   Pattern oClassNamePattern)
Searches for class names that match the specified package root and regex. This method is expected to search and return a list of fully qualified classnames.

Parameters:
asPackageNames - an array of starting package names to start the search, if the package names arg is null all package names are searched
oClassNamePattern - a java regex that defines the classnames that match the search
Returns:
a set of string classnames that match the specified regex


Copyright © 2008-2013 Acciente, LLC. All Rights Reserved.