Class ServletContextConfiguration
- java.lang.Object
-
- org.apache.commons.configuration2.event.BaseEventSource
-
- org.apache.commons.configuration2.AbstractConfiguration
-
- org.apache.commons.configuration2.web.BaseWebConfiguration
-
- org.apache.commons.configuration2.web.ServletContextConfiguration
-
- All Implemented Interfaces:
Configuration
,EventSource
,ImmutableConfiguration
,SynchronizerSupport
public class ServletContextConfiguration extends BaseWebConfiguration
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
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.ServletContext
context
Stores the wrapped servlet context.
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Iterator<java.lang.String>
getKeysInternal()
Actually creates an iterator for iterating over the keys in this configuration.protected java.lang.Object
getPropertyInternal(java.lang.String key)
Actually obtains the value of the specified property.-
Methods inherited from class org.apache.commons.configuration2.web.BaseWebConfiguration
addPropertyDirect, clearPropertyDirect, containsKeyInternal, containsValueInternal, handleDelimiters, isEmptyInternal
-
Methods inherited from class org.apache.commons.configuration2.AbstractConfiguration
addErrorLogListener, addProperty, addPropertyInternal, append, beginRead, beginWrite, clear, clearInternal, clearProperty, cloneInterpolator, contains, containsKey, containsValue, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getDuration, getDuration, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getKeys, getKeysInternal, getKeysInternal, getList, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, interpolatedConfiguration, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setPropertyInternal, setSynchronizer, setThrowExceptionOnMissing, size, sizeInternal, subset, unlock
-
Methods inherited from class org.apache.commons.configuration2.event.BaseEventSource
addEventListener, clearErrorListeners, clearEventListeners, clone, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEvents
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.configuration2.ImmutableConfiguration
getEnum, getEnum
-
-
-
-
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
-
getKeysInternal
protected java.util.Iterator<java.lang.String> getKeysInternal()
Description copied from class:AbstractConfiguration
Actually creates an iterator for iterating over the keys in this configuration. This method is called bygetKeys()
, it has to be defined by concrete subclasses.- Specified by:
getKeysInternal
in classAbstractConfiguration
- Returns:
- an
Iterator
with all property keys in this configuration
-
getPropertyInternal
protected java.lang.Object getPropertyInternal(java.lang.String key)
Description copied from class:AbstractConfiguration
Actually obtains the value of the specified property. This method is called bygetProperty()
. Concrete subclasses must define it to fetch the value of the desired property.- Specified by:
getPropertyInternal
in classAbstractConfiguration
- Parameters:
key
- the key of the property in question- Returns:
- the (raw) value of this property
-
-