A
PropertiesList
instance is intended to be an element of a doubly linked list consisting of other
PropertiesList
instances. Each
PropertiesList
instance "wraps" a
Dictionary
object. A
PropertiesList
is a subclass of
Properties
and therefore provides the same API, including the methods and fields of
Dictionary
and
Hashtable
. The
PropertiesList
class overrides all methods of the
Properties
API and delegates the method evaluation to the wrapped
Properties
object.
The linked list of PropertiesList
objects is constructed by Request
for each incoming request. That is, there is a unique PropertiesList
linked list for each request. The head of the initial list constructed by request
is Request.props
and the tail of the two element list is Request.serverProps
. The former wraps an empty Properties
object, while the latter wraps Server.props
. Other PropertiesList
objects can be added, and removed, from this initial list as required.
Given a reference to a PropertiesList
object on the linked list (e.g. request.props
), one typically "looks up" the value associated with a name using the getProperty
method, which delegates to the wrapped Properties.getProperty
method. If the result is null
, meaning the name/value pair is not stored in the wrapped Properties
object, the request is "forwarded" to the next object on the linked list, and so on until either the name/value pair is found (and the value is returned) or the end of the list is reached (and null
is returned).
It may be desirable for the name/value lookup to be delayed until after the lookup request has been passed on to subsequent objects on the list. This can be done by using the two parameter constructor and setting the second, boolean, parameter to true
. Then the getProperty
request is forwarded to the next object in the list rather than delegated to the wrapped Properties
object. If the result of the forwarded request is null
, the request is then passed to the wrapped Properties
object and it's result is returned.
@author Steve Drach <drach@sun.com>
@version 2.7
@see java.util.Dictionary
@see java.util.Hashtable
@see java.util.Properties