Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-5503

Expanding Bean Binding annotations to define explicitly what to apply it to

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11.0
    • Component/s: camel-core
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      Currently the bean binding annotations are applied to the body like so :

      public void doSomething(@XPath("//foo/bar/text()") String someValue) {
      }

      It would be nice if you could specify what you want to apply it to; for instance you could specify to apply it to headers/properties etc

      In terms of annotations it may look something like:

      public void doSomething(@XPath("//foo/bar/text()", @Header("someHeader")) String someValue) {
      }

      For backwards compatability it would of course still apply to the body by default, but we can still offer the ability to use it apply it explicitly ie
      @XPath("//baz/text(), @Body) String someOtherValue

      I feel like this would be a useful addition to camel's bean binding.

      If anyone feels this is a good idea, I am offering to try it out and see how it goes

        Attachments

        1. CAMEL-5503.patch
          14 kB
          Alan Foster

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              alanfoster Alan Foster
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: