com.opensymphony.webwork.interceptor
Class WebWorkConversionErrorInterceptor

java.lang.Object
  extended bycom.opensymphony.xwork.interceptor.AroundInterceptor
      extended bycom.opensymphony.xwork.interceptor.ConversionErrorInterceptor
          extended bycom.opensymphony.webwork.interceptor.WebWorkConversionErrorInterceptor
All Implemented Interfaces:
com.opensymphony.xwork.interceptor.Interceptor

public class WebWorkConversionErrorInterceptor
extends com.opensymphony.xwork.interceptor.ConversionErrorInterceptor

This interceptor adds the conversion errors from the ActionContext to the field errors of the Action if the field value is not null, "", or {""} (a size 1 String array with only an empty String).

Author:
Jason Carreira
See Also:
ActionContext.getConversionErrors(), ConversionErrorInterceptor

Field Summary
 
Fields inherited from class com.opensymphony.xwork.interceptor.ConversionErrorInterceptor
ORIGINAL_PROPERTY_OVERRIDE
 
Fields inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
log
 
Constructor Summary
WebWorkConversionErrorInterceptor()
           
 
Method Summary
protected  Object getOverrideExpr(com.opensymphony.xwork.ActionInvocation invocation, Object value)
           
protected  boolean shouldAddError(String propertyName, Object value)
          Returns false if the value is null, "", or {""} (array of size 1 with a blank element).
 
Methods inherited from class com.opensymphony.xwork.interceptor.ConversionErrorInterceptor
after, before
 
Methods inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
destroy, init, intercept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebWorkConversionErrorInterceptor

public WebWorkConversionErrorInterceptor()
Method Detail

getOverrideExpr

protected Object getOverrideExpr(com.opensymphony.xwork.ActionInvocation invocation,
                                 Object value)

shouldAddError

protected boolean shouldAddError(String propertyName,
                                 Object value)
Returns false if the value is null, "", or {""} (array of size 1 with a blank element). Returns true otherwise.

Parameters:
propertyName - the name of the property to check.
value - the value to error check.
Returns:
false if the value is null, "", or {""}, true otherwise.

WebWork Project Page