org.apache.struts2.config
Class PropertiesSettings

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

public class PropertiesSettings
extends Settings

A class to handle settings via a properties file.


Constructor Summary
PropertiesSettings(java.lang.String name)
          Creates a new properties config given the name of a properties file.
 
Method Summary
 java.lang.String getImpl(java.lang.String aName)
          Gets a property from the properties file.
 boolean isSetImpl(java.lang.String aName)
          Tests to see if a property exists in the properties file.
 java.util.Iterator listImpl()
          Lists all keys in the properties file.
 void setImpl(java.lang.String aName, java.lang.String aValue)
          Sets a property in the properties file.
 
Methods inherited from class org.apache.struts2.config.Settings
get, getInstance, getLocale, isSet, list, reset, set, setInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesSettings

public PropertiesSettings(java.lang.String name)
Creates a new properties config given the name of a properties file. The name is expected to NOT have the ".properties" file extension. So when new PropertiesSettings("foo") is called this class will look in the classpath for the foo.properties file.

Parameters:
name - the name of the properties file, excluding the ".properties" extension.
Method Detail

setImpl

public void setImpl(java.lang.String aName,
                    java.lang.String aValue)
Sets a property in the properties file.

Overrides:
setImpl in class Settings
See Also:
Settings.set(String, String)

getImpl

public java.lang.String getImpl(java.lang.String aName)
                         throws java.lang.IllegalArgumentException
Gets a property from the properties file.

Overrides:
getImpl in class Settings
Throws:
java.lang.IllegalArgumentException
See Also:
Settings.get(String)

isSetImpl

public boolean isSetImpl(java.lang.String aName)
Tests to see if a property exists in the properties file.

Overrides:
isSetImpl in class Settings
See Also:
Settings.isSet(String)

listImpl

public java.util.Iterator listImpl()
Lists all keys in the properties file.

Overrides:
listImpl in class Settings
See Also:
Settings.list()


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