Interface IDynamicLoader

  • All Known Implementing Classes:
    DynamicLoader, DynamicLoaderEE, DynamicLoaderPE

    public interface IDynamicLoader
    Interface to a class used to perform dynamic loading of classes such as user-hook implementations, as well as product-supplied resources like stylesheets and DTDs.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Class<?> getClass​(java.lang.String className, Logger traceOut, java.lang.ClassLoader classLoader)
      Load a class using the class name provided.
      java.lang.Object getInstance​(java.lang.String className, java.lang.ClassLoader classLoader)
      Instantiate a class using the class name provided.
      java.lang.Object getInstance​(java.lang.String className, Logger traceOut, java.lang.ClassLoader classLoader)
      Instantiate a class using the class name provided, with the option of tracing Note that the method does not check that the object is of the right class.
      java.io.InputStream getResourceAsStream​(java.lang.String name)
      Get a resource from a supplied URI using the classpath URI scheme.
      void setClassLoader​(java.lang.ClassLoader classLoader)
      Set the ClassLoader to be used
    • Method Detail

      • setClassLoader

        void setClassLoader​(java.lang.ClassLoader classLoader)
        Set the ClassLoader to be used
        Parameters:
        classLoader - the ClassLoader to be used
      • getClass

        java.lang.Class<?> getClass​(java.lang.String className,
                                    Logger traceOut,
                                    java.lang.ClassLoader classLoader)
                             throws XPathException
        Load a class using the class name provided. Note that the method does not check that the object is of the right class.

        This method is intended for internal use only.

        Parameters:
        className - A string containing the name of the class, for example "com.microstar.sax.LarkDriver"
        traceOut - if diagnostic tracing is required, the destination for the output; otherwise null
        classLoader - The ClassLoader to be used to load the class. If this is null, then the implementation uses its own class loader.
        Returns:
        an instance of the class named, or null if it is not loadable.
        Throws:
        XPathException - if the class cannot be loaded.
      • getInstance

        java.lang.Object getInstance​(java.lang.String className,
                                     java.lang.ClassLoader classLoader)
                              throws XPathException
        Instantiate a class using the class name provided. Note that the method does not check that the object is of the right class.

        This method is intended for internal use only.

        Parameters:
        className - A string containing the name of the class, for example "com.microstar.sax.LarkDriver"
        classLoader - The ClassLoader to be used to load the class. If this is null, then the implementation uses its own class loader.
        Returns:
        an instance of the class named, or null if it is not loadable.
        Throws:
        XPathException - if the class cannot be loaded.
      • getInstance

        java.lang.Object getInstance​(java.lang.String className,
                                     Logger traceOut,
                                     java.lang.ClassLoader classLoader)
                              throws XPathException
        Instantiate a class using the class name provided, with the option of tracing Note that the method does not check that the object is of the right class.

        This method is intended for internal use only.

        Parameters:
        className - A string containing the name of the class, for example "com.microstar.sax.LarkDriver"
        traceOut - if attempts to load classes are to be traced, then the destination for the trace output; otherwise null
        classLoader - The ClassLoader to be used to load the class. If this is null, then the implementation uses its own choice of ClassLoader
        Returns:
        an instance of the class named, or null if it is not loadable.
        Throws:
        XPathException - if the class cannot be loaded.
      • getResourceAsStream

        java.io.InputStream getResourceAsStream​(java.lang.String name)
        Get a resource from a supplied URI using the classpath URI scheme.
        Parameters:
        name - the path name from the URI
        Returns:
        the content of the relevant resource