public class CommandLineOptions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Properties |
configOptions |
(package private) java.util.Map<java.lang.String,java.lang.String> |
defaultValues |
(package private) Initializer |
initializer |
(package private) java.util.Properties |
namedOptions |
(package private) java.util.HashMap<java.lang.String,java.lang.String> |
optionHelp |
(package private) java.util.Properties |
paramExpressions |
(package private) java.util.Properties |
paramFiles |
(package private) java.util.Properties |
paramValues |
(package private) java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
permittedValues |
(package private) java.util.List |
positionalOptions |
(package private) java.util.HashMap<java.lang.String,java.lang.Integer> |
recognizedOptions |
(package private) java.util.Properties |
serializationParams |
static int |
TYPE_BOOLEAN |
static int |
TYPE_CLASSNAME |
static int |
TYPE_DATETIME |
static int |
TYPE_ENUMERATION |
static int |
TYPE_FILENAME |
static int |
TYPE_FILENAME_LIST |
static int |
TYPE_INTEGER |
static int |
TYPE_INTEGER_PAIR |
static int |
TYPE_QNAME |
static int |
TYPE_STRING |
static int |
VALUE_PROHIBITED |
static int |
VALUE_REQUIRED |
Constructor and Description |
---|
CommandLineOptions() |
Modifier and Type | Method and Description |
---|---|
void |
addRecognizedOption(java.lang.String option,
int optionProperties,
java.lang.String helpText)
Set the permitted options.
|
void |
applyToConfiguration(Configuration config)
Apply options to the Configuration
|
boolean |
definesParameterValues()
Test whether there is any keyword=value option present
|
java.lang.String |
displayPermittedOptions()
Display the list the permitted options
|
java.lang.String |
getOptionValue(java.lang.String option)
Get the value of a named option.
|
java.util.List<java.lang.String> |
getPositionalOptions()
Get the options specified positionally, that is, without a leading "-"
|
static void |
loadAdditionalSchemas(Configuration config,
java.lang.String additionalSchemas) |
static java.lang.Object |
loadDocuments(java.lang.String sourceFileName,
boolean useURLs,
Configuration config,
boolean useSAXSource)
Load a document, or all the documents in a directory, given a filename or URL
|
void |
setActualOptions(java.lang.String[] args)
Set the actual options
|
void |
setParams(Configuration config,
Controller controller,
DynamicQueryContext qcontext,
java.util.Properties outputProperties)
Apply requested parameters to a controller, a query context, or a set of output properties, as appropriate
|
void |
setPermittedValues(java.lang.String option,
java.lang.String[] values,
java.lang.String defaultValue)
Set the permitted values for an option
|
static java.lang.String |
showExecutionTime(long millisecs) |
boolean |
testIfSchemaAware()
Prescan the command line arguments to see if any of them imply use of a schema-aware processor
|
public static final int TYPE_BOOLEAN
public static final int TYPE_FILENAME
public static final int TYPE_CLASSNAME
public static final int TYPE_ENUMERATION
public static final int TYPE_INTEGER
public static final int TYPE_QNAME
public static final int TYPE_FILENAME_LIST
public static final int TYPE_DATETIME
public static final int TYPE_STRING
public static final int TYPE_INTEGER_PAIR
public static final int VALUE_REQUIRED
public static final int VALUE_PROHIBITED
java.util.HashMap<java.lang.String,java.lang.Integer> recognizedOptions
java.util.HashMap<java.lang.String,java.lang.String> optionHelp
java.util.Properties namedOptions
java.util.Properties configOptions
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> permittedValues
java.util.Map<java.lang.String,java.lang.String> defaultValues
java.util.List positionalOptions
java.util.Properties paramValues
java.util.Properties paramExpressions
java.util.Properties paramFiles
java.util.Properties serializationParams
Initializer initializer
public void addRecognizedOption(java.lang.String option, int optionProperties, java.lang.String helpText)
option
- A permitted option.public void setPermittedValues(java.lang.String option, java.lang.String[] values, java.lang.String defaultValue)
option
- the option keywordvalues
- the set of permitted valuesdefaultValue
- the default value if the option is supplied but no value is given. May be null if no
default is defined.public void setActualOptions(java.lang.String[] args) throws XPathException
XPathException
public boolean definesParameterValues()
public boolean testIfSchemaAware()
public void applyToConfiguration(Configuration config) throws javax.xml.transform.TransformerException
config
- the Configurationjavax.xml.transform.TransformerException
public java.lang.String displayPermittedOptions()
public java.lang.String getOptionValue(java.lang.String option)
option
- the option keywordpublic java.util.List<java.lang.String> getPositionalOptions()
public void setParams(Configuration config, Controller controller, DynamicQueryContext qcontext, java.util.Properties outputProperties) throws javax.xml.transform.TransformerException
controller
- The controller to be used for a transformation. May be null.qcontext
- The dynamic query context. May be null.outputProperties
- the serialization properties. May be null.javax.xml.transform.TransformerException
public static java.lang.Object loadDocuments(java.lang.String sourceFileName, boolean useURLs, Configuration config, boolean useSAXSource) throws javax.xml.transform.TransformerException
sourceFileName
- the name of the source file or directoryuseURLs
- true if the filename argument is to be treated as a URIconfig
- the Saxon configurationuseSAXSource
- true if the method should use a SAXSource rather than a StreamSourcejavax.xml.transform.TransformerException
public static void loadAdditionalSchemas(Configuration config, java.lang.String additionalSchemas) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public static java.lang.String showExecutionTime(long millisecs)