java.lang.Object
io.github.jeemv.springboot.vuejs.utilities.JsUtils

public class JsUtils extends Object
JsUtils This class is part of springBoot-VueJS
  • Constructor Details

    • JsUtils

      public JsUtils()
  • Method Details

    • objectToJSON

      public static String objectToJSON(Object o) throws com.fasterxml.jackson.core.JsonProcessingException
      Returns a JSON string from an object, using defined serializers
      Parameters:
      o - the object to parse
      Returns:
      the JSON string
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • jsonStringToObject

      public static <T> T jsonStringToObject(String jsonString, Class<T> clazz) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
      Throws:
      com.fasterxml.jackson.core.JsonParseException
      com.fasterxml.jackson.databind.JsonMappingException
      IOException
    • cleanJS

      public static String cleanJS(String javascriptCode)
    • wrapScript

      public static String wrapScript(String script)
    • loadJsFile

      public static String loadJsFile(String filename) throws IOException
      Throws:
      IOException