|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.deploy.CompiledUserQuery
public abstract class CompiledUserQuery
This abstract class acts as a superclass for every compiled query generated by the Saxon code generator, other than queries compiled in servlet mode.
Queries compiled to use this superclass are not thread-safe: a new instance of the class must be created each time a query is run in a new thread. The class is, however, serially reusable.
The class supports two mechanisms for running a compiled query. The query can be run directly from the command line, or it can be integrated into an application and invoked via a Java API.
The class contains two kinds of method: methods (many of them abstract) that form the API to the query, enabling a client application to invoke the query and process the results; and concrete methods that provide run-time services to the compiled query itself.
Constructor Summary | |
---|---|
CompiledUserQuery()
|
Method Summary | |
---|---|
Configuration |
getConfiguration()
Get the Configuration |
Executable |
getExecutable()
Get the Executable |
abstract void |
initializeGlobals(XPathContext context)
Run the query-specific initialization code. |
void |
mainCommand(String[] args)
Run the query from the command line |
abstract void |
process(XPathContext context)
Run the query, sending the results to the current output destination |
void |
run(Result result,
Properties outputProperties)
Run the query, sending the results directly to a JAXP Result object. |
void |
setConfiguration(Configuration config)
Supply the configuration in which the query will be executed. |
void |
setDynamicContext(DynamicQueryContext context)
Supply the dynamic context for the query. |
abstract void |
setExternalVariable(String clarkName,
ValueRepresentation value)
Supply the value of an external variable |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompiledUserQuery()
Method Detail |
---|
public void setConfiguration(Configuration config)
config
- the Configuration to be used. If the query is schema-aware, this must be an instance
of SchemaAwareConfiguration
public abstract void setExternalVariable(String clarkName, ValueRepresentation value)
clarkName
- The expanded name of the variable in Clark notation: that is, the local name
in the case of a name in no namespace, or "{uri}local" for a name with namespace URI "uri" and local name
"local"value
- The value to be assigned to the external variablepublic void setDynamicContext(DynamicQueryContext context)
setExternalVariable(java.lang.String, net.sf.saxon.om.ValueRepresentation)
).
If any parameter values are included in the context, they will immediately be extracted from the
supplied context object and passed to the query as if setExternalVariable(java.lang.String, net.sf.saxon.om.ValueRepresentation)
were called. Subsequent
changes to the context object have no effect. However, if the values supplied are mutable, it is undefined
whether any subsequent changes to the values have any effect.
context
- the dynamic context to be used.public void run(Result result, Properties outputProperties) throws XPathException
result
- the destination for the results of the query. The query is effectively wrapped
in a document{} constructor, so that the items in the result are concatenated to form a single
document; this is then written to the requested Result destination, which may be (for example)
a DOMResult, a SAXResult, or a StreamResultoutputProperties
- Supplies serialization properties, in JAXP format, if the result is to
be serialized. This parameter can be defaulted to null. Values supplied
here take precedence over any values supplied in the query source using the
saxon:output option declaration.
XPathException
- if the query fails.public Configuration getConfiguration()
public Executable getExecutable()
public abstract void initializeGlobals(XPathContext context) throws XPathException
context
- the XPath dynamic context
XPathException
public abstract void process(XPathContext context) throws XPathException
context
- the XPath dynamic context
XPathException
public void mainCommand(String[] args) throws Exception
args
- command line options
Exception
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |