Package net.sf.saxon
Class Query
- java.lang.Object
-
- net.sf.saxon.Query
-
- Direct Known Subclasses:
JDOMQuery
public class Query extends java.lang.Object
This Query class provides a command-line interface to the Saxon XQuery processor.- Author:
- Michael H. Kay
-
-
Field Summary
Fields Modifier and Type Field Description protected Configuration
config
-
Constructor Summary
Constructors Constructor Description Query()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
badUsage(java.lang.String name, java.lang.String message)
Report incorrect usage of the command line, with a list of the options and arguments that are availableprotected void
doQuery(java.lang.String[] args, java.lang.String name)
Support method for main program.protected Configuration
getConfiguration()
Get the configuration in usestatic void
main(java.lang.String[] args)
Main program, can be used directly from the command line.protected Configuration
makeConfiguration(boolean schemaAware)
Set the configuration.protected static void
quit(java.lang.String message, int code)
Exit with a messagevoid
setPOption(Configuration config)
-
-
-
Field Detail
-
config
protected Configuration config
-
-
Method Detail
-
makeConfiguration
protected Configuration makeConfiguration(boolean schemaAware)
Set the configuration. This is designed to be overridden in a subclass
-
getConfiguration
protected Configuration getConfiguration()
Get the configuration in use- Returns:
- the configuration
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
Main program, can be used directly from the command line.The format is:
java net.sf.saxon.Query [options] query-file >output-file
followed by any number of parameters in the form {keyword=value}... which can be referenced from within the query.
This program executes the query in query-file.
- Parameters:
args
- List of arguments supplied on operating system command line- Throws:
java.lang.Exception
- Indicates that a compile-time or run-time error occurred
-
doQuery
protected void doQuery(java.lang.String[] args, java.lang.String name)
Support method for main program. This support method can also be invoked from subclasses that support the same command line interface- Parameters:
args
- the command-line argumentsname
- name of the class, to be used in error messages
-
quit
protected static void quit(java.lang.String message, int code)
Exit with a message- Parameters:
message
- The message to be outputcode
- The result code to be returned to the operating system shell
-
setPOption
public void setPOption(Configuration config)
-
badUsage
protected void badUsage(java.lang.String name, java.lang.String message)
Report incorrect usage of the command line, with a list of the options and arguments that are available- Parameters:
name
- The name of the command being executed (allows subclassing)message
- The error message
-
-