|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.api.xmldb.BXQueryService
public final class BXQueryService
Abstract QueryService definition for the XMLDB:API.
Field Summary |
---|
Fields inherited from interface org.basex.api.xmldb.BXXMLDBText |
---|
CONFORMANCE_LEVEL, DBURI, ERR_BINARY, ERR_CONT, ERR_DOC, ERR_EMPTY, ERR_ID, ERR_INV, ERR_ITER, ERR_NSURI, ERR_PROP, ERR_RES, ERR_TYPE, ERR_UNKNOWN, ERR_URI, LOCALHOST, XMLDB, XMLDBURI |
Constructor Summary | |
---|---|
BXQueryService(BXCollection c,
java.lang.String n,
java.lang.String v)
Standard constructor. |
Method Summary | |
---|---|
void |
clearNamespaces()
Removes all namespace mappings stored in the internal namespace map. |
java.lang.String |
getName()
Returns the name associated with the Service instance. |
java.lang.String |
getNamespace(java.lang.String pre)
Returns the URI string associated with prefix from
the internal namespace map. |
java.lang.String |
getProperty(java.lang.String nm)
Returns the value of the property identified by name . |
java.lang.String |
getVersion()
Gets the Version attribute of the Service object |
ResourceSet |
query(java.lang.String query)
Run an XPath query against the Collection . |
ResourceSet |
queryResource(java.lang.String id,
java.lang.String query)
Run an XPath query against an XML resource stored in the Collection associated with this service. |
void |
removeNamespace(java.lang.String pre)
Removes the namespace mapping associated with prefix from
the internal namespace map. |
void |
setCollection(Collection col)
Sets the Collection attribute of the Service object |
void |
setNamespace(java.lang.String pre,
java.lang.String uri)
Sets a namespace mapping in the internal namespace map used to evaluate queries. |
void |
setProperty(java.lang.String nm,
java.lang.String value)
Sets the property name to have the value provided in
value . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BXQueryService(BXCollection c, java.lang.String n, java.lang.String v)
c
- for collection referencen
- service namev
- versionMethod Detail |
---|
public void setNamespace(java.lang.String pre, java.lang.String uri) throws XMLDBException
XPathQueryService
prefix
is null or empty the default namespace is
associated with the provided URI. A null or empty uri
results
in an exception being thrown.
setNamespace
in interface XPathQueryService
pre
- The prefix to set in the map. If
prefix
is empty or null the
default namespace will be associated with the provided URI.uri
- The URI for the namespace to be associated with prefix.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public java.lang.String getNamespace(java.lang.String pre)
XPathQueryService
prefix
from
the internal namespace map. If prefix
is null or empty the
URI for the default namespace will be returned. If a mapping for the
prefix
can not be found null is returned.
getNamespace
in interface XPathQueryService
pre
- The prefix to retrieve from the namespace map.
prefix
public void removeNamespace(java.lang.String pre)
XPathQueryService
prefix
from
the internal namespace map. If prefix
is null or empty the
mapping for the default namespace will be removed.
removeNamespace
in interface XPathQueryService
pre
- The prefix to remove from the namespace map. If
prefix
is null or empty the mapping for the default
namespace will be removed.public void clearNamespaces()
XPathQueryService
clearNamespaces
in interface XPathQueryService
public ResourceSet query(java.lang.String query) throws XMLDBException
XPathQueryService
Collection
. The XPath will be
applied to all XML resources stored in the Collection
.
The result is a
ResourceSet
containing the results of the query. Any
namespaces used in the query
string will be evaluated using
the mappings setup using setNamespace
.
query
in interface XPathQueryService
query
- The XPath query string to use.
ResourceSet
containing the results of the query.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public ResourceSet queryResource(java.lang.String id, java.lang.String query) throws XMLDBException
XPathQueryService
Collection
associated with this service. The result is a
ResourceSet
containing the results of the query. Any
namespaces used in the query
string will be evaluated using
the mappings setup using setNamespace
.
queryResource
in interface XPathQueryService
id
- The id of the document to run the query against.query
- The XPath query string to use.
ResourceSet
containing the results of the query.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public java.lang.String getName()
Service
getName
in interface Service
public java.lang.String getVersion()
Service
getVersion
in interface Service
public void setCollection(Collection col)
Service
setCollection
in interface Service
col
- The new Collection valuepublic java.lang.String getProperty(java.lang.String nm)
Configurable
name
.
getProperty
in interface Configurable
nm
- the name of the property to retrieve.
public void setProperty(java.lang.String nm, java.lang.String value) throws XMLDBException
Configurable
name
to have the value provided in
value
.
setProperty
in interface Configurable
nm
- the name of the property to set.value
- the value to set for the property.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |