Class Batch
This class has one static method only and is the command-line front end
for BatchProcessor
. That class is less restricted.
Here, due to the syntax of BatchOptions
, for instance
only one single set of style-sheet parameters can be given, for all
transformations.
If any parsing of the inputs is wanted, then at least one xslt processing job or the mere xml output must be requested.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BatchOptionsGui
Service access point: prototype for gui-based client software. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static EnumSet<Options.traceflag>
Convert an enum set of xslt trace flags as defined in this package to a set of trace flags as defined with xslt.static boolean
execute
(BatchOptions options, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgIn) Execute the CLI-parsed or GUI-generated Option model.protected static Text2Udom.ErrorStrategy
initErrorStrategy
(BatchOptions options) Construct an eror strategy according to the command line options.protected static ModuleRegistry
initModuleReg
(BatchOptions options, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) Construct a module registry according to the command line options.static void
interpretCommandline
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String cli_text) Service access point: execute the value as if it were a command line suffix.static void
Central command line processing method.void
nonStatic_interpretCommandline
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String cli_text) Simulate CLI input for programmatic use, esp. for tests.protected static void
Evidentprotected static <D> void
s_error
(MessageReceiver<SimpleMessage<D>> msg, String s, Object... args) Evidentprotected static <D> void
s_log
(MessageReceiver<SimpleMessage<D>> msg, int debuglevel, String s, Object... args) Evidentprotected static <D> void
s_warning
(MessageReceiver<SimpleMessage<D>> msg, int debuglevel, String s, Object... args) Evidentprotected static void
Evidentprotected static void
Evident
-
Field Details
-
prototypeGui
Service access point: prototype for gui-based client software.
-
-
Constructor Details
-
Batch
public Batch()
-
-
Method Details
-
s_error
Evident -
s_warning
protected static <D> void s_warning(MessageReceiver<SimpleMessage<D>> msg, int debuglevel, String s, Object... args) Evident- Parameters:
debuglevel
- the parameter value given by the caller. The warning is only printed if that is > 0.
-
s_log
protected static <D> void s_log(MessageReceiver<SimpleMessage<D>> msg, int debuglevel, String s, Object... args) Evident- Parameters:
debuglevel
- the parameter value given by the caller. The logging is only printed if that is > 0.
-
printErrorCounter
Evident -
terminateApplicationOnErrors_printUsage
Evident -
terminateApplicationOnErrors
Evident -
initModuleReg
protected static ModuleRegistry initModuleReg(BatchOptions options, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) Construct a module registry according to the command line options. -
initErrorStrategy
Construct an eror strategy according to the command line options. -
convert
Convert an enum set of xslt trace flags as defined in this package to a set of trace flags as defined with xslt. Correspondance is by name. -
interpretCommandline
public static void interpretCommandline(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String cli_text) Service access point: execute the value as if it were a command line suffix. -
nonStatic_interpretCommandline
public void nonStatic_interpretCommandline(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String cli_text) Simulate CLI input for programmatic use, esp. for tests. Does NOT decode the "--version" option, etc. -
main
Central command line processing method. The command line parameters are defined byBatchOptions
. The processing uses the metatools xslt 1.0 implementation "txsl", and the options include also most txsl options.Stylesheet parameters can be given a sequence of style sheet parameter files, and one by one on the command line, with increasing priority. The character
SimpleFilePattern.defaultPlaceholder
can be used in these parameter values and will be replaced by the file name stem currently processed.One single call converts "k" source files into "m" output files using xslt, plus possibly the pure ".xml" version. This produces "k*m" or "k*(m+1)" output files, while all preparatory module loading, xslt compiling, etc. is performed only once. The source files are given as file position (not as "URI" etc.)
The naming for the output files is as follows: A "stem" is extracted from all sources, and combined with all target formats to construct the output file name, in the same way as "make" does. See
SimpleFilePattern
for details. The placeholder character can also appear in style sheet parameter values, and will also be replaced by the stem.The following combination of input data are currently supported:
sources pattern xmlOut resultFiles styleshee parameters a.b b.b %.b %.xml %.html %.mk % <src>%<</src> NOT supported: --single source mode-- a.b (na) my.xml other.html adLib.mk (none) --or even mixed a.b %.b my.xml %.html adLib.mk % &tl;src>%</src>
(The placeholder character MUST be present in the pattern and in all output file names.) -
execute
public static boolean execute(BatchOptions options, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msgIn) Execute the CLI-parsed or GUI-generated Option model.- Returns:
- whether the kind of error proposes to any cli-based caller to present the "usage()" in case of errors
- See Also:
-