Class ArgumentContext

java.lang.Object
org.apache.rat.commandline.ArgumentContext

public class ArgumentContext extends Object
Provides the context necessary to process various arguments.
Since:
0.17
  • 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

      public ArgumentContext(File workingDirectory, org.apache.commons.cli.CommandLine commandLine)
      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

      public ReportConfiguration 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

      public DocumentName 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 log
      opt - the option being processed
      defaultValue - The default value the option is being set to.