Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4607

[DS] Configure with nested annotations/interfaces

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: scr-2.0.0
    • Fix Version/s: scr-2.0.4
    • Labels:
      None

      Description

      RFC 190 has the unfortunate limitation that annotations used for configuration cannot have annotation field values. This is easy to remedy if we pick a format for mapping typed data trees into a map. I'm going to implement this following James Strachan's system for creating an xml DSL for spring configuration for ActiveMQ (see also geronimo's xbean-spring and xbean-blueprint) and inspired by xpath.

      Here's an example of how the mapping works. Lets say you have annotations
      A

      { B[] b();}

      and B

      { String foo();}

      . The configuration map will have entries with keys of the form:
      b.0.foo
      b.1.foo
      b.2.foo

      b.<arrayIndex>.foo

      <element name of outer class>.<arrayIndex>.<element name of inner class>

      Obviously this can be extended to any level of nesting. Non array annotation valued elements will correspond to arrayIndex 0.

      To extend support to interfaces with inheritance, it's also necessary to include the class of the desired sub-interface in the source map. I don't have a proposal yet for the name of the sub key.

        Attachments

          Activity

            People

            • Assignee:
              djencks David Jencks
              Reporter:
              djencks David Jencks
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: