Class GenericItemOptionHandler<T extends Item>

java.lang.Object
org.kohsuke.args4j.spi.OptionHandler<T>
hudson.cli.handlers.GenericItemOptionHandler<T>
Type Parameters:
T - the kind of item being handled
Direct Known Subclasses:
AbstractItemOptionHandler, AbstractProjectOptionHandler, JobOptionHandler, ParameterizedJobOptionHandler, TopLevelItemOptionHandler

public abstract class GenericItemOptionHandler<T extends Item> extends org.kohsuke.args4j.spi.OptionHandler<T>
Refers to an Item by its name. May be subclassed to handle specific kinds of items. (Use @MetaInfServices(OptionHandler.class) to register the subclass.)
Since:
1.538
  • Field Summary

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

    option, owner, setter
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    GenericItemOptionHandler(org.kohsuke.args4j.CmdLineParser parser, org.kohsuke.args4j.OptionDef option, org.kohsuke.args4j.spi.Setter<T> setter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
    parseArguments(org.kohsuke.args4j.spi.Parameters params)
     
    protected abstract Class<T>
     

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

    getMetaVariable, getNameAndMeta, getNameAndMeta, print, printDefaultValue

    Methods inherited from class java.lang.Object

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

    • GenericItemOptionHandler

      protected GenericItemOptionHandler(org.kohsuke.args4j.CmdLineParser parser, org.kohsuke.args4j.OptionDef option, org.kohsuke.args4j.spi.Setter<T> setter)
  • Method Details

    • type

      protected abstract Class<T> type()
    • parseArguments

      public int parseArguments(org.kohsuke.args4j.spi.Parameters params) throws org.kohsuke.args4j.CmdLineException
      Specified by:
      parseArguments in class org.kohsuke.args4j.spi.OptionHandler<T extends Item>
      Throws:
      org.kohsuke.args4j.CmdLineException
    • getDefaultMetaVariable

      public String getDefaultMetaVariable()
      Specified by:
      getDefaultMetaVariable in class org.kohsuke.args4j.spi.OptionHandler<T extends Item>