com.yworks.yfiles.server.tiles.support
Class JSONSupport
java.lang.Object
com.yworks.yfiles.server.tiles.support.JSONSupport
public class JSONSupport
- extends Object
Provides static utility methods for JSON encoding
- See Also:
- JSON Spec
|
Method Summary |
static String |
escapeString(String str)
Escapes the given string according to the JSON format specification. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
escapeString
public static String escapeString(String str)
- Escapes the given string according to the JSON format specification.
This method also surrounds the string with double quotes.
For transferring unicode characters, the respone content type has to be set
accordingly, e.g.
response.setContentType("text/plain;charset=UTF-8");.
- Parameters:
str - The string to be escaped.
- Returns:
- The escaped string that can be used as a value in a JSON object.
Copyright © 2006-2008 yWorks GmbH. All rights reserved