Save This Page
Home » struts-2.1.8.1-src » org.apache » struts2 » json » [javadoc | source]
org.apache.struts2.json
public class: JSONInterceptor [javadoc | source]
java.lang.Object
   org.apache.struts2.json.JSONInterceptor

All Implemented Interfaces:
    com.opensymphony.xwork2.interceptor.Interceptor

Populates an action from a JSON string
Method from org.apache.struts2.json.JSONInterceptor Summary:
addCallbackIfApplicable,   destroy,   getCallbackParameter,   getDebug,   init,   intercept,   invoke,   isEnableGZIP,   isEnableSMD,   isExcludeNullProperties,   isNoCache,   setCallbackParameter,   setContentType,   setDebug,   setDefaultEncoding,   setEnableGZIP,   setEnableSMD,   setExcludeNullProperties,   setExcludeProperties,   setIgnoreHierarchy,   setIgnoreSMDMethodInterfaces,   setIncludeProperties,   setJSONCleaner,   setJSONPopulator,   setNoCache,   setPrefix,   setRoot,   setWrapWithComments
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.json.JSONInterceptor Detail:
 protected String addCallbackIfApplicable(HttpServletRequest request,
    String json) 
 public  void destroy() 
 public String getCallbackParameter() 
 public boolean getDebug() 
    Turns debugging on or off
 public  void init() 
 public String intercept(ActionInvocation invocation) throws Exception 
 public RPCResponse invoke(Object object,
    Map data) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, JSONException, InstantiationException, NoSuchMethodException, IntrospectionException 
 public boolean isEnableGZIP() 
 public boolean isEnableSMD() 
 public boolean isExcludeNullProperties() 
 public boolean isNoCache() 
 public  void setCallbackParameter(String callbackParameter) 
 public  void setContentType(String contentType) 
 public  void setDebug(boolean debug) 
 public  void setDefaultEncoding(String val) 
 public  void setEnableGZIP(boolean enableGZIP) 
    Setting this property to "true" will compress the output.
 public  void setEnableSMD(boolean enableSMD) 
 public  void setExcludeNullProperties(boolean excludeNullProperties) 
    Do not serialize properties with a null value
 public  void setExcludeProperties(String commaDelim) 
    Sets a comma-delimited list of regular expressions to match properties that should be excluded from the JSON output.
 public  void setIgnoreHierarchy(boolean ignoreHierarchy) 
    Ignore properties defined on base classes of the root object.
 public  void setIgnoreSMDMethodInterfaces(boolean ignoreSMDMethodInterfaces) 
    Ignore annotations on methods in interfaces You may need to set to this true if your action is a proxy/enhanced as annotations are not inherited
 public  void setIncludeProperties(String commaDelim) 
    Sets a comma-delimited list of regular expressions to match properties that should be included from the JSON output.
 public  void setJSONCleaner(JSONCleaner dataCleaner) 
    Sets the JSONCleaner to be used
 public  void setJSONPopulator(JSONPopulator populator) 
    Sets the JSONPopulator to be used
 public  void setNoCache(boolean noCache) 
    Add headers to response to prevent the browser from caching the response
 public  void setPrefix(boolean prefix) 
    Add "{} && " to generated JSON
 public  void setRoot(String root) 
    Sets the root object to be deserialized, defaults to the Action
 public  void setWrapWithComments(boolean wrapWithComments) 
    Wrap generated JSON with comments. Only used if SMD is enabled.