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
ConstructorDescriptionCriterionOptionHandler
(org.kohsuke.args4j.CmdLineParser parser, org.kohsuke.args4j.OptionDef option, org.kohsuke.args4j.spi.Setter<? super ComparisonCriterion> setter) Constructs a newCriterionOptionHandler
with the specified command line parser, option definition, and setter. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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 correspondingComparisonCriterion
value.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 newCriterionOptionHandler
with the specified command line parser, option definition, and setter.- Parameters:
parser
- theCmdLineParser
instance used to parse command-line argumentsoption
- theOptionDef
that defines the command-line option this handler managessetter
- theSetter
used 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 correspondingComparisonCriterion
value.This method extracts the criterion argument from the parameters and uses the
ComparisonCriterion.Factory.create(String)
method to create aComparisonCriterion
instance.- Specified by:
parseArguments
in 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:
getDefaultMetaVariable
in classorg.kohsuke.args4j.spi.OptionHandler<ComparisonCriterion>
- Returns:
- the default meta-variable for this option handler, which is "CRIT"
-