|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xmldb.LocalXPathQueryService
public class LocalXPathQueryService
Constructor Summary | |
---|---|
LocalXPathQueryService(User user,
BrokerPool pool,
LocalCollection collection,
AccessContext accessCtx)
|
Method Summary | |
---|---|
void |
beginProtected()
Execute all following queries in a protected environment. |
void |
clearNamespaces()
|
org.xmldb.api.base.CompiledExpression |
compile(java.lang.String query)
|
org.xmldb.api.base.CompiledExpression |
compileAndCheck(java.lang.String query)
|
void |
declareVariable(java.lang.String qname,
java.lang.Object initialValue)
Declare an external XPath variable and assign a value to it. |
void |
dump(org.xmldb.api.base.CompiledExpression expression,
java.io.Writer writer)
|
void |
endProtected()
Close the protected environment. |
org.xmldb.api.base.ResourceSet |
execute(org.xmldb.api.base.CompiledExpression expression)
|
org.xmldb.api.base.ResourceSet |
execute(Source source)
|
org.xmldb.api.base.ResourceSet |
execute(org.xmldb.api.modules.XMLResource res,
org.xmldb.api.base.CompiledExpression expression)
|
java.lang.String |
getName()
|
java.lang.String |
getNamespace(java.lang.String prefix)
|
java.lang.String |
getProperty(java.lang.String property)
|
java.lang.String |
getVersion()
|
org.xmldb.api.base.ResourceSet |
query(java.lang.String query)
|
org.xmldb.api.base.ResourceSet |
query(java.lang.String query,
java.lang.String sortBy)
Process an XPath query and sort the results by applying a second XPath expression to each of the search results. |
org.xmldb.api.base.ResourceSet |
query(org.xmldb.api.modules.XMLResource res,
java.lang.String query)
Process an XPath query based on the result of a previous query. |
org.xmldb.api.base.ResourceSet |
query(org.xmldb.api.modules.XMLResource res,
java.lang.String query,
java.lang.String sortBy)
Process an XPath query based on the result of a previous query and sort the results using the second XPath expression. |
org.xmldb.api.base.ResourceSet |
queryResource(java.lang.String resource,
java.lang.String query)
|
void |
removeNamespace(java.lang.String ns)
|
void |
setCollection(org.xmldb.api.base.Collection col)
|
void |
setModuleLoadPath(java.lang.String path)
|
void |
setNamespace(java.lang.String prefix,
java.lang.String namespace)
|
void |
setProperty(java.lang.String property,
java.lang.String value)
|
void |
setXPathCompatibility(boolean backwardsCompatible)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalXPathQueryService(User user, BrokerPool pool, LocalCollection collection, AccessContext accessCtx)
Method Detail |
---|
public void clearNamespaces() throws org.xmldb.api.base.XMLDBException
clearNamespaces
in interface org.xmldb.api.modules.XPathQueryService
clearNamespaces
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public java.lang.String getName() throws org.xmldb.api.base.XMLDBException
getName
in interface org.xmldb.api.base.Service
org.xmldb.api.base.XMLDBException
public java.lang.String getNamespace(java.lang.String prefix) throws org.xmldb.api.base.XMLDBException
getNamespace
in interface org.xmldb.api.modules.XPathQueryService
getNamespace
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public java.lang.String getProperty(java.lang.String property) throws org.xmldb.api.base.XMLDBException
getProperty
in interface org.xmldb.api.base.Configurable
org.xmldb.api.base.XMLDBException
public java.lang.String getVersion() throws org.xmldb.api.base.XMLDBException
getVersion
in interface org.xmldb.api.base.Service
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.ResourceSet query(java.lang.String query) throws org.xmldb.api.base.XMLDBException
query
in interface org.xmldb.api.modules.XPathQueryService
query
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.ResourceSet query(org.xmldb.api.modules.XMLResource res, java.lang.String query) throws org.xmldb.api.base.XMLDBException
XPathQueryServiceImpl
query
in interface XPathQueryServiceImpl
res
- an XMLResource as obtained from a previous query.query
- the XPath query
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.ResourceSet query(java.lang.String query, java.lang.String sortBy) throws org.xmldb.api.base.XMLDBException
XPathQueryServiceImpl
query
in interface XPathQueryServiceImpl
query
- the XPath querysortBy
- another XPath expression, which is executed relative to the
results of the primary expression.
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.ResourceSet query(org.xmldb.api.modules.XMLResource res, java.lang.String query, java.lang.String sortBy) throws org.xmldb.api.base.XMLDBException
XPathQueryServiceImpl
query
in interface XPathQueryServiceImpl
res
- an XMLResource as obtained from a previous queryquery
- the XPath querysortBy
- another XPath expression, which is executed relative to
the results of the primary expression. The result of applying sortExpr is converted
to a string value, which is then used to sort the results.
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.ResourceSet execute(org.xmldb.api.base.CompiledExpression expression) throws org.xmldb.api.base.XMLDBException
execute
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.ResourceSet execute(org.xmldb.api.modules.XMLResource res, org.xmldb.api.base.CompiledExpression expression) throws org.xmldb.api.base.XMLDBException
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.ResourceSet execute(Source source) throws org.xmldb.api.base.XMLDBException
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.CompiledExpression compile(java.lang.String query) throws org.xmldb.api.base.XMLDBException
compile
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public org.xmldb.api.base.CompiledExpression compileAndCheck(java.lang.String query) throws org.xmldb.api.base.XMLDBException, XPathException
org.xmldb.api.base.XMLDBException
XPathException
public org.xmldb.api.base.ResourceSet queryResource(java.lang.String resource, java.lang.String query) throws org.xmldb.api.base.XMLDBException
queryResource
in interface org.xmldb.api.modules.XPathQueryService
queryResource
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public void beginProtected()
endProtected()
is called.
beginProtected
in interface XPathQueryServiceImpl
public void endProtected()
endProtected
in interface XPathQueryServiceImpl
public void removeNamespace(java.lang.String ns) throws org.xmldb.api.base.XMLDBException
removeNamespace
in interface org.xmldb.api.modules.XPathQueryService
removeNamespace
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public void setCollection(org.xmldb.api.base.Collection col) throws org.xmldb.api.base.XMLDBException
setCollection
in interface org.xmldb.api.base.Service
org.xmldb.api.base.XMLDBException
public void setNamespace(java.lang.String prefix, java.lang.String namespace) throws org.xmldb.api.base.XMLDBException
setNamespace
in interface org.xmldb.api.modules.XPathQueryService
setNamespace
in interface org.xmldb.api.modules.XQueryService
org.xmldb.api.base.XMLDBException
public void setProperty(java.lang.String property, java.lang.String value) throws org.xmldb.api.base.XMLDBException
setProperty
in interface org.xmldb.api.base.Configurable
org.xmldb.api.base.XMLDBException
public void declareVariable(java.lang.String qname, java.lang.Object initialValue) throws org.xmldb.api.base.XMLDBException
XPathQueryServiceImpl
declareVariable("name", "HAMLET");you may use the variable in an XPath expression as follows:
//SPEECH[SPEAKER=$name]Any Java object may be passed as initial value. The query engine will try to map this into a corresponding XPath value. You may also pass an XMLResource as obtained from another XPath expression. This will be converted into a node.
declareVariable
in interface XPathQueryServiceImpl
declareVariable
in interface org.xmldb.api.modules.XQueryService
qname
- a valid QName by which the variable is identified. Any
prefix should have been mapped to a namespace, i.e. if a variable is called
x:name, there should be a prefix/namespace mapping for the prefix
xinitialValue
- the initial value, which is assigned to the variable
org.xmldb.api.base.XMLDBException
public void setXPathCompatibility(boolean backwardsCompatible)
setXPathCompatibility
in interface org.xmldb.api.modules.XQueryService
public void setModuleLoadPath(java.lang.String path)
setModuleLoadPath
in interface org.xmldb.api.modules.XQueryService
public void dump(org.xmldb.api.base.CompiledExpression expression, java.io.Writer writer) throws org.xmldb.api.base.XMLDBException
org.xmldb.api.base.XMLDBException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |