com.opensymphony.xwork2.config.entities

## Class PackageConfig.Builder

- java.lang.Object
- - com.opensymphony.xwork2.config.entities.PackageConfig.Builder

- All Implemented Interfaces:
    InterceptorLocator
  Enclosing class:
    PackageConfig

      public static class PackageConfig.Builder
      extends Object
      implements InterceptorLocator

  The builder for this object. An instance of this object is the only way to construct a new instance. The purpose is to enforce the immutability of the object. The methods are structured in a way to support chaining. After setting any values you need, call the `build()` method to create the object.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected PackageConfig` | `target`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PackageConfig.Builder(PackageConfig config)`
    `PackageConfig.Builder(String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PackageConfig.Builder` | `addActionConfig(String name, ActionConfig action)`
    `PackageConfig.Builder` | `addExceptionMappingConfig(ExceptionMappingConfig exceptionMappingConfig)`
    `PackageConfig.Builder` | `addGlobalAllowedMethods(Set<String> allowedMethods)`
    `PackageConfig.Builder` | `addGlobalExceptionMappingConfigs(List<ExceptionMappingConfig> exceptionMappingConfigs)`
    `PackageConfig.Builder` | `addGlobalResultConfig(ResultConfig resultConfig)`
    `PackageConfig.Builder` | `addGlobalResultConfigs(Map<String,ResultConfig> resultConfigs)`
    `PackageConfig.Builder` | `addInterceptorConfig(InterceptorConfig config)`
    `PackageConfig.Builder` | `addInterceptorStackConfig(InterceptorStackConfig config)`
    `PackageConfig.Builder` | `addParent(PackageConfig parent)`
    `PackageConfig.Builder` | `addParents(List<PackageConfig> parents)`
    `PackageConfig.Builder` | `addResultTypeConfig(ResultTypeConfig config)`
    `PackageConfig` | `build()`
    `PackageConfig.Builder` | `defaultActionRef(String name)`
    `PackageConfig.Builder` | `defaultClassRef(String defaultClassRef)`
    `PackageConfig.Builder` | `defaultInterceptorRef(String name)`
    `PackageConfig.Builder` | `defaultResultType(String defaultResultType)` sets the default Result type for this package
    `String` | `getDefaultClassRef()`
    `String` | `getFullDefaultResultType()`
    `Set<String>` | `getGlobalAllowedMethods()`
    `Object` | `getInterceptorConfig(String name)` Gets an interceptor configuration object.
    `String` | `getName()`
    `String` | `getNamespace()`
    `Set<String>` | `getParentsAllowedMethods(List<PackageConfig> parents)`
    `ResultTypeConfig` | `getResultType(String type)`
    `PackageConfig.Builder` | `isAbstract(boolean isAbstract)`
    `boolean` | `isNeedsRefresh()`
    `boolean` | `isStrictMethodInvocation()`
    `PackageConfig.Builder` | `location(Location loc)`
    `PackageConfig.Builder` | `name(String name)`
    `PackageConfig.Builder` | `namespace(String namespace)`
    `PackageConfig.Builder` | `needsRefresh(boolean needsRefresh)`
    `PackageConfig.Builder` | `strictMethodInvocation(boolean strict)`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### target

          protected PackageConfig target

  - ### Constructor Detail

    - #### PackageConfig.Builder

          public PackageConfig.Builder(String name)

    - #### PackageConfig.Builder

          public PackageConfig.Builder(PackageConfig config)

  - ### Method Detail

    - #### name

          public PackageConfig.Builder name(String name)

    - #### isAbstract

          public PackageConfig.Builder isAbstract(boolean isAbstract)

    - #### defaultInterceptorRef

          public PackageConfig.Builder defaultInterceptorRef(String name)

    - #### defaultActionRef

          public PackageConfig.Builder defaultActionRef(String name)

    - #### defaultClassRef

          public PackageConfig.Builder defaultClassRef(String defaultClassRef)

    - #### defaultResultType

          public PackageConfig.Builder defaultResultType(String defaultResultType)

      sets the default Result type for this package
      Parameters:
        `defaultResultType` - set the default result type
      Returns:
        this builder

    - #### namespace

          public PackageConfig.Builder namespace(String namespace)

    - #### needsRefresh

          public PackageConfig.Builder needsRefresh(boolean needsRefresh)

    - #### addActionConfig

          public PackageConfig.Builder addActionConfig(String name,
                                              ActionConfig action)

    - #### addParents

          public PackageConfig.Builder addParents(List<PackageConfig> parents)

    - #### addGlobalResultConfig

          public PackageConfig.Builder addGlobalResultConfig(ResultConfig resultConfig)

    - #### addGlobalResultConfigs

          public PackageConfig.Builder addGlobalResultConfigs(Map<String,ResultConfig> resultConfigs)

    - #### getGlobalAllowedMethods

          public Set<String> getGlobalAllowedMethods()

    - #### getParentsAllowedMethods

          public Set<String> getParentsAllowedMethods(List<PackageConfig> parents)

    - #### addGlobalAllowedMethods

          public PackageConfig.Builder addGlobalAllowedMethods(Set<String> allowedMethods)

    - #### addExceptionMappingConfig

          public PackageConfig.Builder addExceptionMappingConfig(ExceptionMappingConfig exceptionMappingConfig)

    - #### addGlobalExceptionMappingConfigs

          public PackageConfig.Builder addGlobalExceptionMappingConfigs(List<ExceptionMappingConfig> exceptionMappingConfigs)

    - #### addInterceptorConfig

          public PackageConfig.Builder addInterceptorConfig(InterceptorConfig config)

    - #### addInterceptorStackConfig

          public PackageConfig.Builder addInterceptorStackConfig(InterceptorStackConfig config)

    - #### addParent

          public PackageConfig.Builder addParent(PackageConfig parent)

    - #### addResultTypeConfig

          public PackageConfig.Builder addResultTypeConfig(ResultTypeConfig config)

    - #### location

          public PackageConfig.Builder location(Location loc)

    - #### isNeedsRefresh

          public boolean isNeedsRefresh()

    - #### getDefaultClassRef

          public String getDefaultClassRef()

    - #### getName

          public String getName()

    - #### getNamespace

          public String getNamespace()

    - #### getFullDefaultResultType

          public String getFullDefaultResultType()

    - #### getResultType

          public ResultTypeConfig getResultType(String type)

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

    - #### strictMethodInvocation

          public PackageConfig.Builder strictMethodInvocation(boolean strict)

    - #### isStrictMethodInvocation

          public boolean isStrictMethodInvocation()

    - #### build

          public PackageConfig build()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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