public final class ModuleLoader extends Object
Constructor and Description |
---|
ModuleLoader(Context context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addImport(byte[] uri,
InputInfo ii,
QueryParser qp)
Adds a package from the repository or a Java class.
|
static String |
capitalize(String path)
Capitalizes the last path segment.
|
void |
close()
Closes opened jar files, and calls close method of
QueryModule instances
implementing QueryResource . |
Class<?> |
findClass(String name)
Returns a reference to the specified class.
|
Object |
findImport(String clz)
Returns an instance of the specified Java module class.
|
static String |
uri2path(String uri)
Converts a URI to a directory path.
|
public ModuleLoader(Context context)
context
- database contextpublic void close()
QueryModule
instances
implementing QueryResource
.public boolean addImport(byte[] uri, InputInfo ii, QueryParser qp) throws QueryException
uri
- module uriii
- input infoqp
- query parserQueryException
- query exceptionpublic Class<?> findClass(String name) throws Throwable
name
- fully classified class namenull
Throwable
- any exception or error: ClassNotFoundException
,
LinkageError
or ExceptionInInitializerError
.public Object findImport(String clz)
clz
- class to be foundnull
public static String uri2path(String uri)
Converts a URI to a directory path. The conversion is inspired by Zorba's URI transformation (http://www.zorba-xquery.com/html/documentation/2.2.0/zorba/uriresolvers):
null
is returned if the URI has an invalid syntax.uri
- namespace urinull
Copyright © 2005–2015 BaseX Team. All rights reserved.