Package org.apache.rat.commandline
Class ArgumentContext
java.lang.Object
org.apache.rat.commandline.ArgumentContext
Provides the context necessary to process various arguments.
- Since:
- 0.17
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentContext(File workingDirectory, org.apache.commons.cli.CommandLine commandLine)Creates a context with an empty configuration.ArgumentContext(File workingDirectory, ReportConfiguration configuration, org.apache.commons.cli.CommandLine commandLine)Creates a context with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.cli.CommandLineGets the command line.Gets the configuration.Gets the directory name from which relative file names will be resolved.voidlogParseException(org.apache.commons.cli.ParseException exception, org.apache.commons.cli.Option opt, Object defaultValue)Logs a ParseException as a warning.voidProcess the arguments specified in this context.
-
Constructor Details
-
ArgumentContext
public ArgumentContext(File workingDirectory, ReportConfiguration configuration, org.apache.commons.cli.CommandLine commandLine)Creates a context with the specified configuration.- Parameters:
workingDirectory- the directory from which relative file names will be resolved.configuration- The configuration that is being built.commandLine- The command line that is building the configuration.
-
ArgumentContext
Creates a context with an empty configuration.- Parameters:
workingDirectory- The directory from which to resolve relative file names.commandLine- The command line.
-
-
Method Details
-
processArgs
public void processArgs()Process the arguments specified in this context. -
getConfiguration
Gets the configuration.- Returns:
- The configuration that is being built.
-
getCommandLine
public org.apache.commons.cli.CommandLine getCommandLine()Gets the command line.- Returns:
- The command line that is driving the configuration.
-
getWorkingDirectory
Gets the directory name from which relative file names will be resolved.- Returns:
- The directory name from which relative file names will be resolved.
-
logParseException
public void logParseException(org.apache.commons.cli.ParseException exception, org.apache.commons.cli.Option opt, Object defaultValue)Logs a ParseException as a warning.- Parameters:
exception- the parse exception to logopt- the option being processeddefaultValue- The default value the option is being set to.
-