org.apache.struts2.config

## Class DefaultSettings

- java.lang.Object
- - org.apache.struts2.config.DefaultSettings

-     public class DefaultSettings
      extends Object

  DefaultSettings implements optional methods of Settings.

  This class creates and delegates to other settings by using an internal `DelegatingSettings` object.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultSettings()` Constructs an instance by loading the standard property files, any custom property files (`struts.custom.properties`), and any custom message resources ().

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `get(String aName)` Retrieve value for provided name
    `Location` | `getLocation(String name)` Returns `Location` of given setting
    `Iterator` | `list()` Returns `Iterator` with all values

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

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

- - ### Constructor Detail

    - #### DefaultSettings

          public DefaultSettings()

      Constructs an instance by loading the standard property files, any custom property files (`struts.custom.properties`), and any custom message resources ().

      Since this constructor combines Settings from multiple resources, it utilizes a `DelegatingSettings` instance, and all API calls are handled by that instance.

  - ### Method Detail

    - #### getLocation

          public Location getLocation(String name)

      Returns `Location` of given setting
      Parameters:
        `name` - Name of the setting to locate
      Returns:
        The location of the setting or null

    - #### get

          public String get(String aName)
                     throws IllegalArgumentException

      Retrieve value for provided name
      Parameters:
        `aName` - The name of the setting value to retrieve
      Returns:
        The setting value as a String or null
      Throws:
        `IllegalArgumentException`

    - #### list

          public Iterator list()

      Returns `Iterator` with all values
      Returns:
        A list of the settings as an iterator

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