Class JsonCodec


  • public class JsonCodec
    extends java.lang.Object
    SockJS requires a special JSON codec - it requires that many other characters, over and above what is required by the JSON spec are escaped. To satisfy this we escape any character that escapable with short escapes and any other non ASCII character we unicode escape it
    Author:
    Tim Fox
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonCodec()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object decodeValue​(java.lang.String str, java.lang.Class<?> clazz)  
      static java.lang.String encode​(java.lang.Object obj)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonCodec

        public JsonCodec()
    • Method Detail

      • encode

        public static java.lang.String encode​(java.lang.Object obj)
      • decodeValue

        public static java.lang.Object decodeValue​(java.lang.String str,
                                                   java.lang.Class<?> clazz)