Skip to content

Commit f4bf77a

Browse files
committed
Task #5: @see, @fixme, @hint, @note, @used now repeatable.
1 parent a50ed90 commit f4bf77a

File tree

12 files changed

+145
-0
lines changed

12 files changed

+145
-0
lines changed

src/main/java/com/github/codestickers/DoNotUse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.lang.annotation.Documented;
44
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Repeatable;
56
import java.lang.annotation.Retention;
67
import java.lang.annotation.RetentionPolicy;
78
import java.lang.annotation.Target;

src/main/java/com/github/codestickers/FixMe.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
ElementType.TYPE_PARAMETER,
1818
ElementType.TYPE_USE})
1919
@Documented
20+
@Repeatable(FixMes.class)
2021
public @interface FixMe {
2122
String value() default "";
2223
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.github.codestickers;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* A container for annotation repetition.
11+
*/
12+
@Retention(RetentionPolicy.CLASS)
13+
@Target({ElementType.TYPE,
14+
ElementType.FIELD,
15+
ElementType.METHOD,
16+
ElementType.PARAMETER,
17+
ElementType.CONSTRUCTOR,
18+
ElementType.LOCAL_VARIABLE,
19+
ElementType.ANNOTATION_TYPE,
20+
ElementType.PACKAGE,
21+
ElementType.TYPE_PARAMETER,
22+
ElementType.TYPE_USE})
23+
@Documented
24+
public @interface FixMes
25+
{
26+
FixMe[] value();
27+
}

src/main/java/com/github/codestickers/Hint.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.lang.annotation.Documented;
44
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Repeatable;
56
import java.lang.annotation.Retention;
67
import java.lang.annotation.RetentionPolicy;
78
import java.lang.annotation.Target;
@@ -21,6 +22,7 @@
2122
ElementType.TYPE_PARAMETER,
2223
ElementType.TYPE_USE})
2324
@Documented
25+
@Repeatable(Hints.class)
2426
public @interface Hint {
2527
String value() default "";
2628
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.github.codestickers;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* A container for annotation repetition.
11+
*/
12+
@Retention(RetentionPolicy.CLASS)
13+
@Target({ElementType.TYPE,
14+
ElementType.FIELD,
15+
ElementType.METHOD,
16+
ElementType.PARAMETER,
17+
ElementType.CONSTRUCTOR,
18+
ElementType.LOCAL_VARIABLE,
19+
ElementType.ANNOTATION_TYPE,
20+
ElementType.PACKAGE,
21+
ElementType.TYPE_PARAMETER,
22+
ElementType.TYPE_USE})
23+
@Documented
24+
public @interface Hints
25+
{
26+
Hint[] value();
27+
}

src/main/java/com/github/codestickers/Note.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.lang.annotation.Documented;
44
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Repeatable;
56
import java.lang.annotation.Retention;
67
import java.lang.annotation.RetentionPolicy;
78
import java.lang.annotation.Target;
@@ -21,6 +22,7 @@
2122
ElementType.TYPE_PARAMETER,
2223
ElementType.TYPE_USE})
2324
@Documented
25+
@Repeatable(Notes.class)
2426
public @interface Note
2527
{
2628
String value() default "";
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.github.codestickers;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* A container for annotation repetition.
11+
*/
12+
@Retention(RetentionPolicy.CLASS)
13+
@Target({ElementType.TYPE,
14+
ElementType.FIELD,
15+
ElementType.METHOD,
16+
ElementType.PARAMETER,
17+
ElementType.CONSTRUCTOR,
18+
ElementType.LOCAL_VARIABLE,
19+
ElementType.ANNOTATION_TYPE,
20+
ElementType.PACKAGE,
21+
ElementType.TYPE_PARAMETER,
22+
ElementType.TYPE_USE})
23+
@Documented
24+
public @interface Notes
25+
{
26+
Note[] value();
27+
}

src/main/java/com/github/codestickers/See.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.lang.annotation.Documented;
44
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Repeatable;
56
import java.lang.annotation.Retention;
67
import java.lang.annotation.RetentionPolicy;
78
import java.lang.annotation.Target;
@@ -21,6 +22,7 @@
2122
ElementType.TYPE_PARAMETER,
2223
ElementType.TYPE_USE})
2324
@Documented
25+
@Repeatable(Sees.class)
2426
public @interface See {
2527
String value() default "";
2628
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.github.codestickers;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* A container for annotation repetition.
11+
*/
12+
@Retention(RetentionPolicy.CLASS)
13+
@Target({ElementType.TYPE,
14+
ElementType.FIELD,
15+
ElementType.METHOD,
16+
ElementType.PARAMETER,
17+
ElementType.CONSTRUCTOR,
18+
ElementType.LOCAL_VARIABLE,
19+
ElementType.ANNOTATION_TYPE,
20+
ElementType.PACKAGE,
21+
ElementType.TYPE_PARAMETER,
22+
ElementType.TYPE_USE})
23+
@Documented
24+
public @interface Sees
25+
{
26+
See[] value();
27+
}

src/main/java/com/github/codestickers/Unused.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.lang.annotation.Documented;
44
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Repeatable;
56
import java.lang.annotation.Retention;
67
import java.lang.annotation.RetentionPolicy;
78
import java.lang.annotation.Target;

0 commit comments

Comments
 (0)