Package org.apache.struts2.interceptor

# Interface ConditionalInterceptor

All Superinterfaces:
  `Interceptor`, `Serializable`

All Known Implementing Classes:
  `AbstractFileUploadInterceptor`, `AbstractInterceptor`, `ActionFileUploadInterceptor`, `ActionMappingParametersInterceptor`, `AliasInterceptor`, `AnnotationValidationInterceptor`, `AnnotationWorkflowInterceptor`, `ChainingInterceptor`, `CheckboxInterceptor`, `ClearSessionInterceptor`, `CoepInterceptor`, `ConversionErrorInterceptor`, `CookieInterceptor`, `CookieProviderInterceptor`, `CoopInterceptor`, `CreateSessionInterceptor`, `CspInterceptor`, `DateTextFieldInterceptor`, `DebuggingInterceptor`, `DefaultWorkflowInterceptor`, `ExceptionMappingInterceptor`, `ExecuteAndWaitInterceptor`, `FetchMetadataInterceptor`, `HttpMethodInterceptor`, `I18nInterceptor`, `LoggingInterceptor`, `MessageStoreInterceptor`, `MethodFilterInterceptor`, `MockInterceptor`, `ModelDrivenInterceptor`, `MultiselectInterceptor`, `NoOpInterceptor`, `ParameterRemoverInterceptor`, `ParametersInterceptor`, `PrepareInterceptor`, `RolesInterceptor`, `ScopedModelDrivenInterceptor`, `ScopeInterceptor`, `ServletConfigInterceptor`, `StaticParametersInterceptor`, `StrutsConversionErrorInterceptor`, `TokenInterceptor`, `TokenSessionStoreInterceptor`, `ValidationInterceptor`

public interface ConditionalInterceptor extends Interceptor
A marking interface, when implemented allows to conditionally execute a given interceptor within the current action invocation.

Since:
  Struts 6.1.1

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `shouldIntercept(ActionInvocation invocation)`
  Determines if a given interceptor should be executed in the current processing of action invocation.

  ### Methods inherited from interface org.apache.struts2.interceptor.Interceptor

  `destroy, init, intercept`

- ## Method Details

  - ### shouldIntercept

    boolean shouldIntercept(ActionInvocation invocation)
    Determines if a given interceptor should be executed in the current processing of action invocation.
    Parameters:
      `invocation` - current `ActionInvocation` to determine if the interceptor should be executed
    Returns:
      true if the given interceptor should be included in the current action invocation
    Since:
      6.1.1