Created
January 21, 2015 02:51
-
-
Save y-yoshinoya/25d39bb325bf0472cb13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies ++= Seq("org.clapper" %% "classutil" % "1.0.5") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File | |
import org.clapper.classutil.ClassFinder | |
Object App extends App { | |
val classloader = Thread.currentThread.getContextClassLoader // some classloader | |
val classpath = classloader.getResource(".").toURI | |
val finder = ClassFinder(Seq(File(classpath))) | |
val classes = finder.getClasses.toIterator | |
val subClasses = ClassFinder.concreteSubclasses("com.foo.bar.ParentInterface", classes) | |
subClasses.foreach(println) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment