Uploaded image for project: 'Solder'
  1. Solder
  2. SOLDER-323

Allow constructor parameter values to be injected via XML

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I'd like to inject a String into a constructor.

      If, for example, I had this constructor on a bean:

      public Stock(String name) {
          this.name = name;
      }
      

      I'd like to be able to inject values into it with XML like this:

      <my:Stock>
          <s:parameters>
              <s:String>XYZ</s:String>
          </s:parameters>  
      </my:Stock> 
      

      Or this:

      <my:Stock>
          <s:parameters>
              <s:String>
                  <s:value>XYZ</s:value>
              </s:String>
          </s:parameters>  
      </my:Stock>
      

      The first example currently throws an exception stating: "WELD-001408 Unsatisfied dependencies for type [String] with qualifiers [@Default]". The second throws an exception stating: "Item PARAMETER is not allowed to contain VALUE."

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sjcorbett Sam Corbett
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: