mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 18:48:20 +08:00
feat(comment): Support regex inline comments
This commit is contained in:
+19
@@ -31,4 +31,23 @@ public @interface InlineComment {
|
|||||||
@NotNull
|
@NotNull
|
||||||
String value() default "";
|
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.
|
||||||
|
* <p> e.g. <b>"^foo\\.*\\.bar"</b> will be set like
|
||||||
|
* <blockquote><pre>
|
||||||
|
* foo:
|
||||||
|
* some:
|
||||||
|
* lover: "bar" <- not matched so no comments
|
||||||
|
* bar: "foobar" # Comment Contents
|
||||||
|
* other:
|
||||||
|
* bar: "foobar" # Comment Contents
|
||||||
|
* </pre></blockquote>
|
||||||
|
*
|
||||||
|
* @return The path regexes of this comment
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
String[] regex() default {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user