org.apache.struts2.config
Class DelegatingSettings

java.lang.Object
  extended by org.apache.struts2.config.Settings
      extended by org.apache.struts2.config.DelegatingSettings

 class DelegatingSettings
extends Settings

DelegatingSettings stores an internal list of Settings objects to update settings or retrieve settings values.

Each time a Settings method is called (get, set, list, and so forth), this class goes through the list of Settings objects and calls that method for each delegate, withholding any exception until all delegates have been called.


Field Summary
(package private)  Settings[] delegates
          The Settings objects.
 
Fields inherited from class org.apache.struts2.config.Settings
defaultImpl, locale, settingsImpl
 
Constructor Summary
DelegatingSettings(Settings[] delegates)
          Creates a new DelegatingSettings object utilizing the list of Settings objects.
 
Method Summary
 String getImpl(String name)
          Implements the Settings.get(String) method.
 boolean isSetImpl(String aName)
          Implements the Settings.isSet(String) method.
 Iterator listImpl()
          Implements the Settings.list() method.
 void setImpl(String name, String value)
          Implements the Settings.set(String, String) method.
 
Methods inherited from class org.apache.struts2.config.Settings
get, getInstance, getLocale, getLocation, getLocationImpl, isSet, list, reset, set, setInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegates

Settings[] delegates
The Settings objects.

Constructor Detail

DelegatingSettings

public DelegatingSettings(Settings[] delegates)
Creates a new DelegatingSettings object utilizing the list of Settings objects.

Parameters:
delegates - The Settings objects to use as delegates
Method Detail

setImpl

public void setImpl(String name,
                    String value)
             throws IllegalArgumentException,
                    UnsupportedOperationException
Description copied from class: Settings
Implements the Settings.set(String, String) method.

Overrides:
setImpl in class Settings
Parameters:
name - Identifer for the setting to change.
value - The new value for the setting.
Throws:
IllegalArgumentException - if an error occurs when setting the value.
UnsupportedOperationException - if the config implementation does not support setting values.
See Also:
Settings.set(String, String)

getImpl

public String getImpl(String name)
               throws IllegalArgumentException
Description copied from class: Settings
Implements the Settings.get(String) method.

Overrides:
getImpl in class Settings
Parameters:
name - The name of the setting value to retreive
Returns:
The setting value as a String
Throws:
IllegalArgumentException - if an error occurs when retrieving the value
See Also:
Settings.get(String)

isSetImpl

public boolean isSetImpl(String aName)
Description copied from class: Settings
Implements the Settings.isSet(String) method.

Overrides:
isSetImpl in class Settings
Parameters:
aName - Identifier for the setting value to change
Returns:
True if the setting exists and has a value, false otherwise.
See Also:
Settings.isSet(String)

listImpl

public Iterator listImpl()
Description copied from class: Settings
Implements the Settings.list() method.

Overrides:
listImpl in class Settings
Returns:
A list of the settings as an iterator
See Also:
Settings.list()


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.