|
|||||||
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()
|
CompiledExpression |
compile(String query)
|
CompiledExpression |
compileAndCheck(String query)
|
void |
declareVariable(String qname,
Object initialValue)
Declare an external XPath variable and assign a value to it. |
void |
dump(CompiledExpression expression,
Writer writer)
|
void |
endProtected()
Close the protected environment. |
ResourceSet |
execute(CompiledExpression expression)
|
ResourceSet |
execute(Source source)
|
ResourceSet |
execute(XMLResource res,
CompiledExpression expression)
|
String |
getName()
|
String |
getNamespace(String prefix)
|
String |
getProperty(String property)
|
String |
getVersion()
|
ResourceSet |
query(String query)
|
ResourceSet |
query(String query,
String sortBy)
Process an XPath query and sort the results by applying a second XPath expression to each of the search results. |
ResourceSet |
query(XMLResource res,
String query)
Process an XPath query based on the result of a previous query. |
ResourceSet |
query(XMLResource res,
String query,
String sortBy)
Process an XPath query based on the result of a previous query and sort the results using the second XPath expression. |
ResourceSet |
queryResource(String resource,
String query)
|
void |
removeNamespace(String ns)
|
void |
setCollection(Collection col)
|
void |
setModuleLoadPath(String path)
|
void |
setNamespace(String prefix,
String namespace)
|
void |
setProperty(String property,
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 XMLDBException
clearNamespaces
in interface XPathQueryService
clearNamespaces
in interface XQueryService
XMLDBException
public String getName() throws XMLDBException
getName
in interface Service
XMLDBException
public String getNamespace(String prefix) throws XMLDBException
getNamespace
in interface XPathQueryService
getNamespace
in interface XQueryService
XMLDBException
public String getProperty(String property) throws XMLDBException
getProperty
in interface Configurable
XMLDBException
public String getVersion() throws XMLDBException
getVersion
in interface Service
XMLDBException
public ResourceSet query(String query) throws XMLDBException
query
in interface XPathQueryService
query
in interface XQueryService
XMLDBException
public ResourceSet query(XMLResource res, String query) throws XMLDBException
XPathQueryServiceImpl
query
in interface XPathQueryServiceImpl
res
- an XMLResource as obtained from a previous query.query
- the XPath query
XMLDBException
public ResourceSet query(String query, String sortBy) throws XMLDBException
XPathQueryServiceImpl
query
in interface XPathQueryServiceImpl
query
- the XPath querysortBy
- another XPath expression, which is executed relative to the
results of the primary expression.
XMLDBException
public ResourceSet query(XMLResource res, String query, String sortBy) throws 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.
XMLDBException
public ResourceSet execute(CompiledExpression expression) throws XMLDBException
execute
in interface XQueryService
XMLDBException
public ResourceSet execute(XMLResource res, CompiledExpression expression) throws XMLDBException
XMLDBException
public ResourceSet execute(Source source) throws XMLDBException
XMLDBException
public CompiledExpression compile(String query) throws XMLDBException
compile
in interface XQueryService
XMLDBException
public CompiledExpression compileAndCheck(String query) throws XMLDBException, XPathException
XMLDBException
XPathException
public ResourceSet queryResource(String resource, String query) throws XMLDBException
queryResource
in interface XPathQueryService
queryResource
in interface XQueryService
XMLDBException
public void beginProtected() throws XMLDBException
endProtected()
is called.
beginProtected
in interface XPathQueryServiceImpl
XMLDBException
public void endProtected()
endProtected
in interface XPathQueryServiceImpl
public void removeNamespace(String ns) throws XMLDBException
removeNamespace
in interface XPathQueryService
removeNamespace
in interface XQueryService
XMLDBException
public void setCollection(Collection col) throws XMLDBException
setCollection
in interface Service
XMLDBException
public void setNamespace(String prefix, String namespace) throws XMLDBException
setNamespace
in interface XPathQueryService
setNamespace
in interface XQueryService
XMLDBException
public void setProperty(String property, String value) throws XMLDBException
setProperty
in interface Configurable
XMLDBException
public void declareVariable(String qname, Object initialValue) throws 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 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
XMLDBException
public void setXPathCompatibility(boolean backwardsCompatible)
setXPathCompatibility
in interface XQueryService
public void setModuleLoadPath(String path)
setModuleLoadPath
in interface XQueryService
public void dump(CompiledExpression expression, Writer writer) throws XMLDBException
XMLDBException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |