Package mondrian.util

Interface ClassResolver

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> java.lang.Class<T> forName​(java.lang.String className, boolean initialize)
      Equivalent of Class.forName(String, boolean, ClassLoader).
      java.lang.Iterable<java.net.URL> getResources​(java.lang.String lookupName)
      Equivalent of ClassLoader.getResources(String).
      <T> T instantiateSafe​(java.lang.String className, java.lang.Object... args)
      Instantiates a class and constructs an instance using the given arguments.
    • Field Detail

      • INSTANCE

        static final ClassResolver INSTANCE
        Default resolver.
    • Method Detail

      • forName

        <T> java.lang.Class<T> forName​(java.lang.String className,
                                       boolean initialize)
                                throws java.lang.ClassNotFoundException
        Equivalent of Class.forName(String, boolean, ClassLoader).
        Throws:
        java.lang.ClassNotFoundException
      • instantiateSafe

        <T> T instantiateSafe​(java.lang.String className,
                              java.lang.Object... args)
        Instantiates a class and constructs an instance using the given arguments.
        Type Parameters:
        T - Desired type
        Parameters:
        className - Class name
        args - Arguments
        Throws:
        java.lang.ClassCastException - if resulting object is not an instance of T
      • getResources

        java.lang.Iterable<java.net.URL> getResources​(java.lang.String lookupName)
                                               throws java.io.IOException
        Equivalent of ClassLoader.getResources(String).
        Throws:
        java.io.IOException