Class CommandLineHelper

java.lang.Object
org.datanucleus.enhancer.CommandLineHelper

class CommandLineHelper extends Object
Helper used by DataNucleusEnhancer.main(String[]) to process the command line arguments.

Important: This class uses System.exit(int) in case of failures. It must therefore not be used anywhere else than a main(...) method!

  • Field Details

  • Constructor Details

    • CommandLineHelper

      public CommandLineHelper(String[] args)
  • Method Details

    • createCommandLine

      private static CommandLine createCommandLine()
    • isQuiet

      public boolean isQuiet()
    • isVerbose

      public boolean isVerbose()
    • isValidating

      public boolean isValidating()
    • getPersistenceUnitName

      public String getPersistenceUnitName()
    • getDirectory

      public String getDirectory()
    • getFiles

      public String[] getFiles()
      Gets the files to be enhanced.

      This is either the list of default arguments (i.e. program arguments without a "-"-prefix) or the contents of the file-list-file passed as "-flf" argument. If a file-list-file was specified, the default arguments are ignored.

      Returns:
      the files to be enhanced. Never null.
    • getFileListFile

      protected String getFileListFile()
    • createDataNucleusEnhancer

      public DataNucleusEnhancer createDataNucleusEnhancer()
    • configureQuietAndVerbose

      private void configureQuietAndVerbose(DataNucleusEnhancer enhancer)
    • configureDestination

      private void configureDestination(DataNucleusEnhancer enhancer)
    • configureGenerateConstructor

      private void configureGenerateConstructor(DataNucleusEnhancer enhancer)
    • configureGeneratePK

      private void configureGeneratePK(DataNucleusEnhancer enhancer)
    • configureDetachListener

      private void configureDetachListener(DataNucleusEnhancer enhancer)
    • logEnhancerVersion

      private void logEnhancerVersion(DataNucleusEnhancer enhancer, String apiName)
    • logClasspath

      private void logClasspath(DataNucleusEnhancer enhancer)
    • readAndDeleteFileListFile

      private List<String> readAndDeleteFileListFile()
      Reads the file-list-file.

      This file serves as replacement for directly passing the files to be enhanced (classes or *.jdo files) to the enhancer as program arguments. It must be UTF-8-encoded and it must contain one file per line.

      See: NUCACCECLIPSE-11

      Returns:
      the contents of the file-list-file. Never null. Empty lines and comments are filtered out.