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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 38075

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            hoju Jacob Kjome
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: