Class Classpath


  • @Internal
    public class Classpath
    extends java.lang.Object
    Classpath related utilities.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.lang.Class<? extends T> findClass​(java.lang.String name, java.lang.Class<T> superClass)
      Find given class.
      static <T> T newInstance​(java.lang.Class<T> cls)
      Create new instance of given class
      static <T> T newInstance​(java.lang.String name, java.lang.Class<T> superClass)
      Create new instance of given class
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • findClass

        public static <T> java.lang.Class<? extends T> findClass​(java.lang.String name,
                                                                 java.lang.Class<T> superClass)
        Find given class. Try hard to find it replacing `.' by `$' if appropriate.
        Type Parameters:
        T - type of the superclass
        Parameters:
        name - class name to search for
        superClass - class or interface the found class should extend
        Returns:
        class object of the found class
      • newInstance

        public static <T> T newInstance​(java.lang.Class<T> cls)
        Create new instance of given class
        Type Parameters:
        T - type of the superclass
        Parameters:
        cls - name of class
        Returns:
        instance of requested class
      • newInstance

        public static <T> T newInstance​(java.lang.String name,
                                        java.lang.Class<T> superClass)
        Create new instance of given class
        Type Parameters:
        T - type of the superclass
        Parameters:
        name - name of class
        superClass - class or interface the found class should extend
        Returns:
        instance of requested class