sunlabs.brazil.sunlabs
Class JSONConverter
java.lang.Object
sunlabs.brazil.sunlabs.JSONConverter (view source)
- All Implemented Interfaces:
- MiscTemplate.Convert
public class JSONConverter
- extends Object
- implements MiscTemplate.Convert
String converter for MiscTemplate to do JSON escaping.
Protect special JSON characters (except unicode, for now).
- add '\' in front of ("), (/), and (\)
- use C convensions for \t \n \f \r \b
JSONConverter
public JSONConverter()
convert
public String convert(RewriteContext hr,
String name,
String value)
- Description copied from interface:
MiscTemplate.Convert
- Convert a string to a string:
- Specified by:
convert
in interface MiscTemplate.Convert
- Parameters:
hr
- Rewrite context at the <stringop> tag.name
- The converter namevalue
- The converted string