Class WebClassesFinder
java.lang.Object
org.ocpsoft.rewrite.annotation.scan.AbstractClassFinder
org.ocpsoft.rewrite.annotation.scan.WebClassesFinder
- All Implemented Interfaces:
org.ocpsoft.common.pattern.Weighted,ClassFinder
Implementation of
ClassFinder that searches for classes in the /WEB-INF/classes directory of a
web application. Please note that this class is stateful. It should be used only for one call to
findClasses(ClassVisitor).- Author:
- Christian Kaltepoth
-
Field Summary
Fields inherited from class org.ocpsoft.rewrite.annotation.scan.AbstractClassFinder
classLoader, log, packageFilter, servletContext -
Constructor Summary
ConstructorsConstructorDescriptionWebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter, ByteCodeFilter byteCodeFilter) Initialization -
Method Summary
Modifier and TypeMethodDescriptionvoidfindClasses(ClassVisitor visitor) intpriority()protected voidprocessDirectory(URL absoluteUrl, String relativePath, ClassVisitor visitor) Scan for classes in a single directory.Methods inherited from class org.ocpsoft.rewrite.annotation.scan.AbstractClassFinder
getClassName, mustProcessClass, processClass, stripKnownPrefix
-
Constructor Details
-
WebClassesFinder
public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter, ByteCodeFilter byteCodeFilter) Initialization
-
-
Method Details
-
findClasses
-
processDirectory
protected void processDirectory(URL absoluteUrl, String relativePath, ClassVisitor visitor) throws MalformedURLException Scan for classes in a single directory. This method will call itself recursively if it finds other directories and callAbstractClassFinder.processClass(String, InputStream, ClassVisitor)when it finds a file ending with ".class" and that is accepted by thePackageFilter- Parameters:
absoluteUrl- The absolute URL of the WEB-INF node to scanrelativePath- The path of the node inside the WEB-INFvisitor- The visitor class to call for classes found- Throws:
MalformedURLException- for invalid URLs
-
priority
public int priority()
-