org.clapper.classutil

ClassFinder

object ClassFinder

The entrance to the factory floor, providing methods for finding and filtering classes.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ClassFinder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def apply(path: Seq[File] = Seq.empty[File]): ClassFinder

    Instantiate a new ClassFinder that will search the specified classpath, or the default classpath, if no classpath is defined.

    Instantiate a new ClassFinder that will search the specified classpath, or the default classpath, if no classpath is defined.

    path

    the classpath, which is a sequence of File objects representing directories, jars and zip files to search. Defaults to classpath.

    returns

    a new ClassFinder object

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def classInfoMap(iterator: Iterator[ClassInfo]): Map[String, ClassInfo]

    Create a map from an Iterator of ClassInfo objects.

    Create a map from an Iterator of ClassInfo objects. The resulting map is indexed by class name.

  9. def classpath: List[File]

    Convenient method for getting the standard JVM classpath, into a variable suitable for use with the find() method.

    Convenient method for getting the standard JVM classpath, into a variable suitable for use with the find() method.

    returns

    the classpath, as a list of File objects

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def concreteSubclasses(ancestor: String, classes: Map[String, ClassInfo]): Iterator[ClassInfo]

    Convenience method that scans the specified classes for all concrete classes that are subclasses of the named class.

    Convenience method that scans the specified classes for all concrete classes that are subclasses of the named class. A subclass, in this definition, is a class that directly or indirectly (a) implements an interface (if the named class is an interface) or (b) extends a subclass (if the named class is a class). The class must be concrete, so intermediate abstract classes are not returned, though any children of such abstract classes will be.

    WARNING: This method can chew up a lot of temporary heap space, if called with a large classpath.

    ancestor

    the name of the class for which to find descendent concrete subclasses

    classes

    the iterator of ClassInfo objects to search

    returns

    an iterator of ClassInfo objects that are concrete subclasses of ancestor. The iterator will be empty if no matching classes could be found.

  12. def concreteSubclasses(ancestor: String, classes: Iterator[ClassInfo]): Iterator[ClassInfo]

    Convenience method that scans the specified classes for all concrete classes that are subclasses of the named class.

    Convenience method that scans the specified classes for all concrete classes that are subclasses of the named class. A subclass, in this definition, is a class that directly or indirectly (a) implements an interface (if the named class is an interface) or (b) extends a subclass (if the named class is a class). The class must be concrete, so intermediate abstract classes are not returned, though any children of such abstract classes will be.

    WARNINGS

    This method converts the iterator to a map of classes, for easier lookup. Thus, upon its return, the iterator will be empty. You can certainly recreate the iterator, but at a cost. If you need to make multiple calls to this method with the same classpath, consider converting the iterator to a map first, as shown below:

    val finder = ClassFinder(myPath)
    val classes = finder.getClasses  // classes is an Iterator[ClassInfo]
    val classMap = ClassFinder.classInfoMap // runs the iterator out, once
    val foos = ClassFinder.concreteSubclasses("org.example.Foo", classMap)
    val bars = ClassFinder.concreteSubclasses("org.example.Bar", classMap)

    This method can chew up a lot of temporary heap space, if called with a large classpath.

    ancestor

    the name of the class for which to find descendent concrete subclasses

    classes

    the iterator of ClassInfo objects to search

    returns

    an iterator of ClassInfo objects that are concrete subclasses of ancestor. The iterator will be empty if no matching classes could be found.

  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any

Ungrouped