Package net.sf.saxon.lib
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
Modifier and TypeMethodDescriptionClass
<?> getClass
(String className, Logger traceOut, ClassLoader classLoader) Load a class using the class name provided.getInstance
(String className, ClassLoader classLoader) Instantiate a class using the class name provided.getInstance
(String className, Logger traceOut, 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.getResourceAsStream
(String name) Get a resource from a supplied URI using the classpath URI scheme.void
setClassLoader
(ClassLoader classLoader) Set the ClassLoader to be used
-
Method Details
-
setClassLoader
Set the ClassLoader to be used- Parameters:
classLoader
- the ClassLoader to be used
-
getClass
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 nullclassLoader
- 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
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
Object getInstance(String className, Logger traceOut, 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 nullclassLoader
- 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
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
-