public final class QueryResources extends Object
Modifier and Type | Field and Description |
---|---|
ValueBuilder |
output
Pending output.
|
HashMap<String,String[]> |
texts
Textual resources.
|
Modifier and Type | Method and Description |
---|---|
void |
add(QueryResource ext)
Adds an external resource.
|
void |
addCollection(String name,
String[] paths,
IO baseIO)
Adds a collection with the specified paths.
|
void |
addDoc(String name,
String path,
IO baseIO)
Adds a document with the specified path.
|
void |
addResource(String uri,
String... strings)
Adds a resource with the specified path.
|
static IO |
checkPath(QueryInput input,
IO baseIO,
InputInfo info)
Returns a valid reference if a file is found in the specified path or the static base uri.
|
Value |
collection(InputInfo info)
Returns the default collection.
|
Value |
collection(QueryInput qi,
IO baseIO,
InputInfo info)
Evaluates
fn:collection() : opens an existing database collection, or creates
a new data reference. |
Data |
database(String name,
InputInfo info)
Opens a new database or returns a reference to an already opened database.
|
DBNode |
doc(QueryInput qi,
IO baseIO,
InputInfo info)
Evaluates
fn:doc() : opens an existing database document, or creates a new
database and node. |
<R extends QueryResource> |
get(Class<? extends R> resource)
Returns an external resource of the specified class.
|
ModuleLoader |
modules()
Returns the module loader.
|
void |
remove(String name)
Removes and closes a database if it has not been added by the global context.
|
Updates |
updates()
Returns a reference to the updates.
|
public final ValueBuilder output
public void add(QueryResource ext)
ext
- external resourcepublic <R extends QueryResource> R get(Class<? extends R> resource)
R
- resourceresource
- external resourcepublic Data database(String name, InputInfo info) throws QueryException
name
- name of databaseinfo
- input infoQueryException
- query exceptionpublic DBNode doc(QueryInput qi, IO baseIO, InputInfo info) throws QueryException
fn:doc()
: opens an existing database document, or creates a new
database and node.qi
- query inputbaseIO
- base URIinfo
- input infoQueryException
- query exceptionpublic Value collection(InputInfo info) throws QueryException
info
- input infoQueryException
- query exceptionpublic Value collection(QueryInput qi, IO baseIO, InputInfo info) throws QueryException
fn:collection()
: opens an existing database collection, or creates
a new data reference.qi
- query inputbaseIO
- base URIinfo
- input infoQueryException
- query exceptionpublic Updates updates()
public ModuleLoader modules()
public void remove(String name)
name
- name of database to be removedpublic static IO checkPath(QueryInput input, IO baseIO, InputInfo info) throws QueryException
input
- query inputbaseIO
- base IOinfo
- input infoQueryException
- query exceptionpublic void addDoc(String name, String path, IO baseIO) throws QueryException
name
- document identifier (may be null
)path
- documents pathbaseIO
- base URIQueryException
- query exceptionpublic void addResource(String uri, String... strings)
uri
- resource uristrings
- resource strings (path, encoding)public void addCollection(String name, String[] paths, IO baseIO) throws QueryException
name
- name of collectionpaths
- documents pathsbaseIO
- base URIQueryException
- query exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.