org.robotframework.javalib.beans.common
Class DefaultClassFinder

java.lang.Object
  extended by org.springframework.core.io.support.PathMatchingResourcePatternResolver
      extended by org.robotframework.javalib.beans.common.DefaultClassFinder
All Implemented Interfaces:
ClassFinder, org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver

public class DefaultClassFinder
extends org.springframework.core.io.support.PathMatchingResourcePatternResolver
implements ClassFinder

Finds resources according to given pattern, resolves them into names and then loads them.


Field Summary
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
DefaultClassFinder()
           
DefaultClassFinder(java.lang.ClassLoader classLoader)
           
 
Method Summary
 java.lang.Class[] getClasses(java.lang.String pattern)
          Uses the resolver provided in the constructor with the given pattern to get matching classes.
protected  java.util.jar.JarFile getJarFile(java.lang.String jarFileUrl)
           
 void setClassNameResolver(ClassNameResolver classNameResolver)
          The default ClassNameResolver is DefaultClassNameResolver.
 
Methods inherited from class org.springframework.core.io.support.PathMatchingResourcePatternResolver
convertClassLoaderURL, determineRootDir, doFindMatchingFileSystemResources, doFindPathMatchingFileResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClassFinder

public DefaultClassFinder(java.lang.ClassLoader classLoader)
Parameters:
classLoader - resolver to use for resolving the given pattern

DefaultClassFinder

public DefaultClassFinder()
Method Detail

getClasses

public java.lang.Class[] getClasses(java.lang.String pattern)
Uses the resolver provided in the constructor with the given pattern to get matching classes. By default uses DefaultClassNameResolver to resolve Resource objects to class names.

Specified by:
getClasses in interface ClassFinder

setClassNameResolver

public void setClassNameResolver(ClassNameResolver classNameResolver)
The default ClassNameResolver is DefaultClassNameResolver. Must be set prior to calling getClasses.


getJarFile

protected java.util.jar.JarFile getJarFile(java.lang.String jarFileUrl)
                                    throws java.io.IOException
Overrides:
getJarFile in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
Throws:
java.io.IOException


Copyright © 2009. All Rights Reserved.