net.sf.json.util
Class WebHijackPreventionStrategy

java.lang.Object
  extended by net.sf.json.util.WebHijackPreventionStrategy

public abstract class WebHijackPreventionStrategy
extends Object

Defines base implementations for preventing WebHijack in AJAX applications. The default implementations are:

Author:
Andres Almiray

Field Summary
static WebHijackPreventionStrategy COMMENTS
          Wraps the string with /* *\/
static WebHijackPreventionStrategy INFINITE_LOOP
          Prepends "while(1);"
 
Constructor Summary
WebHijackPreventionStrategy()
           
 
Method Summary
abstract  String protect(String str)
          Transforms the input with the desired strategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMENTS

public static final WebHijackPreventionStrategy COMMENTS
Wraps the string with /* *\/


INFINITE_LOOP

public static final WebHijackPreventionStrategy INFINITE_LOOP
Prepends "while(1);"

Constructor Detail

WebHijackPreventionStrategy

public WebHijackPreventionStrategy()
Method Detail

protect

public abstract String protect(String str)
Transforms the input with the desired strategy.

Parameters:
str - a json string
Returns:
String - the transformed json string