Annotation Type CLIResolver


  • @Indexed
    @Retention(RUNTIME)
    @Target(METHOD)
    @Documented
    public @interface CLIResolver
    Annotates a resolver method that binds a portion of the command line arguments and parameters to an instance whose CLIMethod is invoked for the final processing.

    Hudson uses the return type of the resolver method to pick the resolver method to use, of all the resolver methods it discovers. That is, if Hudson is looking to find an instance of type T for the current command, it first looks for the resolver method whose return type is T, then it checks for the base type of T, and so on.

    If the chosen resolver method is an instance method on type S, the "parent resolver" is then located to resolve an instance of type 'S'. This process repeats until a static resolver method is discovered (since most of Hudson's model objects are anchored to the root Jenkins object, normally that would become the top-most resolver method.)

    Parameters of the resolver method receives the same parameter/argument injections that CLIMethods receive. Parameters and arguments consumed by the resolver will not be visible to CLIMethods.

    The resolver method shall never return null — it should instead indicate a failure by throwing CmdLineException.

    Since:
    1.321
    Author:
    Kohsuke Kawaguchi
    See Also:
    CLICommand