A CF/Lucee example of readding yaml file using jyaml.jar
- jyaml.jar
- https://github.com/bibliocommons/jyaml - Forked and hosted in GitHub
- https://sourceforge.net/projects/jyaml/files/ - The original one hosted in SourceForge
- JavaLoader.cfc
// Load jyml.jar with JavaLoader
javaloader = createObject("component", "javaloader.JavaLoader").init( expandPath("./jyaml-1.3.jar") );
// Create jyml class
yaml = javaloader.create("org.ho.yaml.Yaml");
dataFile = createObject("java", "java.io.File").init( expandPath("./data.yml") );
data = yaml.load(dataFile);
// This works
WriteDump( data["name"] );
// This will throw error
WriteDump( data.name );