com.opensymphony.webwork.config
Class PropertiesConfiguration

java.lang.Object
  extended by com.opensymphony.webwork.config.Configuration
      extended by com.opensymphony.webwork.config.PropertiesConfiguration

public class PropertiesConfiguration
extends Configuration

A class to handle configuration via a properties file.

Author:
Rickard ???berg, Jason Carreira, Bill Lynch (docs)

Constructor Summary
PropertiesConfiguration(String name)
          Creates a new properties config given the name of a properties file.
 
Method Summary
 Object getImpl(String aName)
          Gets a property from the properties file.
 boolean isSetImpl(String aName)
          Tests to see if a property exists in the properties file.
 Iterator listImpl()
          Lists all keys in the properties file.
 void setImpl(String aName, Object aValue)
          Sets a property in the properties file.
 
Methods inherited from class com.opensymphony.webwork.config.Configuration
get, getConfiguration, getLocale, getString, isSet, list, reset, set, setConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesConfiguration

public PropertiesConfiguration(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 PropertiesConfiguration("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(String aName,
                    Object aValue)
Sets a property in the properties file.

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

getImpl

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

Overrides:
getImpl in class Configuration
Throws:
IllegalArgumentException
See Also:
Configuration.get(String)

isSetImpl

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

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

listImpl

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

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

WebWork Project Page