com.opensymphony.xwork2.config.entities

## Class PackageConfig

- java.lang.Object
- - com.opensymphony.xwork2.util.location.Located
  - - com.opensymphony.xwork2.config.entities.PackageConfig

- All Implemented Interfaces:
    InterceptorLocator, Locatable, Serializable, Comparable<PackageConfig>

      public class PackageConfig
      extends Located
      implements Comparable<PackageConfig>, Serializable, InterceptorLocator

  Configuration for Package.

  In the xml configuration file this is defined as the `package` tag.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PackageConfig.Builder` The builder for this object.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<String,ActionConfig>` | `actionConfigs`
    `protected String` | `defaultActionRef`
    `protected String` | `defaultClassRef`
    `protected String` | `defaultInterceptorRef`
    `protected String` | `defaultResultType`
    `protected Set<String>` | `globalAllowedMethods`
    `protected List<ExceptionMappingConfig>` | `globalExceptionMappingConfigs`
    `protected Map<String,ResultConfig>` | `globalResultConfigs`
    `protected Map<String,Object>` | `interceptorConfigs`
    `protected boolean` | `isAbstract`
    `protected boolean` | `isFinal`
    `protected String` | `name`
    `protected String` | `namespace`
    `protected boolean` | `needsRefresh`
    `protected List<PackageConfig>` | `parents`
    `protected Map<String,ResultTypeConfig>` | `resultTypeConfigs`
    `protected boolean` | `strictMethodInvocation`

    - ### Fields inherited from class com.opensymphony.xwork2.util.location.Located

      `location`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PackageConfig(PackageConfig orig)`
    `protected` | `PackageConfig(String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(PackageConfig other)`
    `boolean` | `equals(Object o)`
    `Map<String,ActionConfig>` | `getActionConfigs()`
    `Map<String,ActionConfig>` | `getAllActionConfigs()` returns the Map of all the ActionConfigs available in the current package.
    `List<ExceptionMappingConfig>` | `getAllExceptionMappingConfigs()` returns the List of all the ExceptionMappingConfigs available in the current package.
    `Map<String,ResultConfig>` | `getAllGlobalResults()` returns the Map of all the global ResultConfigs available in the current package.
    `Map<String,Object>` | `getAllInterceptorConfigs()` returns the Map of all InterceptorConfigs and InterceptorStackConfigs available in the current package.
    `Map<String,ResultTypeConfig>` | `getAllResultTypeConfigs()` returns the Map of all the ResultTypeConfigs available in the current package.
    `String` | `getDefaultActionRef()`
    `String` | `getDefaultClassRef()`
    `String` | `getDefaultInterceptorRef()`
    `String` | `getDefaultResultType()`
    `String` | `getFullDefaultActionRef()`
    `String` | `getFullDefaultInterceptorRef()`
    `String` | `getFullDefaultResultType()` Returns the default result type for this package.
    `Set<String>` | `getGlobalAllowedMethods()` gets the GlobalAllowedMethods local to this package
    `List<ExceptionMappingConfig>` | `getGlobalExceptionMappingConfigs()` gets the ExceptionMappingConfigs local to this package
    `Map<String,ResultConfig>` | `getGlobalResultConfigs()` gets the global ResultConfigs local to this package
    `Object` | `getInterceptorConfig(String name)` Gets an interceptor configuration object.
    `Map<String,Object>` | `getInterceptorConfigs()` gets the InterceptorConfigs and InterceptorStackConfigs local to this package
    `String` | `getName()`
    `String` | `getNamespace()`
    `List<PackageConfig>` | `getParents()`
    `Map<String,ResultTypeConfig>` | `getResultTypeConfigs()` gets the ResultTypeConfigs local to this package
    `int` | `hashCode()`
    `boolean` | `isAbstract()`
    `boolean` | `isFinal()`
    `boolean` | `isNeedsRefresh()`
    `boolean` | `isStrictMethodInvocation()`
    `String` | `toString()`

    - ### Methods inherited from class com.opensymphony.xwork2.util.location.Located

      `getLocation, setLocation`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### actionConfigs

          protected Map<String,ActionConfig> actionConfigs

    - #### globalResultConfigs

          protected Map<String,ResultConfig> globalResultConfigs

    - #### globalAllowedMethods

          protected Set<String> globalAllowedMethods

    - #### interceptorConfigs

          protected Map<String,Object> interceptorConfigs

    - #### resultTypeConfigs

          protected Map<String,ResultTypeConfig> resultTypeConfigs

    - #### globalExceptionMappingConfigs

          protected List<ExceptionMappingConfig> globalExceptionMappingConfigs

    - #### parents

          protected List<PackageConfig> parents

    - #### defaultInterceptorRef

          protected String defaultInterceptorRef

    - #### defaultActionRef

          protected String defaultActionRef

    - #### defaultResultType

          protected String defaultResultType

    - #### defaultClassRef

          protected String defaultClassRef

    - #### name

          protected String name

    - #### namespace

          protected String namespace

    - #### isAbstract

          protected boolean isAbstract

    - #### isFinal

          protected boolean isFinal

    - #### needsRefresh

          protected boolean needsRefresh

    - #### strictMethodInvocation

          protected boolean strictMethodInvocation

  - ### Constructor Detail

    - #### PackageConfig

          protected PackageConfig(String name)

    - #### PackageConfig

          protected PackageConfig(PackageConfig orig)

  - ### Method Detail

    - #### isAbstract

          public boolean isAbstract()

    - #### isFinal

          public boolean isFinal()

    - #### getActionConfigs

          public Map<String,ActionConfig> getActionConfigs()

    - #### getAllActionConfigs

          public Map<String,ActionConfig> getAllActionConfigs()

      returns the Map of all the ActionConfigs available in the current package. ActionConfigs defined in ancestor packages will be included in this Map.
      Returns:
        a Map of ActionConfig Objects with the action name as the key
      See Also:
        `ActionConfig`

    - #### getAllGlobalResults

          public Map<String,ResultConfig> getAllGlobalResults()

      returns the Map of all the global ResultConfigs available in the current package. Global ResultConfigs defined in ancestor packages will be included in this Map.
      Returns:
        a Map of Result Objects with the result name as the key
      See Also:
        `ResultConfig`

    - #### getAllInterceptorConfigs

          public Map<String,Object> getAllInterceptorConfigs()

      returns the Map of all InterceptorConfigs and InterceptorStackConfigs available in the current package. InterceptorConfigs defined in ancestor packages will be included in this Map.
      Returns:
        a Map of InterceptorConfig and InterceptorStackConfig Objects with the ref-name as the key
      See Also:
        `InterceptorConfig`, `InterceptorStackConfig`

    - #### getAllResultTypeConfigs

          public Map<String,ResultTypeConfig> getAllResultTypeConfigs()

      returns the Map of all the ResultTypeConfigs available in the current package. ResultTypeConfigs defined in ancestor packages will be included in this Map.
      Returns:
        a Map of ResultTypeConfig Objects with the result type name as the key
      See Also:
        `ResultTypeConfig`

    - #### getAllExceptionMappingConfigs

          public List<ExceptionMappingConfig> getAllExceptionMappingConfigs()

      returns the List of all the ExceptionMappingConfigs available in the current package. ExceptionMappingConfigs defined in ancestor packages will be included in this list.
      Returns:
        a List of ExceptionMappingConfigs Objects with the result type name as the key
      See Also:
        `ExceptionMappingConfig`

    - #### getDefaultInterceptorRef

          public String getDefaultInterceptorRef()

    - #### getDefaultActionRef

          public String getDefaultActionRef()

    - #### getDefaultClassRef

          public String getDefaultClassRef()

    - #### getDefaultResultType

          public String getDefaultResultType()

      Returns:
        the default result type for this package.

    - #### getFullDefaultInterceptorRef

          public String getFullDefaultInterceptorRef()

      Returns:
        the default interceptor-ref name. If this is not set on this PackageConfig, it searches the parent PackageConfigs in order until it finds one.

    - #### getFullDefaultActionRef

          public String getFullDefaultActionRef()

      Returns:
        the default action-ref name. If this is not set on this PackageConfig, it searches the parent PackageConfigs in order until it finds one.

    - #### getFullDefaultResultType

          public String getFullDefaultResultType()

      Returns the default result type for this package.

      If there is no default result type, but this package has parents - we will try to look up the default result type of a parent.

      Returns:
        the default result type for this package.

    - #### getGlobalResultConfigs

          public Map<String,ResultConfig> getGlobalResultConfigs()

      gets the global ResultConfigs local to this package
      Returns:
        a Map of ResultConfig objects keyed by result name
      See Also:
        `ResultConfig`

    - #### getInterceptorConfigs

          public Map<String,Object> getInterceptorConfigs()

      gets the InterceptorConfigs and InterceptorStackConfigs local to this package
      Returns:
        a Map of InterceptorConfig and InterceptorStackConfig objects keyed by ref-name
      See Also:
        `InterceptorConfig`, `InterceptorStackConfig`

    - #### getName

          public String getName()

    - #### getNamespace

          public String getNamespace()

    - #### getParents

          public List<PackageConfig> getParents()

    - #### getResultTypeConfigs

          public Map<String,ResultTypeConfig> getResultTypeConfigs()

      gets the ResultTypeConfigs local to this package
      Returns:
        a Map of ResultTypeConfig objects keyed by result name
      See Also:
        `ResultTypeConfig`

    - #### isNeedsRefresh

          public boolean isNeedsRefresh()

    - #### getGlobalExceptionMappingConfigs

          public List<ExceptionMappingConfig> getGlobalExceptionMappingConfigs()

      gets the ExceptionMappingConfigs local to this package
      Returns:
        a Map of ExceptionMappingConfig objects keyed by result name
      See Also:
        `ExceptionMappingConfig`

    - #### getGlobalAllowedMethods

          public Set<String> getGlobalAllowedMethods()

      gets the GlobalAllowedMethods local to this package
      Returns:
        a Set of method names allowed to be executed if strict method invocation is enabled

    - #### isStrictMethodInvocation

          public boolean isStrictMethodInvocation()

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### compareTo

          public int compareTo(PackageConfig other)

      Specified by:
        `compareTo` in interface `Comparable<PackageConfig>`

    - #### getInterceptorConfig

          public Object getInterceptorConfig(String name)

      Description copied from interface: `InterceptorLocator`
      Gets an interceptor configuration object.
      Specified by:
        `getInterceptorConfig` in interface `InterceptorLocator`
      Parameters:
        `name` - The interceptor or interceptor stack name
      Returns:
        Either an `InterceptorConfig` or `InterceptorStackConfig` object

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