Skip to content

Commit f2fa290

Browse files
committed
回滚Annotation
1 parent a206033 commit f2fa290

File tree

4 files changed

+186
-0
lines changed

4 files changed

+186
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Copyright (2023, ) Institute of Software, Chinese Academy of Sciences
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+
package io.github.kubesys.client.annotations;
17+
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Retention;
22+
import java.lang.annotation.RetentionPolicy;
23+
import java.lang.annotation.Target;
24+
25+
/**
26+
* @author wuheng@iscas.ac.cn
27+
* @since 2023/07/25
28+
* @version 1.0.0
29+
*
30+
*/
31+
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
32+
@Retention(RetentionPolicy.RUNTIME)
33+
@Documented
34+
public @interface Api {
35+
36+
/**
37+
* @return api description
38+
*/
39+
String desc() default "";
40+
41+
/**
42+
* @return all exceptions
43+
*/
44+
Class<?>[] catches() default {};
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Copyright (2023, ) Institute of Software, Chinese Academy of Sciences
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+
package io.github.kubesys.client.annotations;
17+
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Retention;
22+
import java.lang.annotation.RetentionPolicy;
23+
import java.lang.annotation.Target;
24+
25+
/**
26+
* @author wuheng@iscas.ac.cn
27+
* @since 2023/07/25
28+
* @version 1.0.0
29+
*
30+
*/
31+
@Target({ElementType.METHOD, ElementType.TYPE})
32+
@Retention(RetentionPolicy.RUNTIME)
33+
@Documented
34+
public @interface Catch {
35+
36+
/**
37+
* @return code, see io.github.kubesys.client.exceptions
38+
*/
39+
int code() default -1;
40+
41+
/**
42+
* @return description for a given exception
43+
*/
44+
String desc() default "";
45+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* Copyright (2023, ) Institute of Software, Chinese Academy of Sciences
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+
package io.github.kubesys.client.annotations;
17+
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Retention;
22+
import java.lang.annotation.RetentionPolicy;
23+
import java.lang.annotation.Target;
24+
25+
/**
26+
* @author wuheng@iscas.ac.cn
27+
* @since 2023/07/25
28+
* @version 1.0.0
29+
*
30+
*/
31+
@Target({ElementType.FIELD})
32+
@Retention(RetentionPolicy.RUNTIME)
33+
@Documented
34+
public @interface Env {
35+
36+
/**
37+
* @return description
38+
*/
39+
String desc() default "";
40+
41+
/**
42+
* @return example
43+
*/
44+
String example() default "";
45+
46+
/**
47+
* @return value
48+
*/
49+
String defaultValue() default "";
50+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright (2023, ) Institute of Software, Chinese Academy of Sciences
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+
package io.github.kubesys.client.annotations;
17+
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Retention;
22+
import java.lang.annotation.RetentionPolicy;
23+
import java.lang.annotation.Target;
24+
25+
/**
26+
* @author wuheng@iscas.ac.cn
27+
* @since 2023/07/25
28+
* @version 1.0.0
29+
*
30+
*/
31+
@Target({ElementType.PARAMETER})
32+
@Retention(RetentionPolicy.RUNTIME)
33+
@Documented
34+
public @interface Param {
35+
36+
/**
37+
* @return description
38+
*/
39+
String desc() default "";
40+
41+
/**
42+
* @return regexp
43+
*/
44+
String regexp() default "";
45+
46+
}

0 commit comments

Comments
 (0)