public class CommandLineOptions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
CommandLineOptions.ParamSetter |
Modifier and Type | Field and Description |
---|---|
protected java.util.Properties |
namedOptions |
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 |
applyFileParams(Processor processor,
Xslt30Transformer transformer)
Apply XSLT 3.0 file-valued parameters to an XSLT transformer.
|
void |
applyStaticParams(XsltCompiler compiler)
Apply XSLT 3.0 static parameters to a compilerInfo.
|
void |
applyToConfiguration(Processor processor)
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
|
static java.lang.String |
getCommandName(java.lang.Object command) |
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 boolean |
isImplicitURI(java.lang.String name) |
static void |
loadAdditionalSchemas(Configuration config,
java.lang.String additionalSchemas) |
static boolean |
loadDocuments(java.lang.String sourceFileName,
boolean useURLs,
Processor processor,
boolean useSAXSource,
java.util.List<javax.xml.transform.Source> sources)
Load a document, or all the documents in a directory, given a filename or URL
|
void |
setActualOptions(java.lang.String[] args)
Set the options actually present on the command line
|
void |
setParams(Processor processor,
CommandLineOptions.ParamSetter paramSetter) |
void |
setPermittedValues(java.lang.String option,
java.lang.String[] values,
java.lang.String defaultValue)
Set the permitted values for an option
|
void |
setSerializationProperties(Serializer serializer)
Set any output properties appearing on the command line in the form
!indent=yes
as properties of the supplied Serializer |
static java.lang.String |
showExecutionTimeNano(long nanosecs) |
static java.lang.String |
showMemoryUsed() |
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
protected java.util.Properties namedOptions
public void addRecognizedOption(java.lang.String option, int optionProperties, java.lang.String helpText)
option
- A permitted option.optionProperties
- of this option, for example whether it is mandatoryhelpText
- message to be output if the user needs help concerning this optionpublic 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
args
- the options supplied on the command lineXPathException
- if an unrecognized or invalid option is foundpublic boolean definesParameterValues()
public boolean testIfSchemaAware()
public void applyToConfiguration(Processor processor) throws javax.xml.transform.TransformerException
processor
- the s9api Processor objectjavax.xml.transform.TransformerException
- if invalid options are presentpublic 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(Processor processor, CommandLineOptions.ParamSetter paramSetter) throws SaxonApiException
SaxonApiException
public void setSerializationProperties(Serializer serializer)
!indent=yes
as properties of the supplied Serializer
serializer
- the supplied Serializer
, whose serialization properties
are to be modified.public void applyStaticParams(XsltCompiler compiler) throws SaxonApiException
compiler
- The XsltCompiler object into which the parameters are copiedSaxonApiException
- if invalid options are foundpublic void applyFileParams(Processor processor, Xslt30Transformer transformer) throws SaxonApiException
transformer
- The Xslt30Transformer object into which the parameters are copiedSaxonApiException
- if invalid options are foundpublic static boolean loadDocuments(java.lang.String sourceFileName, boolean useURLs, Processor processor, boolean useSAXSource, java.util.List<javax.xml.transform.Source> sources) throws SaxonApiException
sourceFileName
- the name of the source file or directoryuseURLs
- true if the filename argument is to be treated as a URIprocessor
- the Saxon s9api ProcessoruseSAXSource
- true if the method should use a SAXSource rather than a StreamSourcesources
- an empty list which the method will populate.
If sourceFileName represents a single source document, a corresponding XdmNode is
added to the list. If sourceFileName represents a directory, multiple XdmNode
objects, one for each file in the directory, are added to the listSaxonApiException
- if access to documents failspublic static boolean isImplicitURI(java.lang.String name)
public static void loadAdditionalSchemas(Configuration config, java.lang.String additionalSchemas) throws SchemaException
SchemaException
public static java.lang.String showExecutionTimeNano(long nanosecs)
public static java.lang.String showMemoryUsed()
public static java.lang.String getCommandName(java.lang.Object command)
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.