This shows how to load data defined in a json resource into a local variable, in JavaScript code.
The snippet.js
loads the content of a baroData.json
resource into a variable named graphData
.
Enjoy!
This is just an example, a suggestion, a "generic" way to do the job.
Like when you have the possibility to add those parameters to your command line, like in
$ java -cp archive.jar sample.SampleMain --first-prm:value01 --second-prm:123 --third-prm:true
The goal here is to show a way to parse those parameter and extract the expected values, for the rest of the process to use them.
Look into the code, how we are using BiConsumer<String, CLIPrm>
. The parsing itself happens in the main
method, obviously.