File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\cli\declarative\CLIMethod.java.html

1 /*
2 * The MIT License
3 *
4 * Copyright (c) 2004-2009, Sun Microsystems, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24 package hudson.cli.declarative;
25
26 import hudson.cli.CLICommand;
27 import hudson.util.ListBoxModel.Option;
28 import org.jvnet.hudson.annotation_indexer.Indexed;
29 import org.kohsuke.args4j.Argument;
30
31 import java.lang.annotation.Documented;
32 import static java.lang.annotation.ElementType.METHOD;
33 import java.lang.annotation.Retention;
34 import static java.lang.annotation.RetentionPolicy.RUNTIME;
35 import java.lang.annotation.Target;
36
37 /**
38 * Annotates methods on model objects to expose them as CLI commands.
39 *
40 * <p>
41 * You need to have <tt>Messages.properties</tt> in the same package with the
42 * <tt>CLI.<i>command-name</i>.shortDescription</tt> key to describe the command.
43 * This is used for the same purpose as {@link CLICommand#getShortDescription()}.
44 *
45 * <p>
46 * If you put a {@link CLIMethod} on an instance method (as opposed to a static method),
47 * you need a corresponding {@linkplain CLIResolver CLI resolver method}.
48 *
49 * <p>
50 * A CLI method can have its parameters annotated with {@link Option} and {@link Argument},
51 * to receive parameter/argument injections.
52 *
53 * <p>
54 * A CLI method needs to be public.
55 *
56 * @author Kohsuke Kawaguchi
57 * @see CLICommand
58 * @since 1.321
59 */
60 @Indexed
61 @Retention(RUNTIME)
62 @Target({METHOD})
63 @Documented
64 public @interface CLIMethod {
65 /**
66 * CLI command name. Used as {@link CLICommand#getName()}
67 */
68 String name();
69
70 /**
71 *
72 */
73 boolean usesChannel() default false;
74 }
75