Edit: I’ve changed the style of the json file to make it simpler as I couldn’t work with the older version. I need to be able to create an array of targets in java where each element in the array has its name as the value of Target_Name. I also need to be able to merge together repeating target names that have different object names. So basically I want a target array and within each element I want to have an array of objects holding Type, Pin_number and capabilities.
I know I may have to create a Target list class and within that variables for target name and everything else. I have tried something like that before but I had trouble figuring out how it would work.
{
"Targets": [
{
"Target_Name": "----",
"Object_Name": "----",
"Type": "----",
"Pin_Number": "----",
"Capabilities": "----"
},
{
"Target_Name": "----",
"Object_Name": "----",
"Type": "----",
"Pin_Number": "----",
"Capabilities": "----"
},
{
"Target_Name": "----",
"Object_Name": "----",
"Type": "----",
"Pin_Number": "----",
"Capabilities": "----"
},
{
"Target_Name": "----",
"Object_Name": "----",
"Type": "----",
"Pin_Number": "----",
"Capabilities": "----"
}
]
}
It’s pretty straight forward, following is some code how to load and read nodes. It will help you to find out how to query your data.
// your json parsing is going to look like following
// Examples of how to read values and query objects