Add seed code from Open-O
[cli.git] / framework / src / main / java / org / onap / cli / fw / OnapCommandSchema.java
1 /*
2  * Copyright 2017 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.cli.fw;
18
19 import java.lang.annotation.Documented;
20 import java.lang.annotation.Retention;
21 import java.lang.annotation.RetentionPolicy;
22
23 /**
24  * Provide command name and schema file location, which is placed in the main resources folder (in classpath). It is
25  * recommended to keep the name for schema, in the form of onap-[command-name]-schema.yaml, considered this format as
26  * default if the schema declaration is missing for a command abc-create, schema file name could be
27  * abc-create-schema.yaml, corresponding command would like as below
28  *
29  * @OnapCommandSchema(name="abc-create", schema="onap-abc-create-schema.yaml") public class AbcCreate extends
30  *                                        OnapCommand { ... }
31  */
32 @Retention(RetentionPolicy.RUNTIME)
33 @Documented
34 public @interface OnapCommandSchema {
35     /**
36      * Command name
37      *
38      * @return
39      */
40     String name();
41
42     /**
43      * Schema file name placed under class path
44      *
45      * @return
46      */
47     String schema() default "";
48 }