Class BaseWebConfiguration
- java.lang.Object
-
- org.apache.commons.configuration2.event.BaseEventSource
-
- org.apache.commons.configuration2.AbstractConfiguration
-
- org.apache.commons.configuration2.web.BaseWebConfiguration
-
- All Implemented Interfaces:
Configuration
,EventSource
,ImmutableConfiguration
,SynchronizerSupport
- Direct Known Subclasses:
AppletConfiguration
,ServletConfiguration
,ServletContextConfiguration
,ServletFilterConfiguration
,ServletRequestConfiguration
abstract class BaseWebConfiguration extends AbstractConfiguration
An abstract base class for all web configurations.
This class implements common functionality used by all web based configurations. E.g. some methods are not supported by configurations of this type, so they throw a
UnsupportedOperationException
exception.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description BaseWebConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPropertyDirect(java.lang.String key, java.lang.Object obj)
Adds a property to this configuration.protected void
clearPropertyDirect(java.lang.String key)
Removes the property with the given key.protected boolean
containsKeyInternal(java.lang.String key)
Checks whether the specified key is stored in this configuration.protected boolean
containsValueInternal(java.lang.Object value)
Tests whether this configuration contains one or more matches to this value.protected java.lang.Object
handleDelimiters(java.lang.Object value)
Takes care of list delimiters in property values.protected boolean
isEmptyInternal()
Checks if this configuration is empty.-
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, getKeysInternal, getList, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getPropertyInternal, 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
-
-
-
-
Method Detail
-
addPropertyDirect
protected void addPropertyDirect(java.lang.String key, java.lang.Object obj)
Adds a property to this configuration. This operation is not supported and will throw an UnsupportedOperationException.- Specified by:
addPropertyDirect
in classAbstractConfiguration
- Parameters:
key
- the key of the propertyobj
- the value to be added- Throws:
java.lang.UnsupportedOperationException
- because this operation is not allowed
-
clearPropertyDirect
protected void clearPropertyDirect(java.lang.String key)
Removes the property with the given key. This operation is not supported and will throw an UnsupportedOperationException.- Specified by:
clearPropertyDirect
in classAbstractConfiguration
- Parameters:
key
- the key of the property to be removed- Throws:
java.lang.UnsupportedOperationException
- because this operation is not allowed
-
containsKeyInternal
protected boolean containsKeyInternal(java.lang.String key)
Checks whether the specified key is stored in this configuration.- Specified by:
containsKeyInternal
in classAbstractConfiguration
- Parameters:
key
- the key- Returns:
- a flag whether this key exists in this configuration
-
containsValueInternal
protected boolean containsValueInternal(java.lang.Object value)
Tests whether this configuration contains one or more matches to this value. This operation stops at first match but may be more expensive than the containsKey method- Specified by:
containsValueInternal
in classAbstractConfiguration
- Parameters:
value
- the value in question- Returns:
true
if and only if some key maps to thevalue
argument in this configuration as determined by theequals
method;false
otherwise.- Since:
- 2.11.0
-
handleDelimiters
protected java.lang.Object handleDelimiters(java.lang.Object value)
Takes care of list delimiters in property values. This method checks if delimiter parsing is enabled and the passed in value contains a delimiter character. If this is the case, a split operation is performed.- Parameters:
value
- the property value to be examined- Returns:
- the processed value
-
isEmptyInternal
protected boolean isEmptyInternal()
Checks if this configuration is empty. This implementation makes use of thegetKeys()
method (which must be defined by concrete sub classes) to find out whether properties exist.- Specified by:
isEmptyInternal
in classAbstractConfiguration
- Returns:
- a flag whether this configuration is empty
-
-