Class Overview
JSON related utils. Not in JIRA API, as I didn't want to introduce there dependency on Jackson.
Summary
Public Methods |
static
String
|
toJsonString(Object o)
Util for transforming objects of any type (including arrays, standard primitive wrapper types, beans) into a
valid JSON string, which can be directly embedded in <script> section in HTML page.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
Public Methods
public
static
String
toJsonString
(Object o)
Util for transforming objects of any type (including arrays, standard primitive wrapper types, beans) into a
valid JSON string, which can be directly embedded in <script> section in HTML page. Because parsing of
<script> is immediately terminated by web browsers when </ sequence is found (usually </script>
marks the end of script section, but browsers are lazy) this method also escapes each "</" into "<\/"
Parameters
o
| object to convert to JSON string, for null you will get "null" string (without qutoes) |
Returns
- object converted to its JSON representation