com.opensymphony.xwork2

## Class DefaultUnknownHandlerManager

- java.lang.Object
- - com.opensymphony.xwork2.DefaultUnknownHandlerManager

- All Implemented Interfaces:
    UnknownHandlerManager

      public class DefaultUnknownHandlerManager
      extends Object
      implements UnknownHandlerManager

  Default implementation of UnknownHandlerManager
  See Also:
    `UnknownHandlerManager`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ArrayList<UnknownHandler>` | `unknownHandlers`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultUnknownHandlerManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `build()` Builds a list of UnknownHandlers in the order specified by the configured "unknown-handler-stack".
    `List<UnknownHandler>` | `getUnknownHandlers()`
    `ActionConfig` | `handleUnknownAction(String namespace, String actionName)` Iterate over UnknownHandlers and return the result of the first one that can handle it
    `Object` | `handleUnknownMethod(Object action, String methodName)` Iterate over UnknownHandlers and return the result of the first one that can handle it.
    `Result` | `handleUnknownResult(ActionContext actionContext, String actionName, ActionConfig actionConfig, String resultCode)` Iterate over UnknownHandlers and return the result of the first one that can handle it
    `boolean` | `hasUnknownHandlers()`
    `void` | `setContainer(Container container)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### unknownHandlers

          protected ArrayList<UnknownHandler> unknownHandlers

  - ### Constructor Detail

    - #### DefaultUnknownHandlerManager

          public DefaultUnknownHandlerManager()

  - ### Method Detail

    - #### setContainer

          public void setContainer(Container container)

    - #### build

          protected void build()
                        throws Exception

      Builds a list of UnknownHandlers in the order specified by the configured "unknown-handler-stack". If "unknown-handler-stack" was not configured, all UnknownHandlers will be returned, in no specific order
      Throws:
        `Exception` - in case of any error

    - #### handleUnknownResult

          public Result handleUnknownResult(ActionContext actionContext,
                                   String actionName,
                                   ActionConfig actionConfig,
                                   String resultCode)

      Iterate over UnknownHandlers and return the result of the first one that can handle it
      Specified by:
        `handleUnknownResult` in interface `UnknownHandlerManager`
      Parameters:
        `actionContext` - the action context
        `actionName` - the action name
        `actionConfig` - the action config
        `resultCode` - the result code

    - #### handleUnknownMethod

          public Object handleUnknownMethod(Object action,
                                   String methodName)
                                     throws NoSuchMethodException

      Iterate over UnknownHandlers and return the result of the first one that can handle it. Must throw an exception if method cannot be handled.
      Specified by:
        `handleUnknownMethod` in interface `UnknownHandlerManager`
      Parameters:
        `action` - the action
        `methodName` - the method name
      Returns:
        Result representing result of given action method
      Throws:
        `NoSuchMethodException` - if method con not be handled

    - #### handleUnknownAction

          public ActionConfig handleUnknownAction(String namespace,
                                         String actionName)

      Iterate over UnknownHandlers and return the result of the first one that can handle it
      Specified by:
        `handleUnknownAction` in interface `UnknownHandlerManager`
      Parameters:
        `namespace` - the namespace
        `actionName` - the action name

    - #### hasUnknownHandlers

          public boolean hasUnknownHandlers()

      Specified by:
        `hasUnknownHandlers` in interface `UnknownHandlerManager`

    - #### getUnknownHandlers

          public List<UnknownHandler> getUnknownHandlers()

      Specified by:
        `getUnknownHandlers` in interface `UnknownHandlerManager`

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