Package net.sf.json.util
Class WebUtils
java.lang.Object
net.sf.json.util.WebUtils
Provides useful methods for working with JSON and web.
- Author:
- Andres Almiray aalmiray@users.sourceforge.net
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Method Details
-
getWebHijackPreventionStrategy
Returns the configured WebHijackPreventionStrategy. -
protect
Transforms the input Json string using the configured WebHijackPreventionStrategy.- Parameters:
json- the input string- Returns:
- String a transformed json string
-
protect
Transforms the input Json string using the configured WebHijackPreventionStrategy.- Parameters:
json- the input stringshrink- if redundant key quotes may be eliminated.- Returns:
- 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.
-