ca.umontreal.iro.rali
Class Options

java.lang.Object
  extended by ca.umontreal.iro.rali.Options

public class Options
extends java.lang.Object

Parsing of command line options and keep their values that can be shared by the Explore and Extract classes.

Author:
Guy Lapalme, Université de Montréal, 2009

Field Summary
static boolean debug
          Global option (-d): will show debugging information during execution
protected static java.lang.String inputFileName
          Last parameter: Name of the input file, if it is null then standard input is used
protected static int maxRes
          Extract option (-max): stop reading the file after a given number of results (infinite if not specified)
protected static NamespaceContext nsContext
          keep track of the namespaces used in the input document
protected static boolean onlyCount
          Extract option (-c): return only the number of extracted nodes
protected static boolean outAttr
          Explore option (-a): output attribute names in XPath expression
protected static boolean outAttrVal
          Explore option (-av): output attribute names and values in XPath expression
protected static java.lang.String outputFileName
          Global option (-o): Name of the output file, if it is null then standard output is used
protected static boolean outVal
          Explore option (-v): output element values in XPath expression
protected static boolean prettyPrint
          Extract option (-pp): output a prettyprinted version of the extracted node
protected static java.lang.String rootName
          Extract option (-r): name of the root element (root if not given)
protected static boolean sax
           
protected static boolean showNamespaces
          Explore option (-ns): show the values of the namespaces used in XPath expressions
protected static boolean sortAlpha
          Explore option (-sa): sort the XPath expressions alphabetically
protected static boolean sortFreq
          Explore option (-sf): sort the XPath expression by decreasing frequency
protected static boolean statistics
          Global option (-st): will show statistics information at the end of execution
protected static java.lang.String XML_NS
           
protected static java.lang.String xpathStr
          Extract option (-xp): XPath expression used to select nodes to extract
protected static java.util.Map<java.lang.String,java.lang.String> xslParams
          List of parameters for the xsl stylesheets (they are set to both individual and final stylesheets)
protected static java.lang.String xsltFile
          Extract option (-xsl): XSLT stylesheet to apply to each extracted node
protected static java.lang.String xsltFileFinal
          Extract option (-xslf): XSLT stylesheet to apply to the resulting document
 
Constructor Summary
Options()
           
 
Method Summary
protected static void parseArgs(java.lang.String[] args)
          Parse program arguments and set appropriate options will stop on -h : prints usage of the program -xpt: prints the xpath expression as it is seen by the program will stop on an unrecognized arguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_NS

protected static final java.lang.String XML_NS
See Also:
Constant Field Values

debug

public static boolean debug
Global option (-d): will show debugging information during execution


statistics

protected static boolean statistics
Global option (-st): will show statistics information at the end of execution


inputFileName

protected static java.lang.String inputFileName
Last parameter: Name of the input file, if it is null then standard input is used


outputFileName

protected static java.lang.String outputFileName
Global option (-o): Name of the output file, if it is null then standard output is used


sax

protected static boolean sax

outAttr

protected static boolean outAttr
Explore option (-a): output attribute names in XPath expression


outAttrVal

protected static boolean outAttrVal
Explore option (-av): output attribute names and values in XPath expression


outVal

protected static boolean outVal
Explore option (-v): output element values in XPath expression


sortAlpha

protected static boolean sortAlpha
Explore option (-sa): sort the XPath expressions alphabetically


sortFreq

protected static boolean sortFreq
Explore option (-sf): sort the XPath expression by decreasing frequency


showNamespaces

protected static boolean showNamespaces
Explore option (-ns): show the values of the namespaces used in XPath expressions


xpathStr

protected static java.lang.String xpathStr
Extract option (-xp): XPath expression used to select nodes to extract


xsltFile

protected static java.lang.String xsltFile
Extract option (-xsl): XSLT stylesheet to apply to each extracted node


xsltFileFinal

protected static java.lang.String xsltFileFinal
Extract option (-xslf): XSLT stylesheet to apply to the resulting document


xslParams

protected static java.util.Map<java.lang.String,java.lang.String> xslParams
List of parameters for the xsl stylesheets (they are set to both individual and final stylesheets)


rootName

protected static java.lang.String rootName
Extract option (-r): name of the root element (root if not given)


onlyCount

protected static boolean onlyCount
Extract option (-c): return only the number of extracted nodes


prettyPrint

protected static boolean prettyPrint
Extract option (-pp): output a prettyprinted version of the extracted node


maxRes

protected static int maxRes
Extract option (-max): stop reading the file after a given number of results (infinite if not specified)


nsContext

protected static NamespaceContext nsContext
keep track of the namespaces used in the input document

Constructor Detail

Options

public Options()
Method Detail

parseArgs

protected static void parseArgs(java.lang.String[] args)
Parse program arguments and set appropriate options will stop on -h : prints usage of the program -xpt: prints the xpath expression as it is seen by the program will stop on an unrecognized arguments

Parameters:
args - String array as given to the main program