Class Batch

java.lang.Object
eu.bandm.tools.d2d2.base.Batch

public class Batch extends Object
Batch processing of d2d sources into different back-ends, using BandMs' own "txsl" implementation of xslt 1_0. Realizes more efficient processing of more than one input file into more than one output format, since the start-up phase must only be executed once.

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 Details

    • prototypeGui

      public static final BatchOptionsGui prototypeGui
      Service access point: prototype for gui-based client software.
  • Constructor Details

    • Batch

      public Batch()
  • Method Details

    • s_error

      protected static <D> void s_error(MessageReceiver<SimpleMessage<D>> msg, String s, Object... args)
      Evident
    • s_warning

      protected static <D> void s_warning(MessageReceiver<SimpleMessage<D>> msg, int debuglevel, String s, Object... args)
      Evident
    • s_log

      protected static <D> void s_log(MessageReceiver<SimpleMessage<D>> msg, int debuglevel, String s, Object... args)
      Evident
    • printErrorCounter

      protected static void printErrorCounter(MessageCounter mc)
      Evident
    • terminateApplicationOnErrors_printUsage

      protected static void terminateApplicationOnErrors_printUsage(MessageCounter mc)
      Evident
    • terminateApplicationOnErrors

      protected static void terminateApplicationOnErrors(MessageCounter mc)
      Evident
    • initModuleReg

      protected static ModuleRegistry initModuleReg(BatchOptions options, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
      Construct a module registry according to the command line options.
    • initErrorStrategy

      protected static Text2Udom.ErrorStrategy initErrorStrategy(BatchOptions options)
      Construct an eror strategy according to the command line options.
    • convert

      protected static EnumSet<Options.traceflag> convert(EnumSet<BatchOptions.traceflag> set)
      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.
    • main

      public static void main(String[] args)
      Central command line processing method. The command line parameters are defined by BatchOptions. 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" et.c)

      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 placeholder character MUST be present = only multi-mode supported, even if it is effectively not used.)

    • 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: