Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-392

Enable namespace declaration based on scripts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 3.3
    • None

    Description

      WHAT:
      It is often convenient to reuse pieces of code in multiple places. This is easy to do with namespaces and Java classes (or objects) but impossible through scripts. The workaround Is to use maps that contain the various functions and use an object but it requires re-evaluating the script each time this is needed which is costly.
      Ideally, there should be a way to declare a namespace whose bound object would be the result of the evaluation of JEXL code.
      HOW:
      By adding a new pragma imaginatively called 'module' behaving as namespace declaration but whose value must be an expression (as a string) that will be evaluated during pragma processing.
      One important usage warning here is the idem-potence of the expression whose result should be stable to avoid any bizarre behaviour.

      Attachments

        Issue Links

          Activity

            People

              henrib Henri Biestro
              henrib Henri Biestro
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: