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
ConstructorsConstructorDescriptionCriterionOptionHandler(org.kohsuke.args4j.CmdLineParser parser, org.kohsuke.args4j.OptionDef option, org.kohsuke.args4j.spi.Setter<? super ComparisonCriterion> setter) Constructs a newCriterionOptionHandlerwith the specified command line parser, option definition, and setter. -
Method Summary
Modifier and TypeMethodDescriptionReturns the default meta-variable for this option handler.intparseArguments(org.kohsuke.args4j.spi.Parameters parameters) Parses the arguments from the command line and sets the correspondingComparisonCriterionvalue.Methods inherited from class org.kohsuke.args4j.spi.OptionHandler
getMetaVariable, getNameAndMeta
-
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 newCriterionOptionHandlerwith the specified command line parser, option definition, and setter.- Parameters:
parser- theCmdLineParserinstance used to parse command-line argumentsoption- theOptionDefthat defines the command-line option this handler managessetter- theSetterused to set the value of the parsedComparisonCriterion
-
-
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 correspondingComparisonCriterionvalue.This method extracts the criterion argument from the parameters and uses the
ComparisonCriterion.Factory.create(String)method to create aComparisonCriterioninstance.- Specified by:
parseArgumentsin classorg.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
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:
getDefaultMetaVariablein classorg.kohsuke.args4j.spi.OptionHandler<ComparisonCriterion>- Returns:
- the default meta-variable for this option handler, which is "CRIT"
-