java - Is it possible to obtain an yaml property at runtime? -


yaml convenient because getting nice deserialization yaml java in case need able obtain property value @ runtime. there way accomplish if using .properties file instead, example, having property key value?

appname: myappname 

here i'd obtain myappname value @ runtime using snakeyaml library.

yes yaml.load() returns java object can cast appropriate type , need:

    yaml yaml = new yaml();     string input = "{appname: myappname, appversion: myappverison}";     map yamlmap = (map)yaml.load(input);     assertequals("myappname", yamlmap.get("appname")); 

Comments