Class JsUtils
java.lang.Object
io.github.jeemv.springboot.vuejs.utilities.JsUtils
JsUtils This class is part of springBoot-VueJS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static <T> T
jsonStringToObject
(String jsonString, Class<T> clazz) static String
loadJsFile
(String filename) static String
Returns a JSON string from an object, using defined serializersstatic String
wrapScript
(String script)
-
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
-
wrapScript
-
loadJsFile
- Throws:
IOException
-