commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35116] New: - [configuration] Enhancement of interpolation features
Date Sun, 29 May 2005 17:39:48 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35116>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35116

           Summary: [configuration] Enhancement of interpolation features
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: oliver.heger@t-online.de


At the moment interpolation is only supported by the getString() and
getStringArray() methods. This proposal suggests adding interpolation support
for other getter methods, too, and at the same time making it more customizable
(including the ability to disable it at all).

A first step in achieving this could be to refactor the interpolation
functionality out of AbstractConfiguration and into a new Interpolator class.
This class would provide a main interpolation method and would also maintain an
arbitrary number of objects that know how to resolve variables of certain types.
Each Configuration object would be assigned an Interpolator instance, to which
it would delegate interpolation tasks.

Customization of the interpolation features could be done by assigning an
Interpolator object to a configuration that has been initialized with a custom
set of variable resolver objects. If no Interpolator is assigned, no
interpolation will be performed.

Variable resolver objects are very simple: They define a method which takes a
variable's name and return its value. The variable resolver to use for a
concrete variable is determined by a prefix that can be set for each variable.
So a variable like ${sys:user.home} e.g. might refer to the system properties
resolver. Variables without a prefix are handled by a default resolver, which is
implemented by the Configuration object itself, so that the Configuration's
properties are used as variable values (which is backwards compatible to the
current functionality).

It should be possible to define a default Interpolator (or at least a default
set of variable resolvers) that is to be used by each Configuration object as
long as no special Interpolator is set. This could be done through a static
field in AbstractConfiguration.

Useful specific variable resolver classes could be:
- The already mentioned system properties resolver, which would make system
properties accessable in each configuration.
- A resolver that would read constant values from specified classes.
- A resolver that would evaluate expressions in an expression language like EL.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message