Package org.datanucleus.enhancer
Class CommandLineHelper
- java.lang.Object
-
- org.datanucleus.enhancer.CommandLineHelper
-
class CommandLineHelper extends java.lang.ObjectHelper used byDataNucleusEnhancer.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 amain(...)method!
-
-
Field Summary
Fields Modifier and Type Field Description private CommandLineclprivate java.lang.String[]filesstatic NucleusLoggerLOGGERLogger for enhancing.
-
Constructor Summary
Constructors Constructor Description CommandLineHelper(java.lang.String[] args)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidconfigureDestination(DataNucleusEnhancer enhancer)private voidconfigureDetachListener(DataNucleusEnhancer enhancer)private voidconfigureGenerateConstructor(DataNucleusEnhancer enhancer)private voidconfigureGeneratePK(DataNucleusEnhancer enhancer)private voidconfigureQuietAndVerbose(DataNucleusEnhancer enhancer)private static CommandLinecreateCommandLine()DataNucleusEnhancercreateDataNucleusEnhancer()java.lang.StringgetDirectory()protected java.lang.StringgetFileListFile()java.lang.String[]getFiles()Gets the files to be enhanced.java.lang.StringgetPersistenceUnitName()booleanisQuiet()booleanisValidating()booleanisVerbose()private voidlogClasspath(DataNucleusEnhancer enhancer)private voidlogEnhancerVersion(DataNucleusEnhancer enhancer, java.lang.String apiName)private java.util.List<java.lang.String>readAndDeleteFileListFile()Reads the file-list-file.
-
-
-
Field Detail
-
LOGGER
public static final NucleusLogger LOGGER
Logger for enhancing.
-
cl
private final CommandLine cl
-
files
private java.lang.String[] files
-
-
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()
-
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, java.lang.String apiName)
-
logClasspath
private void logClasspath(DataNucleusEnhancer enhancer)
-
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.
-
-