Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-196

[configuration] Tools for code generation of configuration properties

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.1
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      39385

      Description

      I would like to just suggest a kind of code generation from a defined
      properties/xml file, so the user can avoid the use of string representing the
      properties on whole source code. For example if I have the following property:

      ftpServer.login = anonymous

      in order to get the value of such property, instead of:
      getProperty("ftpServer.login");

      to have an equivalente class representation, like this:
      getFtpServer().getLogin();

      or just:
      ftpServer().getLogin();

      with this solution, you avoid miss-spelling of the property name (for example:
      instead of "ftpServer.loging", "ftpserver.login"), because you will get a
      compiler error.

      in order to get this target we need a kind of code generation of the
      corresponding classes. Like any other generation tools it should be a mapping
      file for configuring the way the properties/subproperties/nodes could be
      mapped, for example tomorrows I would like to map: ftpServer.login to getServe
      ().getLogin(). With the default configuration the mapping will be the same.

      It could be just and ant-taks for doing this, probably with velocity would be
      easy to implement.

      Thanks in advance,

      David Leal
      achepati67@yahoo.es
      (If you want I could colaborate)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              achepati67@yahoo.es David Leal
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: