Hi
You can achieve this by :-
Option 1
Link:- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/org/apache/sling/commons/json/jcr/JsonJcr...
There is a Class, JsonJcrNode, this class makes it easy to create a json object out of a JCR node.
//
public class JsonJcrNode
- extends JSONObject
This class makes it easy to create a JSON object out of a JCR node. It is a shameless copy of JsonItemWriter
, but instead of writing the resulting JSON directly to an output, you get a JSONObject that you can deal with.
Option 2
Link:- https://docs.adobe.com/docs/en/aem/6-1/develop/components/pageinfo.html
//Obtaining page information in json Format
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Kautuk Sahni