|
|||||||
| 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 XPathQueryServiceclearNamespaces in interface XQueryServiceXMLDBException
public String getName()
throws XMLDBException
getName in interface ServiceXMLDBException
public String getNamespace(String prefix)
throws XMLDBException
getNamespace in interface XPathQueryServicegetNamespace in interface XQueryServiceXMLDBException
public String getProperty(String property)
throws XMLDBException
getProperty in interface ConfigurableXMLDBException
public String getVersion()
throws XMLDBException
getVersion in interface ServiceXMLDBException
public ResourceSet query(String query)
throws XMLDBException
query in interface XPathQueryServicequery in interface XQueryServiceXMLDBException
public ResourceSet query(XMLResource res,
String query)
throws XMLDBException
XPathQueryServiceImpl
query in interface XPathQueryServiceImplres - 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 XPathQueryServiceImplquery - 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 XPathQueryServiceImplres - 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 XQueryServiceXMLDBException
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 XQueryServiceXMLDBException
public CompiledExpression compileAndCheck(String query)
throws XMLDBException,
XPathException
XMLDBException
XPathException
public ResourceSet queryResource(String resource,
String query)
throws XMLDBException
queryResource in interface XPathQueryServicequeryResource in interface XQueryServiceXMLDBException
public void beginProtected()
throws XMLDBException
endProtected() is called.
beginProtected in interface XPathQueryServiceImplXMLDBExceptionpublic void endProtected()
endProtected in interface XPathQueryServiceImpl
public void removeNamespace(String ns)
throws XMLDBException
removeNamespace in interface XPathQueryServiceremoveNamespace in interface XQueryServiceXMLDBException
public void setCollection(Collection col)
throws XMLDBException
setCollection in interface ServiceXMLDBException
public void setNamespace(String prefix,
String namespace)
throws XMLDBException
setNamespace in interface XPathQueryServicesetNamespace in interface XQueryServiceXMLDBException
public void setProperty(String property,
String value)
throws XMLDBException
setProperty in interface ConfigurableXMLDBException
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 XPathQueryServiceImpldeclareVariable in interface XQueryServiceqname - 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
XMLDBExceptionpublic void setXPathCompatibility(boolean backwardsCompatible)
setXPathCompatibility in interface XQueryServicepublic 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 | ||||||