org.apache.avro.util

## Class ClassUtils

- java.lang.Object
- - org.apache.avro.util.ClassUtils

-     public class ClassUtils
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Class<?>` | `forName(Class<?> contextClass, String className)` Loads a class using the class loader.
    `static Class<?>` | `forName(ClassLoader classLoader, String className)` Loads a class using the class loader.
    `static Class<?>` | `forName(String className)` Loads a class using the class loader.

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

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

- - ### Method Detail

    - #### forName

          public static Class<?> forName(String className)
                                  throws ClassNotFoundException

      Loads a class using the class loader. 1. The class loader of the current class is being used. 2. The thread context class loader is being used. If both approaches fail, returns null.
      Parameters:
        `className` - The name of the class to load.
      Returns:
        The class or null if no class loader could load the class.
      Throws:
        `ClassNotFoundException`

    - #### forName

          public static Class<?> forName(Class<?> contextClass,
                                         String className)
                                  throws ClassNotFoundException

      Loads a class using the class loader. 1. The class loader of the context class is being used. 2. The thread context class loader is being used. If both approaches fail, returns null.
      Parameters:
        `contextClass` - The name of a context class to use.
        `className` - The name of the class to load
      Returns:
        The class or null if no class loader could load the class.
      Throws:
        `ClassNotFoundException`

    - #### forName

          public static Class<?> forName(ClassLoader classLoader,
                                         String className)
                                  throws ClassNotFoundException

      Loads a class using the class loader. 1. The class loader of the context class is being used. 2. The thread context class loader is being used. If both approaches fail, returns null.
      Parameters:
        `classLoader` - The classloader to use.
        `className` - The name of the class to load
      Returns:
        The class or null if no class loader could load the class.
      Throws:
        `ClassNotFoundException`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.