diff --git a/features/commentable/src/main/java/cc/carm/lib/configuration/annotation/InlineComment.java b/features/commentable/src/main/java/cc/carm/lib/configuration/annotation/InlineComment.java index d042da4..763f896 100644 --- a/features/commentable/src/main/java/cc/carm/lib/configuration/annotation/InlineComment.java +++ b/features/commentable/src/main/java/cc/carm/lib/configuration/annotation/InlineComment.java @@ -31,4 +31,23 @@ public @interface InlineComment { @NotNull String value() default ""; + /** + * If the regex is not empty, the comment will be added to + * all sub paths if the regex matches the value. + * If the regex is empty, the comment will be added to the current path. + *
e.g. "^foo\\.*\\.bar" will be set like + *
+ * + * @return The path regexes of this comment + */ + @NotNull + String[] regex() default {}; + }+ * foo: + * some: + * lover: "bar" <- not matched so no comments + * bar: "foobar" # Comment Contents + * other: + * bar: "foobar" # Comment Contents + *