Skip to content

Commit 8d97c53

Browse files
committed
add header annotation
1 parent b8cdc1f commit 8d97c53

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

core/src/main/java/net/j4c0b3y/api/config/StaticConfig.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ public StaticConfig(File file, ConfigHandler handler) {
114114
* @return The header to be shown at the top of the document file.
115115
*/
116116
public List<String> getHeader() {
117-
return Collections.emptyList();
117+
Header header = getClass().getAnnotation(Header.class);
118+
if (header == null) return Collections.emptyList();
119+
120+
return Arrays.asList(header.value());
118121
}
119122

120123
/**
@@ -497,4 +500,10 @@ private String getRoute(Key key, String name) {
497500
@Target({ElementType.TYPE})
498501
protected @interface Manual {
499502
}
503+
504+
@Retention(RetentionPolicy.RUNTIME)
505+
@Target({ElementType.TYPE})
506+
public @interface Header {
507+
String[] value();
508+
}
500509
}

0 commit comments

Comments
 (0)