Package com.contentstack.utils
Class Utils
java.lang.Object
com.contentstack.utils.Utils
The Utils Class enables few functions like render, renderContent, jsonToHtml, RTE and SRTE to process the entry data
and converts in html format.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectjsonToHTML(@NotNull org.json.JSONArray jsonRTE, Option renderOption, org.json.JSONObject embeddeditems) static voidjsonToHTML(@NotNull org.json.JSONArray entryArray, @NotNull String[] keyPath, @NotNull Option option) Json to html.static StringjsonToHTML(@NotNull org.json.JSONObject jsonRTE, Option renderOption, org.json.JSONObject embeddeditems) Converts jsonRTE to Stringstatic voidjsonToHTML(@NotNull org.json.JSONObject entry, @NotNull String[] keyPath, Option renderOption) Json to html.voidrender(@NotNull org.json.JSONArray jsonArray, @NotNull String[] keyPath, @NotNull Option renderObject) Render.static voidRender.static StringrenderContent(String rteStringify, org.json.JSONObject embedObject, Option option) Render content string.static org.json.JSONArrayrenderContents(org.json.JSONArray rteArray, org.json.JSONObject entryObject, Option option)
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
render
Render.- Parameters:
entryObj- the entry objpathString- the key pathrenderObject- the render object
-
renderContent
public static String renderContent(String rteStringify, org.json.JSONObject embedObject, Option option) Render content string.- Parameters:
rteStringify- the rte stringifyembedObject- the embed objectoption- the option- Returns:
- the string
-
renderContents
public static org.json.JSONArray renderContents(org.json.JSONArray rteArray, org.json.JSONObject entryObject, Option option) -
jsonToHTML
public static void jsonToHTML(@NotNull @NotNull org.json.JSONArray entryArray, @NotNull @NotNull String[] keyPath, @NotNull @NotNull Option option) Json to html.- Parameters:
entryArray- the entry arraykeyPath- the key pathoption- the render option
-
jsonToHTML
public static void jsonToHTML(@NotNull @NotNull org.json.JSONObject entry, @NotNull @NotNull String[] keyPath, Option renderOption) Json to html.- Parameters:
entry- the entrykeyPath- the key pathrenderOption- the render object
-
jsonToHTML
public static String jsonToHTML(@NotNull @NotNull org.json.JSONObject jsonRTE, Option renderOption, org.json.JSONObject embeddeditems) Converts jsonRTE to String- Parameters:
jsonRTE- The JsonRTE objectJSONObjectrenderOption- The Option Interfaceembeddeditems- The Embedded ObjectsJSONObject- Returns:
- String
-
jsonToHTML
public static Object jsonToHTML(@NotNull @NotNull org.json.JSONArray jsonRTE, Option renderOption, org.json.JSONObject embeddeditems) - Parameters:
jsonRTE- The JsonRTE ArrayJSONArrayrenderOption- The Option Interfaceembeddeditems- The Embedded ObjectsJSONObject- Returns:
- String
-
render
public void render(@NotNull @NotNull org.json.JSONArray jsonArray, @NotNull @NotNull String[] keyPath, @NotNull @NotNull Option renderObject) Render.- Parameters:
jsonArray- the json arraykeyPath- the key pathrenderObject- the render object
-