Nux 1.6

nux.xom.tests
Class XQueryCommand

java.lang.Object
  extended by nux.xom.tests.XQueryCommand

public final class XQueryCommand
extends Object

Nux XQuery test tool with optional schema validation, XInclude and update facility; See the online help for a description of all available options, plus examples.

Somewhat complex implementation due to the large number of flexible options, and robust handling of all potential issues. For a much simpler example see SimpleXQueryCommand.java.

Can also be used as a simple benchmark, measuring XML parsing, XQuery execution and XML serialization, either individually, or in combination (via --iterations, --runs, --out=/dev/null), with and without pooling.

For best parsing results, make sure to run with the latest stable Xerces release. (For JDK 1.5, copy the xerces jars into nux/lib/. For JDK 1.4, set environment variable via export JAVA_OPTS='-Djava.endorsed.dirs=/path/to/xerces/lib').

When using W3C XML Schema, RelaxNG and TagSoup, make sure to put the xerces jar, MSV jars and tagsoup jar onto the classpath, respectively.

Author:
whoschek.AT.lbl.DOT.gov, $Author: hoschek3 $

Method Summary
protected  void checkValidity(String arg, String[] permitted, String optionName)
          Yet another utility parse method for illegal/invalid option checking.
protected  void doMain(String[] args)
          Executes the program with the given command line arguments.
protected  String getHomepage()
          Returns the program's home page for displaying program info.
protected  String getLicense()
          Returns the program's copyright and licene.
protected  String getMailAddress()
          Returns the author's email for displaying program info.
protected  String getOptions()
          Returns the program's overall options.
protected  String getProgramName()
          Returns the program's name for displaying program info.
protected  String getShortUsage()
          Returns the program's overall usage message.
protected  String getVersion()
          Returns the program's version for displaying program info.
protected  String getVersionInfo()
          Returns the program's version info.
static void main(String[] args)
          Main entry point; run this program without any arguments to get help (including descriptions of all options).
protected  int parseArguments(String[] args)
          Parses and validates the given command line arguments.
protected  int parseInt(String arg, String optionName)
          Utility parse method for illegal/invalid option checking.
protected  int parseIntGreaterThanZero(String arg, String optionName)
          Utility parse method for illegal/invalid option checking.
protected  String[] parseNonOptionArguments(String[] args, int getOptind, boolean checkFile, int minArgs, int maxArgs)
          Parse non-option command line arguments (option arguments have already been parsed).
protected  void run()
          Execute the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(String[] args)
Main entry point; run this program without any arguments to get help (including descriptions of all options).


parseArguments

protected int parseArguments(String[] args)
Parses and validates the given command line arguments.


run

protected void run()
            throws Exception
Execute the query.

Throws:
Exception

getMailAddress

protected String getMailAddress()
Returns the author's email for displaying program info.


getProgramName

protected String getProgramName()
Returns the program's name for displaying program info.


getHomepage

protected String getHomepage()
Returns the program's home page for displaying program info.


getVersion

protected String getVersion()
Returns the program's version for displaying program info.


doMain

protected void doMain(String[] args)
Executes the program with the given command line arguments.


getOptions

protected String getOptions()
Returns the program's overall options.


getShortUsage

protected String getShortUsage()
Returns the program's overall usage message.


getVersionInfo

protected String getVersionInfo()
Returns the program's version info.


getLicense

protected String getLicense()
Returns the program's copyright and licene.


parseIntGreaterThanZero

protected int parseIntGreaterThanZero(String arg,
                                      String optionName)
Utility parse method for illegal/invalid option checking.


parseInt

protected int parseInt(String arg,
                       String optionName)
Utility parse method for illegal/invalid option checking.


checkValidity

protected void checkValidity(String arg,
                             String[] permitted,
                             String optionName)
Yet another utility parse method for illegal/invalid option checking.


parseNonOptionArguments

protected String[] parseNonOptionArguments(String[] args,
                                           int getOptind,
                                           boolean checkFile,
                                           int minArgs,
                                           int maxArgs)
Parse non-option command line arguments (option arguments have already been parsed).


Nux 1.6