Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-2371

Allow registering default SpEL functions to simplify expressions

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: To Do
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.0.1
    • Fix Version/s: Waiting for Triage
    • Component/s: DSL, Runtime
    • Labels:
      None
    • Story Points:
      8
    • Rank (Obsolete):
      46577
    • Acceptance Criteria:
      Hide

      A user can register a custom SpEL functions to simplify SpEL expressions in Stream definitions.
      A user can use the set of predefined SpEL functions listed above.

      Show
      A user can register a custom SpEL functions to simplify SpEL expressions in Stream definitions. A user can use the set of predefined SpEL functions listed above.

      Description

      Often one has to perform some basic conversion / parsings in Stream definitions. It would be helpful if one could provide some helper functions to simplify SpEL expressions.

      E.g. instead of:

      transform --expression=T(java.lang.Long).parseLong(payload.value.toString())
      

      it would be nice to be able to write:

      transform --expression=parseLong(payload.value)
      

      I'm thinking of support for:

      • parseByte
      • parseInt
      • parseShort
      • parseLong
      • parseFloat
      • parseDouble
      • parseBoolean
      • parseTuple

      (I don't think we'd need support for parseCharacter)

      This issue is about:
      1) providing the centralised infrastructure for defining the SpEL expressions
      2) Add support for the above listed predefined SpEL expressions

      Those functions should be able to work with String based as well as JsonToStringFriendlyNode as input.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              thomasd Thomas Darimont
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: