org.apache.jorphan.reflect

## Class ClassFinder

- java.lang.Object
- - org.apache.jorphan.reflect.ClassFinder

-     public final class ClassFinder
      extends java.lang.Object

  This class finds classes that extend one of a set of parent classes

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List<java.lang.String>` | `findAnnotatedClasses(java.lang.String[] strPathsOrJars, java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations)` Find classes in the provided path(s)/jar(s) that extend the class(es).
    `static java.util.List<java.lang.String>` | `findAnnotatedClasses(java.lang.String[] strPathsOrJars, java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations, boolean innerClasses)` Find classes in the provided path(s)/jar(s) that extend the class(es).
    `static java.util.List<java.lang.String>` | `findClasses(java.lang.String[] searchPathsOrJars, ClassFilter filter)` Find all classes in the given jars that passes the class filter.
    `static java.util.List<java.lang.String>` | `findClassesThatExtend(java.lang.String[] paths, java.lang.Class<?>[] superClasses)` Convenience method for `findClassesThatExtend(String[], Class[], boolean)` with the option to include inner classes in the search set to false.
    `static java.util.List<java.lang.String>` | `findClassesThatExtend(java.lang.String[] strPathsOrJars, java.lang.Class<?>[] superClasses, boolean innerClasses)` Find classes in the provided path(s)/jar(s) that extend the class(es).
    `static java.util.List<java.lang.String>` | `findClassesThatExtend(java.lang.String[] strPathsOrJars, java.lang.Class<?>[] superClasses, boolean innerClasses, java.lang.String contains, java.lang.String notContains)` Find classes in the provided path(s)/jar(s) that extend the class(es).
    `static java.util.List<java.lang.String>` | `findClassesThatExtend(java.lang.String[] searchPathsOrJars, java.lang.Class<?>[] classNames, boolean innerClasses, java.lang.String contains, java.lang.String notContains, boolean annotations)` Find classes in the provided path(s)/jar(s) that extend the class(es).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### findClassesThatExtend

          public static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] paths,
                                                                               java.lang.Class<?>[] superClasses)
                                                                        throws java.io.IOException

      Convenience method for `findClassesThatExtend(String[], Class[], boolean)` with the option to include inner classes in the search set to false.
      Parameters:
        `paths` - pathnames or jarfiles to search for classes
        `superClasses` - required parent class(es)
      Returns:
        List of Strings containing discovered class names.
      Throws:
        `java.io.IOException` - when scanning the classes fails

    - #### findClassesThatExtend

          public static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] strPathsOrJars,
                                                                               java.lang.Class<?>[] superClasses,
                                                                               boolean innerClasses)
                                                                        throws java.io.IOException

      Find classes in the provided path(s)/jar(s) that extend the class(es).
      Parameters:
        `strPathsOrJars` - pathnames or jarfiles to search for classes
        `superClasses` - required parent class(es)
        `innerClasses` - should we include inner classes?
      Returns:
        List containing discovered classes
      Throws:
        `java.io.IOException` - when scanning for classes fails

    - #### findClassesThatExtend

          public static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] strPathsOrJars,
                                                                               java.lang.Class<?>[] superClasses,
                                                                               boolean innerClasses,
                                                                               java.lang.String contains,
                                                                               java.lang.String notContains)
                                                                        throws java.io.IOException

      Find classes in the provided path(s)/jar(s) that extend the class(es).
      Parameters:
        `strPathsOrJars` - pathnames or jarfiles to search for classes
        `superClasses` - required parent class(es)
        `innerClasses` - should we include inner classes?
        `contains` - classname should contain this string
        `notContains` - classname should not contain this string
      Returns:
        List containing discovered classes
      Throws:
        `java.io.IOException` - when scanning classes fails

    - #### findAnnotatedClasses

          public static java.util.List<java.lang.String> findAnnotatedClasses(java.lang.String[] strPathsOrJars,
                                                                              java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations,
                                                                              boolean innerClasses)
                                                                       throws java.io.IOException

      Find classes in the provided path(s)/jar(s) that extend the class(es).
      Parameters:
        `strPathsOrJars` - pathnames or jarfiles to search for classes
        `annotations` - required annotations
        `innerClasses` - should we include inner classes?
      Returns:
        List containing discovered classes
      Throws:
        `java.io.IOException` - when scanning classes fails

    - #### findAnnotatedClasses

          public static java.util.List<java.lang.String> findAnnotatedClasses(java.lang.String[] strPathsOrJars,
                                                                              java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations)
                                                                       throws java.io.IOException

      Find classes in the provided path(s)/jar(s) that extend the class(es). Inner classes are not searched.
      Parameters:
        `strPathsOrJars` - pathnames or jarfiles to search for classes
        `annotations` - required annotations
      Returns:
        List containing discovered classes
      Throws:
        `java.io.IOException` - when scanning classes fails

    - #### findClassesThatExtend

          public static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] searchPathsOrJars,
                                                                               java.lang.Class<?>[] classNames,
                                                                               boolean innerClasses,
                                                                               java.lang.String contains,
                                                                               java.lang.String notContains,
                                                                               boolean annotations)
                                                                        throws java.io.IOException

      Find classes in the provided path(s)/jar(s) that extend the class(es).
      Parameters:
        `searchPathsOrJars` - pathnames or jarfiles to search for classes
        `classNames` - required parent class(es) or annotations
        `innerClasses` - should we include inner classes?
        `contains` - classname should contain this string
        `notContains` - classname should not contain this string
        `annotations` - true if classnames are annotations
      Returns:
        List containing discovered classes
      Throws:
        `java.io.IOException` - when scanning classes fails

    - #### findClasses

          public static java.util.List<java.lang.String> findClasses(java.lang.String[] searchPathsOrJars,
                                                                     ClassFilter filter)
                                                              throws java.io.IOException

      Find all classes in the given jars that passes the class filter.
      Parameters:
        `searchPathsOrJars` - list of strings representing the jar locations
        `filter` - `ClassFilter` that the classes in the jars should conform to
      Returns:
        list of all classes in the jars, that conform to `filter`
      Throws:
        `java.io.IOException` - when reading the jar files fails

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.