|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xmldb.RemoteXPathQueryService
public class RemoteXPathQueryService
Field Summary |
---|
Fields inherited from interface org.xmldb.api.modules.XPathQueryService |
---|
SERVICE_NAME |
Fields inherited from interface org.xmldb.api.modules.XQueryService |
---|
SERVICE_NAME |
Constructor Summary | |
---|---|
RemoteXPathQueryService(RemoteCollection collection)
Creates a new RemoteXPathQueryService instance. |
Method Summary | |
---|---|
void |
beginProtected()
Execute all following queries in a protected environment. |
void |
clearNamespaces()
The method clearNamespaces |
CompiledExpression |
compile(String query)
The method compile |
CompiledExpression |
compileAndCheck(String query)
The method compileAndCheck |
void |
declareVariable(String qname,
Object initialValue)
Declare an external XPath variable and assign a value to it. |
void |
dump(CompiledExpression expression,
Writer writer)
Return a diagnostic dump of the query. |
void |
endProtected()
Close the protected environment. |
ResourceSet |
execute(CompiledExpression expression)
Execute a compiled XQuery. |
ResourceSet |
execute(Source source)
|
ResourceSet |
execute(XMLResource res,
CompiledExpression expression)
|
String |
getName()
The method getName |
String |
getNamespace(String prefix)
The method getNamespace |
String |
getProperty(String property)
The method getProperty |
String |
getVersion()
The method getVersion |
ResourceSet |
query(String query)
The method query |
ResourceSet |
query(String query,
String sortExpr)
The method query |
ResourceSet |
query(XMLResource res,
String query)
The method query |
ResourceSet |
query(XMLResource res,
String query,
String sortExpr)
The method query |
ResourceSet |
queryResource(String resource,
String query)
The method queryResource |
void |
removeNamespace(String ns)
The method removeNamespace |
void |
setCollection(Collection col)
The method setCollection |
void |
setModuleLoadPath(String path)
Calling this method has no effect. |
void |
setNamespace(String prefix,
String namespace)
The method setNamespace |
void |
setProperty(String property,
String value)
The method setProperty |
void |
setXPathCompatibility(boolean backwardsCompatible)
Enable or disable XPath 1.0 compatibility mode. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemoteXPathQueryService(RemoteCollection collection)
RemoteXPathQueryService
instance.
collection
- a RemoteCollection
valueMethod Detail |
---|
public ResourceSet query(String query) throws XMLDBException
query
query
in interface XPathQueryService
query
in interface XQueryService
query
- a String
value
ResourceSet
value
XMLDBException
- if an error occurspublic ResourceSet query(String query, String sortExpr) throws XMLDBException
query
query
in interface XPathQueryServiceImpl
query
- a String
valuesortExpr
- a String
value
ResourceSet
value
XMLDBException
- if an error occurspublic CompiledExpression compile(String query) throws XMLDBException
compile
compile
in interface XQueryService
query
- a String
value
CompiledExpression
value
XMLDBException
- if an error occurspublic CompiledExpression compileAndCheck(String query) throws XMLDBException, XPathException
compileAndCheck
query
- a String
value
CompiledExpression
value
XMLDBException
- if an error occurs
XPathException
- if an error occurspublic ResourceSet execute(Source source) throws XMLDBException
XMLDBException
public ResourceSet query(XMLResource res, String query) throws XMLDBException
query
query
in interface XPathQueryServiceImpl
res
- a XMLResource
valuequery
- a String
value
ResourceSet
value
XMLDBException
- if an error occurspublic ResourceSet query(XMLResource res, String query, String sortExpr) throws XMLDBException
query
query
in interface XPathQueryServiceImpl
res
- a XMLResource
valuequery
- a String
valuesortExpr
- a String
value
ResourceSet
value
XMLDBException
- if an error occurspublic ResourceSet queryResource(String resource, String query) throws XMLDBException
queryResource
queryResource
in interface XPathQueryService
queryResource
in interface XQueryService
resource
- a String
valuequery
- a String
value
ResourceSet
value
XMLDBException
- if an error occurspublic String getVersion() throws XMLDBException
getVersion
getVersion
in interface Service
String
value
XMLDBException
- if an error occurspublic void setCollection(Collection col) throws XMLDBException
setCollection
setCollection
in interface Service
col
- a Collection
value
XMLDBException
- if an error occurspublic String getName() throws XMLDBException
getName
getName
in interface Service
String
value
XMLDBException
- if an error occurspublic String getProperty(String property) throws XMLDBException
getProperty
getProperty
in interface Configurable
property
- a String
value
String
value
XMLDBException
- if an error occurspublic void setProperty(String property, String value) throws XMLDBException
setProperty
setProperty
in interface Configurable
property
- a String
valuevalue
- a String
value
XMLDBException
- if an error occurspublic void clearNamespaces() throws XMLDBException
clearNamespaces
clearNamespaces
in interface XPathQueryService
clearNamespaces
in interface XQueryService
XMLDBException
- if an error occurspublic void removeNamespace(String ns) throws XMLDBException
removeNamespace
removeNamespace
in interface XPathQueryService
removeNamespace
in interface XQueryService
ns
- a String
value
XMLDBException
- if an error occurspublic void setNamespace(String prefix, String namespace) throws XMLDBException
setNamespace
setNamespace
in interface XPathQueryService
setNamespace
in interface XQueryService
prefix
- a String
valuenamespace
- a String
value
XMLDBException
- if an error occurspublic String getNamespace(String prefix) throws XMLDBException
getNamespace
getNamespace
in interface XPathQueryService
getNamespace
in interface XQueryService
prefix
- a String
value
String
value
XMLDBException
- if an error occurspublic 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 ResourceSet execute(CompiledExpression expression) throws XMLDBException
XQueryService
XQueryService
to the compiled XQuery code.
Note: CompiledExpression
is not thread safe. Please make sure you don't
call the same compiled expression from two threads at the same time.
execute
in interface XQueryService
XMLDBException
public ResourceSet execute(XMLResource res, CompiledExpression expression) throws XMLDBException
XMLDBException
public void setXPathCompatibility(boolean backwardsCompatible)
XQueryService
setXPathCompatibility
in interface XQueryService
public void setModuleLoadPath(String path)
setModuleLoadPath
in interface XQueryService
XQueryService.setModuleLoadPath(java.lang.String)
public void dump(CompiledExpression expression, Writer writer) throws XMLDBException
XQueryService
XMLDBException
public void beginProtected()
XPathQueryServiceImpl
XPathQueryServiceImpl.endProtected()
is called.
beginProtected
in interface XPathQueryServiceImpl
public void endProtected()
XPathQueryServiceImpl
endProtected
in interface XPathQueryServiceImpl
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |