org.apache.struts2.oval.interceptor

## Class OValValidationInterceptor

- java.lang.Object
- - com.opensymphony.xwork2.interceptor.AbstractInterceptor
  - - com.opensymphony.xwork2.interceptor.MethodFilterInterceptor
    - - org.apache.struts2.oval.interceptor.OValValidationInterceptor

- All Implemented Interfaces:
    Interceptor, Serializable

      public class OValValidationInterceptor
      extends MethodFilterInterceptor

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    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`

    - ### Fields inherited from class com.opensymphony.xwork2.interceptor.MethodFilterInterceptor

      `excludeMethods, includeMethods`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OValValidationInterceptor()`

  - ### Method Summary

    Methods
    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)`

    - ### 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 String VALIDATE_PREFIX

      See Also:
        Constant Field Values

    - #### ALT_VALIDATE_PREFIX

          protected static final String ALT_VALIDATE_PREFIX

      See Also:
        Constant Field Values

    - #### alwaysInvokeValidate

          protected boolean alwaysInvokeValidate

    - #### programmatic

          protected boolean programmatic

    - #### validationManager

          protected OValValidationManager validationManager

    - #### validateJPAAnnotations

          protected boolean validateJPAAnnotations

    - #### textProviderFactory

          protected TextProviderFactory textProviderFactory

  - ### Constructor Detail

    - #### OValValidationInterceptor

          public OValValidationInterceptor()

  - ### Method Detail

    - #### setValidationManager

          public void setValidationManager(OValValidationManager validationManager)

    - #### setTextProviderFactory

          public void setTextProviderFactory(TextProviderFactory textProviderFactory)

    - #### setValidateJPAAnnotations

          public void setValidateJPAAnnotations(String validateJPAAnnotations)

      Enable OVal support for 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(String alwaysInvokeValidate)

      Determines if `Validateable`'s `validate()` should always be invoked. Default to "true".
      Parameters:
        `alwaysInvokeValidate` - `true` then `validate()` is always invoked.

    - #### doIntercept

          protected String doIntercept(ActionInvocation invocation)
                                throws Exception

      Specified by:
        `doIntercept` in class `MethodFilterInterceptor`
      Throws:
        `Exception`

    - #### performOValValidation

          protected void performOValValidation(Object action,
                                   ValueStack valueStack,
                                   String methodName,
                                   String context)
                                        throws NoSuchMethodException

      Throws:
        `NoSuchMethodException`

    - #### buildValidationError

          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

    - #### isActionError

          protected boolean isActionError(net.sf.oval.ConstraintViolation violation)

      Decide if a violation should be added to the fieldErrors or actionErrors

Copyright © 2000–2018 Apache Software Foundation. All rights reserved.