44import com .contentstack .utils .interfaces .ContentCallback ;
55import com .contentstack .utils .interfaces .MetaToEmbedCallback ;
66import com .contentstack .utils .interfaces .Option ;
7- import org .jetbrains .annotations .NotNull ;
87import org .json .JSONArray ;
98import org .json .JSONObject ;
109import org .jsoup .Jsoup ;
1110import org .jsoup .nodes .Document ;
1211
12+ import javax .validation .constraints .NotNull ;
1313import java .util .ArrayList ;
1414import java .util .Optional ;
1515import java .util .Set ;
2020
2121
2222/**
23- * The Utils Class enables few functions like render, renderContent,
24- * jsonToHtml, RTE and SRTE to process the entry data and converts in html format.
23+ * The Utils Class enables few functions like render, renderContent, jsonToHtml, RTE and SRTE to process the entry data
24+ * and converts in html format.
2525 */
2626public class Utils {
2727
2828
29- final private static Logger logger = Logger .getLogger (Utils .class .getName ());
29+ static final Logger logger = Logger .getLogger (Utils .class .getName ());
3030
3131 /**
3232 * Render.
3333 *
34- * @param entryObj the entry obj
35- * @param pathString the key path
36- * @param renderObject the render object
34+ * @param entryObj
35+ * the entry obj
36+ * @param pathString
37+ * the key path
38+ * @param renderObject
39+ * the render object
3740 */
3841 public static void render (JSONObject entryObj , String [] pathString , Option renderObject ) {
3942
@@ -50,7 +53,7 @@ public static void render(JSONObject entryObj, String[] pathString, Option rende
5053
5154 if (entryObj != null && entryObj .has ("_embedded_items" )) {
5255 // when pathString is provided by user
53- if (pathString != null && pathString .length > 0 ) {
56+ if (pathString != null && pathString .length > 0 ) {
5457 for (String path : pathString ) {
5558 findContent (entryObj , path , callback );
5659 }
@@ -69,9 +72,12 @@ public static void render(JSONObject entryObj, String[] pathString, Option rende
6972 /**
7073 * Render content string.
7174 *
72- * @param rteStringify the rte stringify
73- * @param embedObject the embed object
74- * @param option the option
75+ * @param rteStringify
76+ * the rte stringify
77+ * @param embedObject
78+ * the embed object
79+ * @param option
80+ * the option
7581 * @return the string
7682 */
7783 public static String renderContent (String rteStringify , JSONObject embedObject , Option option ) {
@@ -120,9 +126,12 @@ private static Optional<JSONObject> findEmbeddedItems(JSONObject jsonObject, Met
120126 /**
121127 * Json to html.
122128 *
123- * @param entryArray the entry array
124- * @param keyPath the key path
125- * @param option the render option
129+ * @param entryArray
130+ * the entry array
131+ * @param keyPath
132+ * the key path
133+ * @param option
134+ * the render option
126135 */
127136 public static void jsonToHTML (@ NotNull JSONArray entryArray , @ NotNull String [] keyPath , @ NotNull Option option ) {
128137 entryArray .forEach (jsonObj -> jsonToHTML ((JSONObject ) jsonObj , keyPath , option ));
@@ -132,9 +141,12 @@ public static void jsonToHTML(@NotNull JSONArray entryArray, @NotNull String[] k
132141 /**
133142 * Json to html.
134143 *
135- * @param entry the entry
136- * @param keyPath the key path
137- * @param renderOption the render object
144+ * @param entry
145+ * the entry
146+ * @param keyPath
147+ * the key path
148+ * @param renderOption
149+ * the render object
138150 */
139151 public static void jsonToHTML (@ NotNull JSONObject entry , @ NotNull String [] keyPath , Option renderOption ) {
140152
@@ -162,6 +174,7 @@ public static void jsonToHTML(@NotNull JSONObject entry, @NotNull String[] keyPa
162174
163175 if (keyPath .length > 0 ) {
164176 for (String path : keyPath ) {
177+ logger .info (path );
165178 findContent (entry , path , callback );
166179 }
167180 }
@@ -171,9 +184,12 @@ public static void jsonToHTML(@NotNull JSONObject entry, @NotNull String[] keyPa
171184 /**
172185 * Render.
173186 *
174- * @param jsonArray the json array
175- * @param keyPath the key path
176- * @param renderObject the render object
187+ * @param jsonArray
188+ * the json array
189+ * @param keyPath
190+ * the key path
191+ * @param renderObject
192+ * the render object
177193 */
178194 public void render (@ NotNull JSONArray jsonArray , @ NotNull String [] keyPath , @ NotNull Option renderObject ) {
179195 jsonArray .forEach (jsonObj -> render ((JSONObject ) jsonObj , keyPath , renderObject ));
0 commit comments