Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-182

[configuration] add new config.subsets() method to return multiple SubsetConfigurationS

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      Please consider adding a configuration.subsets(String) method to return a list
      of subset configurations that match the string query. This corresponds to the
      configuration.subset(String) method that returns a single SubsetConfiguration.
      I mentioned this in a thread on the user list [1]. I hope it can be added in
      short order. I'm not sure whether returning a List or an Iterator would be
      best? In any case, I would use it like this (assuming, for now, that it returns
      a list)...

      List subConfigs = config.subsets("tables.table");
      for (Iterator iter = subConfigs.iterator(); iter.hasNext() {
      SubsetConfiguration subConfig = (SubsetConfiguration) iter.next();
      }

      ...where if I was only trying to get one subset configuration at a time, I
      might do...

      SubsetConfiguration subConfig = (SubsetConfiguration)
      config.subset("tables.table(0)");

      Of course, I always use the subset configuration in the context of a
      loop/iteration, since I need to deal with all of them (and where there may be
      any number "tables.table" entries in the XML), not just one at a time leading to
      the rather ugly while loop example I resorted to in the thread I referenced.
      Does this seem reasonable to add to the next release?

      [1] - http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=113528247017087&w=2

      Jake

        Activity

        Henri Yandell made changes -
        Key COM-2672 CONFIGURATION-182
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Affects Version/s unspecified [ 12311647 ]
        Project Commons [ 12310458 ] Commons Configuration [ 12310467 ]
        Component/s Configuration [ 12311107 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 38075 12342824
        Jacob Kjome created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Jacob Kjome
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development