Is there some way to parse .java files into JSON format?
Suppose that we have a class that contains different fucntions such as:
public static int getMax(int[] inputArray){
int maxValue = inputArray[0];
for(int i=1;i < inputArray.length;i++){
if(inputArray[i] > maxValue){
maxValue = inputArray[i];
}
}
return maxValue;
}
I would like to parse it so I can store in the JSON file information about this fucntion, such as its name, type, inputs etc.
How is this possible to do? Is there any program or framework that perhaps can do this?
For example, this is what I would like my JSON to contain:
{
"function": [
{
"name":"getMax",
"language": "Java",
"type": "public static int",
"other_info": "whatever"
},
{
"name":"getMin",
"language": "Java",
"type": "public static int",
"other_info": "whatever"
}
]
}
Any info much appreciated!