Class Utils

java.lang.Object
com.contentstack.utils.Utils

public class Utils extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Object
    jsonToHTML(@NotNull org.json.JSONArray jsonRTE, Option renderOption, org.json.JSONObject embeddeditems)
     
    static void
    jsonToHTML(@NotNull org.json.JSONArray entryArray, @NotNull String[] keyPath, @NotNull Option option)
    Json to html.
    static String
    jsonToHTML(@NotNull org.json.JSONObject jsonRTE, Option renderOption, org.json.JSONObject embeddeditems)
    Converts jsonRTE to String
    static void
    jsonToHTML(@NotNull org.json.JSONObject entry, @NotNull String[] keyPath, Option renderOption)
    Json to html.
    void
    render(@NotNull org.json.JSONArray jsonArray, @NotNull String[] keyPath, @NotNull Option renderObject)
    Render.
    static void
    render(org.json.JSONObject entryObj, String[] pathString, Option renderObject)
    Render.
    static String
    renderContent(String rteStringify, org.json.JSONObject embedObject, Option option)
    Render content string.
    static org.json.JSONArray
    renderContents(org.json.JSONArray rteArray, org.json.JSONObject entryObject, Option option)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • render

      public static void render(org.json.JSONObject entryObj, String[] pathString, Option renderObject)
      Render.
      Parameters:
      entryObj - the entry obj
      pathString - the key path
      renderObject - the render object
    • renderContent

      public static String renderContent(String rteStringify, org.json.JSONObject embedObject, Option option)
      Render content string.
      Parameters:
      rteStringify - the rte stringify
      embedObject - the embed object
      option - 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 array
      keyPath - the key path
      option - 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 entry
      keyPath - the key path
      renderOption - 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 object JSONObject
      renderOption - The Option Interface
      embeddeditems - The Embedded Objects JSONObject
      Returns:
      String
    • jsonToHTML

      public static Object jsonToHTML(@NotNull @NotNull org.json.JSONArray jsonRTE, Option renderOption, org.json.JSONObject embeddeditems)
      Parameters:
      jsonRTE - The JsonRTE Array JSONArray
      renderOption - The Option Interface
      embeddeditems - The Embedded Objects JSONObject
      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 array
      keyPath - the key path
      renderObject - the render object