Class CriterionOptionHandler

java.lang.Object
org.kohsuke.args4j.spi.OptionHandler<ComparisonCriterion>
org.tweetyproject.arg.delp.semantics.CriterionOptionHandler

public final class CriterionOptionHandler extends org.kohsuke.args4j.spi.OptionHandler<ComparisonCriterion>
Handles command-line options related to ComparisonCriterion objects.

This class extends OptionHandler to parse and handle command-line options that specify comparison criteria. It is used to process the arguments provided in the command line and convert them into ComparisonCriterion instances.

Author:
Linda Briesemeister
  • Field Summary

    Fields inherited from class org.kohsuke.args4j.spi.OptionHandler

    option, owner, setter
  • Constructor Summary

    Constructors
    Constructor
    Description
    CriterionOptionHandler(org.kohsuke.args4j.CmdLineParser parser, org.kohsuke.args4j.OptionDef option, org.kohsuke.args4j.spi.Setter<? super ComparisonCriterion> setter)
    Constructs a new CriterionOptionHandler with the specified command line parser, option definition, and setter.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the default meta-variable for this option handler.
    int
    parseArguments(org.kohsuke.args4j.spi.Parameters parameters)
    Parses the arguments from the command line and sets the corresponding ComparisonCriterion value.

    Methods inherited from class org.kohsuke.args4j.spi.OptionHandler

    getMetaVariable, getNameAndMeta

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CriterionOptionHandler

      public CriterionOptionHandler(org.kohsuke.args4j.CmdLineParser parser, org.kohsuke.args4j.OptionDef option, org.kohsuke.args4j.spi.Setter<? super ComparisonCriterion> setter)
      Constructs a new CriterionOptionHandler with the specified command line parser, option definition, and setter.
      Parameters:
      parser - the CmdLineParser instance used to parse command-line arguments
      option - the OptionDef that defines the command-line option this handler manages
      setter - the Setter used to set the value of the parsed ComparisonCriterion
  • Method Details

    • parseArguments

      public int parseArguments(org.kohsuke.args4j.spi.Parameters parameters) throws org.kohsuke.args4j.CmdLineException
      Parses the arguments from the command line and sets the corresponding ComparisonCriterion value.

      This method extracts the criterion argument from the parameters and uses the ComparisonCriterion.Factory.create(String) method to create a ComparisonCriterion instance.

      Specified by:
      parseArguments in class org.kohsuke.args4j.spi.OptionHandler<ComparisonCriterion>
      Parameters:
      parameters - the command-line parameters to parse
      Returns:
      the number of arguments consumed by this option handler
      Throws:
      org.kohsuke.args4j.CmdLineException - if there is an error parsing the arguments
    • getDefaultMetaVariable

      public String getDefaultMetaVariable()
      Returns the default meta-variable for this option handler.

      The meta-variable is used in the help message to represent the option value.

      Specified by:
      getDefaultMetaVariable in class org.kohsuke.args4j.spi.OptionHandler<ComparisonCriterion>
      Returns:
      the default meta-variable for this option handler, which is "CRIT"