Interface ClassUtils

  • All Superinterfaces:
    Utils

    public interface ClassUtils
    extends Utils
    The utilities class for Class
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    Class
    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static java.lang.String getClassName​(javax.lang.model.type.TypeMirror type)
      Returns the fully qualified name of the class represented by the given TypeMirror.
      static java.lang.Class loadClass​(java.lang.String className)
      Loads the class represented by the given fully qualified class name.
      static java.lang.Class loadClass​(javax.lang.model.type.TypeMirror type)
      Loads the class represented by the given TypeMirror.
    • Method Detail

      • getClassName

        static java.lang.String getClassName​(javax.lang.model.type.TypeMirror type)
        Returns the fully qualified name of the class represented by the given TypeMirror.
        Parameters:
        type - the type mirror to get the class name from
        Returns:
        the fully qualified class name
      • loadClass

        static java.lang.Class loadClass​(javax.lang.model.type.TypeMirror type)
        Loads the class represented by the given TypeMirror.

        This method attempts to resolve the class using the fully qualified name derived from the type mirror. If the class cannot be resolved directly, an attempt is made to resolve it as a nested or inner class by replacing the last dot (.) with a dollar sign ($).

        Parameters:
        type - the type mirror representing the class to load
        Returns:
        the resolved Class, or null if the class cannot be found
      • loadClass

        static java.lang.Class loadClass​(java.lang.String className)
        Loads the class represented by the given fully qualified class name.

        This method attempts to resolve the class using the provided class name and the class loader obtained from ClassUtils. If the class is not found, an attempt is made to resolve it as a nested or inner class by replacing the last dot (.) with a dollar sign ($).

        Parameters:
        className - the fully qualified name of the class to load
        Returns:
        the resolved Class, or null if the class cannot be found