sunlabs.brazil.sunlabs
Class JSONConverter

java.lang.Object
  extended by 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


Constructor Summary
JSONConverter()
           
 
Method Summary
 String convert(RewriteContext hr, String name, String value)
          Convert a string to a string:
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONConverter

public JSONConverter()
Method Detail

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 name
value - The converted string

Version Kenai-svn-r24, Generated 08/18/09
Copyright (c) 2001-2009, Sun Microsystems.