public class OValValidationInterceptor extends MethodFilterInterceptor
Modifier and Type | Field and Description |
---|---|
protected static String |
ALT_VALIDATE_PREFIX |
protected boolean |
alwaysInvokeValidate |
protected boolean |
programmatic |
protected TextProviderFactory |
textProviderFactory |
protected static String |
VALIDATE_PREFIX |
protected boolean |
validateJPAAnnotations |
protected OValValidationManager |
validationManager |
excludeMethods, includeMethods
Constructor and Description |
---|
OValValidationInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.struts2.oval.interceptor.OValValidationInterceptor.ValidationError |
buildValidationError(net.sf.oval.ConstraintViolation violation,
String message)
Get field name and message, used to add the validation error to fieldErrors
|
protected 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(Object action,
ValueStack valueStack,
String methodName,
String context) |
void |
setAlwaysInvokeValidate(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 |
setTextProviderFactory(TextProviderFactory textProviderFactory) |
void |
setValidateJPAAnnotations(String validateJPAAnnotations)
Enable OVal support for JPA
|
void |
setValidationManager(OValValidationManager validationManager) |
applyInterceptor, getExcludeMethodsSet, getIncludeMethodsSet, intercept, setExcludeMethods, setIncludeMethods
destroy, init
protected static final String VALIDATE_PREFIX
protected static final String ALT_VALIDATE_PREFIX
protected boolean alwaysInvokeValidate
protected boolean programmatic
protected OValValidationManager validationManager
protected boolean validateJPAAnnotations
protected TextProviderFactory textProviderFactory
public void setValidationManager(OValValidationManager validationManager)
public void setTextProviderFactory(TextProviderFactory textProviderFactory)
public void setValidateJPAAnnotations(String validateJPAAnnotations)
public void setProgrammatic(boolean programmatic)
Validateable
's validate()
should be called,
as well as methods whose name that start with "validate". Defaults to "true".programmatic
- true then validate()
is invoked.public void setAlwaysInvokeValidate(String alwaysInvokeValidate)
Validateable
's validate()
should always
be invoked. Default to "true".alwaysInvokeValidate
- true then validate()
is always invoked.protected String doIntercept(ActionInvocation invocation) throws Exception
doIntercept
in class MethodFilterInterceptor
Exception
protected void performOValValidation(Object action, ValueStack valueStack, String methodName, String context) throws NoSuchMethodException
NoSuchMethodException
protected org.apache.struts2.oval.interceptor.OValValidationInterceptor.ValidationError buildValidationError(net.sf.oval.ConstraintViolation violation, String message)
protected boolean isActionError(net.sf.oval.ConstraintViolation violation)
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.