org.apache.commons.configuration.web
Class ServletContextConfiguration

java.lang.Object
  extended byorg.apache.commons.configuration.AbstractConfiguration
      extended byorg.apache.commons.configuration.web.ServletContextConfiguration
All Implemented Interfaces:
Configuration

public class ServletContextConfiguration
extends AbstractConfiguration

A configuration wrapper to read the initialization parameters of a servlet context. This configuration is read only, adding or removing a property will throw an UnsupportedOperationException.

Since:
1.1
Version:
$Revision$, $Date: 2005-02-26 13:56:39 +0100 (Sat, 26 Feb 2005) $
Author:
Emmanuel Bourg

Field Summary
protected  javax.servlet.ServletContext context
           
 
Fields inherited from class org.apache.commons.configuration.AbstractConfiguration
END_TOKEN, START_TOKEN
 
Constructor Summary
ServletContextConfiguration(javax.servlet.Servlet servlet)
          Create a ServletContextConfiguration using the context of the specified servlet.
ServletContextConfiguration(javax.servlet.ServletContext context)
          Create a ServletContextConfiguration using the servlet context initialization parameters.
 
Method Summary
protected  void addPropertyDirect(String key, Object obj)
          This operation is not supported and will throw an UnsupportedOperationException.
 void clearProperty(String key)
          This operation is not supported and will throw an UnsupportedOperationException.
 boolean containsKey(String key)
          Check if the configuration contains the specified key.
 Iterator getKeys()
          Get the list of the keys contained in the configuration.
 Object getProperty(String key)
          Gets a property from the configuration.
 boolean isEmpty()
          Check if the configuration is empty.
 
Methods inherited from class org.apache.commons.configuration.AbstractConfiguration
addProperty, clear, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, interpolate, interpolateHelper, isThrowExceptionOnMissing, resolveContainerStore, setDelimiter, setProperty, setThrowExceptionOnMissing, subset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected javax.servlet.ServletContext context
Constructor Detail

ServletContextConfiguration

public ServletContextConfiguration(javax.servlet.Servlet servlet)
Create a ServletContextConfiguration using the context of the specified servlet.

Parameters:
servlet - the servlet

ServletContextConfiguration

public ServletContextConfiguration(javax.servlet.ServletContext context)
Create a ServletContextConfiguration using the servlet context initialization parameters.

Parameters:
context - the servlet context
Method Detail

getProperty

public Object getProperty(String key)
Description copied from interface: Configuration
Gets a property from the configuration.

Parameters:
key - property to retrieve
Returns:
the value to which this configuration maps the specified key, or null if the configuration contains no mapping for this key.

addPropertyDirect

protected void addPropertyDirect(String key,
                                 Object obj)

This operation is not supported and will throw an UnsupportedOperationException.

Specified by:
addPropertyDirect in class AbstractConfiguration
Parameters:
key - key to use for mapping
obj - object to store
Throws:
UnsupportedOperationException

isEmpty

public boolean isEmpty()
Description copied from class: AbstractConfiguration
Check if the configuration is empty.

Specified by:
isEmpty in interface Configuration
Specified by:
isEmpty in class AbstractConfiguration

containsKey

public boolean containsKey(String key)
Description copied from class: AbstractConfiguration
Check if the configuration contains the specified key.

Specified by:
containsKey in interface Configuration
Specified by:
containsKey in class AbstractConfiguration

clearProperty

public void clearProperty(String key)

This operation is not supported and will throw an UnsupportedOperationException.

Specified by:
clearProperty in interface Configuration
Specified by:
clearProperty in class AbstractConfiguration
Throws:
UnsupportedOperationException

getKeys

public Iterator getKeys()
Description copied from class: AbstractConfiguration
Get the list of the keys contained in the configuration.

Specified by:
getKeys in interface Configuration
Specified by:
getKeys in class AbstractConfiguration


Copyright © 2001-2005 The Apache Software Foundation. All Rights Reserved.