Package tigase.util

## Class ClassUtil

- java.lang.Object
- - tigase.util.ClassUtil

-     public class ClassUtil
      extends java.lang.Object

  `ClassUtil` file contains code used for loading all implementations of specified interface or abstract class found in classpath. As a result of calling some functions you can have `Set` containing all required classes.

  Created: Wed Oct 6 08:25:52 2004

  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ClassUtil()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static java.util.Set<java.lang.Class<?>>` | `getClassesFromClassPath()` |
    `static java.util.Set<java.lang.Class<?>>` | `getClassesFromClassPath​(java.util.function.Predicate<java.lang.String> classNamesFilter)` |
    `static java.util.Set<java.lang.Class<?>>` | `getClassesFromNames​(java.util.Set<java.lang.String> names)` |
    `static java.util.Set<java.lang.Class<?>>` | `getClassesFromNames​(java.util.Set<java.lang.String> names, java.util.function.Predicate<java.lang.String> filter)` |
    `static <T extends java.lang.Class> java.util.Set<T>` | `getClassesImplementing​(java.util.Collection<java.lang.Class<?>> classes, T cls)` |
    `static <T extends java.lang.Class> java.util.Set<T>` | `getClassesImplementing​(T cls)` |
    `static java.lang.String` | `getClassNameFromFileName​(java.lang.String fileName)` |
    `static java.util.Set<java.lang.String>` | `getClassNamesFromDir​(java.io.File dir)` |
    `static java.util.Set<java.lang.String>` | `getClassNamesFromJar​(java.io.File jarFile)` |
    `static java.util.Set<java.lang.String>` | `getFileListDeep​(java.io.File path)` |
    `static <T> java.util.Set<T>` | `getImplementations​(java.lang.Class<T> obj)` |
    `static void` | `walkInDirForFiles​(java.io.File base_dir, java.lang.String path, java.util.Set<java.lang.String> set)` |

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

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

- - ### Constructor Detail

    - #### ClassUtil

          public ClassUtil()

  - ### Method Detail

    - #### getClassNameFromFileName

          public static java.lang.String getClassNameFromFileName​(java.lang.String fileName)

    - #### getClassNamesFromDir

          public static java.util.Set<java.lang.String> getClassNamesFromDir​(java.io.File dir)

    - #### getClassNamesFromJar

          public static java.util.Set<java.lang.String> getClassNamesFromJar​(java.io.File jarFile)
                                                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getClassesFromClassPath

          public static java.util.Set<java.lang.Class<?>> getClassesFromClassPath()
                                                                           throws java.io.IOException,
                                                                                  java.lang.ClassNotFoundException

      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`

    - #### getClassesFromClassPath

          public static java.util.Set<java.lang.Class<?>> getClassesFromClassPath​(java.util.function.Predicate<java.lang.String> classNamesFilter)
                                                                           throws java.io.IOException,
                                                                                  java.lang.ClassNotFoundException

      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`

    - #### getClassesFromNames

          public static java.util.Set<java.lang.Class<?>> getClassesFromNames​(java.util.Set<java.lang.String> names)
                                                                       throws java.lang.ClassNotFoundException

      Throws:
        `java.lang.ClassNotFoundException`

    - #### getClassesFromNames

          public static java.util.Set<java.lang.Class<?>> getClassesFromNames​(java.util.Set<java.lang.String> names,
                                                                              java.util.function.Predicate<java.lang.String> filter)
                                                                       throws java.lang.ClassNotFoundException

      Throws:
        `java.lang.ClassNotFoundException`

    - #### getClassesImplementing

          public static <T extends java.lang.Class> java.util.Set<T> getClassesImplementing​(java.util.Collection<java.lang.Class<?>> classes,
                                                                                            T cls)

    - #### getClassesImplementing

          public static <T extends java.lang.Class> java.util.Set<T> getClassesImplementing​(T cls)
                                                                                     throws java.io.IOException,
                                                                                            java.lang.ClassNotFoundException

      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`

    - #### getFileListDeep

          public static java.util.Set<java.lang.String> getFileListDeep​(java.io.File path)

    - #### getImplementations

          public static <T> java.util.Set<T> getImplementations​(java.lang.Class<T> obj)
                                                         throws java.io.IOException,
                                                                java.lang.ClassNotFoundException,
                                                                java.lang.InstantiationException,
                                                                java.lang.IllegalAccessException

      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`
        `java.lang.InstantiationException`
        `java.lang.IllegalAccessException`

    - #### walkInDirForFiles

          public static void walkInDirForFiles​(java.io.File base_dir,
                                               java.lang.String path,
                                               java.util.Set<java.lang.String> set)