diff --git a/README.md b/README.md index a0cd93e..8be1c8d 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ public class Sample { @HeaderComment("Configure your name!") // Header comment ConfiguredValue NAME = ConfiguredValue.of("Joker"); + @ConfigPath("year") // Custom path ConfiguredValue AGE = ConfiguredValue.of(24); } @@ -89,7 +90,7 @@ enabled: true # Enabled? info: # Configure your name! name: Joker - age: 24 + year: 24 ``` ### Dependencies diff --git a/README_CN.md b/README_CN.md index 87ed2cb..01b0427 100644 --- a/README_CN.md +++ b/README_CN.md @@ -56,6 +56,7 @@ public class Sample { @HeaderComment("Configure your name!") // 头部注释 ConfiguredValue NAME = ConfiguredValue.of("Joker"); + @ConfigPath("year") // 自定义配置路径,若不定义,则按照默认规则生成 ConfiguredValue AGE = ConfiguredValue.of(24); } } @@ -81,7 +82,7 @@ enabled: true # Enabled? info: # Configure your name! name: Joker - age: 24 + year: 24 ``` ### 依赖方式 diff --git a/impl/yaml/src/test/java/config/Sample.java b/impl/yaml/src/test/java/config/Sample.java index b8dd35b..ddb90f3 100644 --- a/impl/yaml/src/test/java/config/Sample.java +++ b/impl/yaml/src/test/java/config/Sample.java @@ -2,6 +2,7 @@ package config; import cc.carm.lib.configuration.EasyConfiguration; import cc.carm.lib.configuration.core.Configuration; +import cc.carm.lib.configuration.core.annotation.ConfigPath; import cc.carm.lib.configuration.core.annotation.HeaderComment; import cc.carm.lib.configuration.core.annotation.InlineComment; import cc.carm.lib.configuration.core.source.ConfigurationProvider; @@ -18,7 +19,8 @@ public class Sample { interface INFO extends Configuration { @HeaderComment("Configure your name!") // Header comment ConfiguredValue NAME = ConfiguredValue.of("Joker"); - + + @ConfigPath("year") // Custom path ConfiguredValue AGE = ConfiguredValue.of(24); }