org.yajul.util
Class AbstractScanner

java.lang.Object
  extended by org.yajul.util.AbstractScanner
Direct Known Subclasses:
BasicScanner

public abstract class AbstractScanner
extends java.lang.Object

Classpath scanner adapted from Seam. Finds a 'tag' resource in the classpath and then scans through all the directories and files inside the JAR or directory where the tag resource was found. This can be used to iterate through all the classes in a particular class path element to find all classes that implement a particular interface, for example.
User: josh Date: Mar 6, 2008 Time: 6:09:45 PM

Author:
Josh Davis - Adapted to Yajul., Thomas Heute, Gavin King, Norman Richards

Field Summary
protected  java.lang.ClassLoader classLoader
           
protected  java.lang.String resourceName
           
 
Constructor Summary
AbstractScanner(java.lang.String resourceName)
          Scans everything in the classpath where the specified resource is located.
AbstractScanner(java.lang.String resourceName, java.lang.ClassLoader classLoader)
           
 
Method Summary
static java.lang.String filenameToClassname(java.lang.String filename)
           
static java.lang.String filenameToPackage(java.lang.String filename)
           
protected  java.net.URL[] getURLsFromClassLoader()
           
protected  void scan()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceName

protected java.lang.String resourceName

classLoader

protected java.lang.ClassLoader classLoader
Constructor Detail

AbstractScanner

public AbstractScanner(java.lang.String resourceName)
Scans everything in the classpath where the specified resource is located.

Parameters:
resourceName - resource name used to find a directory or archive to scan

AbstractScanner

public AbstractScanner(java.lang.String resourceName,
                       java.lang.ClassLoader classLoader)
Method Detail

filenameToClassname

public static java.lang.String filenameToClassname(java.lang.String filename)

filenameToPackage

public static java.lang.String filenameToPackage(java.lang.String filename)

scan

protected void scan()

getURLsFromClassLoader

protected java.net.URL[] getURLsFromClassLoader()


Copyright © 2008. All Rights Reserved.