org.apache.struts2.oval.interceptor
Class OValValidationInterceptor

java.lang.Object
  extended by com.opensymphony.xwork2.interceptor.AbstractInterceptor
      extended by com.opensymphony.xwork2.interceptor.MethodFilterInterceptor
          extended by org.apache.struts2.oval.interceptor.OValValidationInterceptor
All Implemented Interfaces:
Interceptor, java.io.Serializable

public class OValValidationInterceptor
extends MethodFilterInterceptor

See Also:
Serialized Form

Field Summary
protected static java.lang.String ALT_VALIDATE_PREFIX
           
protected  boolean alwaysInvokeValidate
           
protected  boolean programmatic
           
protected static java.lang.String VALIDATE_PREFIX
           
protected  OValValidationManager validationManager
           
 
Fields inherited from class com.opensymphony.xwork2.interceptor.MethodFilterInterceptor
excludeMethods, includeMethods, log
 
Constructor Summary
OValValidationInterceptor()
           
 
Method Summary
protected  org.apache.struts2.oval.interceptor.OValValidationInterceptor.ValidationError buildValidationError(net.sf.oval.ConstraintViolation violation, java.lang.String message)
          Get field name and message, used to add the validation error to fieldErrors
protected  java.lang.String doIntercept(ActionInvocation invocation)
           
protected  boolean isActionError(net.sf.oval.ConstraintViolation violation)
          Decide if a violation should be added to the fieldErrors or actionErrors
protected  void performOValValidation(java.lang.Object action, ValueStack valueStack, java.lang.String methodName, java.lang.String context)
           
 void setAlwaysInvokeValidate(java.lang.String alwaysInvokeValidate)
          Determines if Validateable's validate() should always be invoked.
 void setProgrammatic(boolean programmatic)
          Determines if Validateable's validate() should be called, as well as methods whose name that start with "validate".
 void setValidateJPAAnnotations(boolean validateJPAAnnotations)
          Enable OVal support fopr JPA
 void setValidationManager(OValValidationManager validationManager)
           
 
Methods inherited from class com.opensymphony.xwork2.interceptor.MethodFilterInterceptor
applyInterceptor, getExcludeMethodsSet, getIncludeMethodsSet, intercept, setExcludeMethods, setIncludeMethods
 
Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor
destroy, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATE_PREFIX

protected static final java.lang.String VALIDATE_PREFIX
See Also:
Constant Field Values

ALT_VALIDATE_PREFIX

protected static final java.lang.String ALT_VALIDATE_PREFIX
See Also:
Constant Field Values

alwaysInvokeValidate

protected boolean alwaysInvokeValidate

programmatic

protected boolean programmatic

validationManager

protected OValValidationManager validationManager
Constructor Detail

OValValidationInterceptor

public OValValidationInterceptor()
Method Detail

setValidationManager

public void setValidationManager(OValValidationManager validationManager)

setValidateJPAAnnotations

public void setValidateJPAAnnotations(boolean validateJPAAnnotations)
Enable OVal support fopr JPA


setProgrammatic

public void setProgrammatic(boolean programmatic)
Determines if Validateable's validate() should be called, as well as methods whose name that start with "validate". Defaults to "true".

Parameters:
programmatic - true then validate() is invoked.

setAlwaysInvokeValidate

public void setAlwaysInvokeValidate(java.lang.String alwaysInvokeValidate)
Determines if Validateable's validate() should always be invoked. Default to "true".

Parameters:
alwaysInvokeValidate - true then validate() is always invoked.

doIntercept

protected java.lang.String doIntercept(ActionInvocation invocation)
                                throws java.lang.Exception
Specified by:
doIntercept in class MethodFilterInterceptor
Throws:
java.lang.Exception

performOValValidation

protected void performOValValidation(java.lang.Object action,
                                     ValueStack valueStack,
                                     java.lang.String methodName,
                                     java.lang.String context)
                              throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

buildValidationError

protected org.apache.struts2.oval.interceptor.OValValidationInterceptor.ValidationError buildValidationError(net.sf.oval.ConstraintViolation violation,
                                                                                                             java.lang.String message)
Get field name and message, used to add the validation error to fieldErrors


isActionError

protected boolean isActionError(net.sf.oval.ConstraintViolation violation)
Decide if a violation should be added to the fieldErrors or actionErrors



Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.