程序包 com.sh.json.util
类 WebUtils
java.lang.Object
com.sh.json.util.WebUtils
Provides useful methods for working with JSON and web.
-
方法概要
修饰符和类型方法说明static WebHijackPreventionStrategyReturns the configured WebHijackPreventionStrategy.static StringTransforms the input Json string using the configured WebHijackPreventionStrategy.static StringTransforms the input Json string using the configured WebHijackPreventionStrategy.static voidSets a WebHijackPreventionStrategy.
Will use default value (WebHijackPreventionStrategy.INFINITE_LOOP) if null.static StringReturns a string represenation of a JSON value.
When an object property name does not contain a space (' ') or a colon (':'), the quotes are omitted.
-
方法详细资料
-
getWebHijackPreventionStrategy
Returns the configured WebHijackPreventionStrategy. -
protect
Transforms the input Json string using the configured WebHijackPreventionStrategy.- 参数:
json- the input string- 返回:
- String a transformed json string
-
protect
Transforms the input Json string using the configured WebHijackPreventionStrategy.- 参数:
json- the input stringshrink- if redundant key quotes may be eliminated.- 返回:
- String a transformed json string
-
setWebHijackPreventionStrategy
Sets a WebHijackPreventionStrategy.
Will use default value (WebHijackPreventionStrategy.INFINITE_LOOP) if null. -
toString
Returns a string represenation of a JSON value.
When an object property name does not contain a space (' ') or a colon (':'), the quotes are omitted. This is done to reduce the amount of bytes sent to a web browser.
USE WITH CAUTION.
-