Class CommandLineHelper


  • class CommandLineHelper
    extends java.lang.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 Detail

      • LOGGER

        public static final NucleusLogger LOGGER
        Logger for enhancing.
      • files

        private java.lang.String[] files
    • Constructor Detail

      • CommandLineHelper

        public CommandLineHelper​(java.lang.String[] args)
    • Method Detail

      • createCommandLine

        private static CommandLine createCommandLine()
      • isQuiet

        public boolean isQuiet()
      • isVerbose

        public boolean isVerbose()
      • isValidating

        public boolean isValidating()
      • getPersistenceUnitName

        public java.lang.String getPersistenceUnitName()
      • getDirectory

        public java.lang.String getDirectory()
      • getFiles

        public java.lang.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 java.lang.String getFileListFile()
      • configureQuietAndVerbose

        private void configureQuietAndVerbose​(DataNucleusEnhancer enhancer)
      • configureGenerateConstructor

        private void configureGenerateConstructor​(DataNucleusEnhancer enhancer)
      • configureDetachListener

        private void configureDetachListener​(DataNucleusEnhancer enhancer)
      • logEnhancerVersion

        private void logEnhancerVersion​(DataNucleusEnhancer enhancer,
                                        java.lang.String apiName)
      • readAndDeleteFileListFile

        private java.util.List<java.lang.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.