mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 18:48:20 +08:00
docs(sponsor): Add sponsors banner
This commit is contained in:
@@ -256,6 +256,11 @@ Many thanks to Jetbrains for kindly providing a license for us to work on this a
|
|||||||
|
|
||||||
[](https://www.jetbrains.com/?from=https://github.com/CarmJos/EasyConfiguration)
|
[](https://www.jetbrains.com/?from=https://github.com/CarmJos/EasyConfiguration)
|
||||||
|
|
||||||
|
Many thanks to [ArtformGames](https://github.com/ArtformGames) for their
|
||||||
|
strong support and active contribution to this project!
|
||||||
|
|
||||||
|
[](https://www.artform.cn/)
|
||||||
|
|
||||||
## Open Source License
|
## Open Source License
|
||||||
|
|
||||||
This project's source code is licensed under
|
This project's source code is licensed under
|
||||||
|
|||||||
+29
-23
@@ -32,47 +32,49 @@ README LANGUAGES [ [English](README.md) | [**中文**](README_CN.md) ]
|
|||||||
|
|
||||||
## 开发
|
## 开发
|
||||||
|
|
||||||
详细开发介绍请 [点击这里](.doc/README.md) , JavaDoc(最新Release) 请 [点击这里](https://CarmJos.github.io/EasyConfiguration) 。
|
详细开发介绍请 [点击这里](.doc/README.md) , JavaDoc(最新Release)
|
||||||
|
请 [点击这里](https://CarmJos.github.io/EasyConfiguration) 。
|
||||||
|
|
||||||
### 示例代码
|
### 示例代码
|
||||||
|
|
||||||
为快速的展示该项目的适用性,这里有几个实际演示:
|
为快速的展示该项目的适用性,这里有几个实际演示:
|
||||||
|
|
||||||
- [数据库配置文件实例](demo/src/main/java/cc/carm/lib/configuration/demo/DatabaseConfiguration.java)
|
- [数据库配置文件实例](demo/src/main/java/cc/carm/lib/configuration/demo/DatabaseConfiguration.java)
|
||||||
- [全种类配置实例类演示](demo/src/main/java/cc/carm/lib/configuration/demo/tests/conf/DemoConfiguration.java)
|
- [全种类配置实例类演示](demo/src/main/java/cc/carm/lib/configuration/demo/tests/conf/DemoConfiguration.java)
|
||||||
|
|
||||||
您可以 [点击这里](demo/src/main/java/cc/carm/lib/configuration/demo) 直接查看现有的代码演示,更多复杂情况演示详见 [开发介绍](.doc/README.md) 。
|
您可以 [点击这里](demo/src/main/java/cc/carm/lib/configuration/demo)
|
||||||
|
直接查看现有的代码演示,更多复杂情况演示详见 [开发介绍](.doc/README.md) 。
|
||||||
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
|
||||||
@ConfigPath(root = true)
|
@ConfigPath(root = true)
|
||||||
@HeaderComments("Configurations for sample")
|
@HeaderComments("Configurations for sample")
|
||||||
public interface SampleConfig extends Configuration {
|
public interface SampleConfig extends Configuration {
|
||||||
|
|
||||||
@InlineComment("Enabled?") // 行后注释
|
@InlineComment("Enabled?") // 行后注释
|
||||||
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
|
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
|
||||||
|
|
||||||
@HeaderComments("Server configurations") // 头部注释
|
@HeaderComments("Server configurations") // 头部注释
|
||||||
ConfiguredValue<Integer> PORT = ConfiguredValue.of(Integer.class);
|
ConfiguredValue<Integer> PORT = ConfiguredValue.of(Integer.class);
|
||||||
|
|
||||||
@HeaderComments({"[ UUID >-----------------------------------", "A lot of UUIDs"})
|
@HeaderComments({"[ UUID >-----------------------------------", "A lot of UUIDs"})
|
||||||
@FooterComments("[ UUID >-----------------------------------")
|
@FooterComments("[ UUID >-----------------------------------")
|
||||||
ConfiguredList<UUID> UUIDS = ConfiguredList.builderOf(UUID.class).fromString()
|
ConfiguredList<UUID> UUIDS = ConfiguredList.builderOf(UUID.class).fromString()
|
||||||
.parse(UUID::fromString).serialize(UUID::toString)
|
.parse(UUID::fromString).serialize(UUID::toString)
|
||||||
.defaults(
|
.defaults(
|
||||||
UUID.fromString("00000000-0000-0000-0000-000000000000"),
|
UUID.fromString("00000000-0000-0000-0000-000000000000"),
|
||||||
UUID.fromString("00000000-0000-0000-0000-000000000001")
|
UUID.fromString("00000000-0000-0000-0000-000000000001")
|
||||||
).build();
|
).build();
|
||||||
|
|
||||||
interface INFO extends Configuration {
|
interface INFO extends Configuration {
|
||||||
|
|
||||||
@HeaderComments("Configure your name!") // Header comment
|
@HeaderComments("Configure your name!") // Header comment
|
||||||
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
||||||
|
|
||||||
@ConfigPath("how-old-are-you") // 自定义路径
|
@ConfigPath("how-old-are-you") // 自定义路径
|
||||||
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +246,7 @@ dependencies {
|
|||||||
//基于YAML文件的实现版本,可用于全部Java环境。
|
//基于YAML文件的实现版本,可用于全部Java环境。
|
||||||
api "cc.carm.lib:easyconfiguration-yaml:[LATEST RELEASE]"
|
api "cc.carm.lib:easyconfiguration-yaml:[LATEST RELEASE]"
|
||||||
|
|
||||||
//基于JSON文件的实现版本,可用于全部Java环境。
|
//基于JSON文件的实现版本,可用于全部Java环境。
|
||||||
//需要注意的是,JSON不支持文件注释。
|
//需要注意的是,JSON不支持文件注释。
|
||||||
api "cc.carm.lib:easyconfiguration-gson:[LATEST RELEASE]"
|
api "cc.carm.lib:easyconfiguration-gson:[LATEST RELEASE]"
|
||||||
|
|
||||||
@@ -276,6 +278,10 @@ EasyConfiguration for MineCraft!
|
|||||||
|
|
||||||
[](https://www.jetbrains.com/?from=https://github.com/CarmJos/EasyConfiguration)
|
[](https://www.jetbrains.com/?from=https://github.com/CarmJos/EasyConfiguration)
|
||||||
|
|
||||||
|
万分感谢来自 [ArtformGames](https://github.com/ArtformGames) 对本项目的大力支持与积极贡献!
|
||||||
|
|
||||||
|
[](https://www.artform.cn/)
|
||||||
|
|
||||||
## 开源协议
|
## 开源协议
|
||||||
|
|
||||||
本项目源码采用 [GNU LESSER GENERAL PUBLIC LICENSE](https://www.gnu.org/licenses/lgpl-3.0.html) 开源协议。
|
本项目源码采用 [GNU LESSER GENERAL PUBLIC LICENSE](https://www.gnu.org/licenses/lgpl-3.0.html) 开源协议。
|
||||||
|
|||||||
Reference in New Issue
Block a user