Class Main

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

public class Main extends Object
D2d comand line tool, by static method main(java.lang.String[]).

Most executives for the different tasks of d2d are dislocated as public static methods into Tasks, since they are also called by programs. See there for complete use case information flow diagrams.

Some transformations are implemeted in these both classes directly; others are implemented de-centrally. E.g. the reading of DTDs and .umod files as ddf-s is done by the ModuleRegistry "under the hood", when looking for text format definitions.

  • Field Details

  • Constructor Details

    • Main

      public Main()
  • Method Details

    • error

      protected void error(String s, Object... args)
      Evident
    • error

      protected void error(Exception ex, String s, Object... args)
      Evident
    • warning

      protected void warning(String s, Object... args)
      Evident
    • log

      protected void log(String s, Object... args)
      Evident
    • logStart

      protected void logStart(String s, Object... args)
      Evident
    • logEnd

      protected void logEnd(String s, Object... args)
      Evident
    • printErrorCounter

      protected void printErrorCounter()
      Print all non-zero message numbers, per category and over all.
    • terminateApplicationOnErrors_printUsage

      protected void terminateApplicationOnErrors_printUsage()
      Evident
    • terminateApplicationOnErrors

      protected void terminateApplicationOnErrors()
      Evident
    • modeText

      protected String modeText(Options options)
      Synthesize text for use in messages which indicates the selected "mode"
    • get2names

      @Opt protected @Opt String[] get2names(Options options, String sourceRole)
      Extract an input and an output file name from the options (option --source and --outputfile). Raise error if not possible.
    • getInputName

      protected String getInputName(Options options)
      Extract an input file name from options and ensure no output file name is given. Raise error if not possible.
    • check_noKey_noKeys

      protected void check_noKey_noKeys(Options options)
      Ensure that no key or keys option is given.
    • check_noKeys

      protected void check_noKeys(Options options)
      Ensure that no "keys" option is given.
    • splitAndCheckKey

      @Opt public static @Opt String[] splitAndCheckKey(MessageReceiver<SimpleMessage<@Opt XMLDocumentIdentifier>> msg, String s)
      Split one string according to the syntax [modulePath] (":"[ElementTag])?. Return one or two strings, or null in case of error. The first is always a definition module (mostly a dtd!). The second is the top-level element, used for identifying the "set of reachables".
    • getKey_split

      @Opt protected @Opt String[] getKey_split(Options options)
      Split the command line option "-k/--key" with splitAndCheckKey(MessageReceiver,String). Currently only used for ddf2xslt-mode.
      Returns:
      an arrey of one or two strings, holding the target module and maybe the target top tag
    • checkKeyIsSet

      protected void checkKeyIsSet(Options options, String txt)
      Check for option "-k/--key".
    • initModuleReg

      public static ModuleRegistry initModuleReg(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int tracelevel, Stream<String> libpath)
      Construct a module registry according to the command line options.
    • initModuleReg

      protected ModuleRegistry initModuleReg(Options options)
      Construct a module registry according to the command line options.
    • initErrorStrategy

      public static Text2Udom.ErrorStrategy initErrorStrategy(int interactive, boolean partialDocs)
      Construct an eror strategy according to the command line options.
    • initErrorStrategy

      protected Text2Udom.ErrorStrategy initErrorStrategy(Options options)
      Construct an eror strategy according to the command line options.
    • main

      public static void main(String[] args)
      Create one instance, for messaging and option decoding, and call nonStatic_main(String[]).
    • nonStatic_main

      protected void nonStatic_main(String[] args)
      Tool implementation: Decodes and checks the commandline options, sets up some global parameters, and calls the different worker methods. These are mostly in Tasks, for programmatic invokation.