<dependency> <groupId>com.github.llorllale</groupId> <artifactId>yamlesque</artifactId> <version>1.0.0</version> </dependency> public class AppConfig { @YamlField("server.host") private String host; @YamlField("server.port") private int port; // getter and setter methods } YamlReader reader = new YamlReader(); AppConfig config = reader.loadAs("config.yaml", AppConfig.class); yaml server: host: localhost port: 8080


上一篇:
下一篇:
切换中文