com.elasticpath.sfweb.ajax.validation
Class DwrValidationInterceptor

java.lang.Object
  extended by com.elasticpath.sfweb.ajax.validation.DwrValidationInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class DwrValidationInterceptor
extends java.lang.Object
implements org.aopalliance.intercept.MethodInterceptor

Provides validation for Ajax through DWR.


Constructor Summary
DwrValidationInterceptor()
           
 
Method Summary
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
          Validate the arguments to service calls if it is a domain object.
 void setDefaultBeanValidator(org.springmodules.commons.validator.DefaultBeanValidator defaultBeanValidator)
          Set the validator.
 void validate(java.lang.Object object)
          Validate the object sent via dwr.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DwrValidationInterceptor

public DwrValidationInterceptor()
Method Detail

invoke

public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
                        throws java.lang.Throwable
Validate the arguments to service calls if it is a domain object.

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Parameters:
methodInvocation - the method invocation to be intercepted and validated
Returns:
the return value of the intercepted method
Throws:
java.lang.Throwable - on error

setDefaultBeanValidator

public void setDefaultBeanValidator(org.springmodules.commons.validator.DefaultBeanValidator defaultBeanValidator)
Set the validator.

Parameters:
defaultBeanValidator - the validator

validate

public void validate(java.lang.Object object)
              throws EpDomainException
Validate the object sent via dwr.

Parameters:
object - the domain or bean object to be validated
Throws:
EpDomainException - if defaultBeanValidator can not be found