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

Call method with varargs

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1
    • 2.0
    • None
    • All

    Description

      Jexl doesn't allow for using method with varargs - method cannot be found and because of that expression returns null. Try following code:

      class TestClass {
      public String testVarArgs (Integer... args)

      { return "Test"; }

      }

      String jexlExp = "test.testVarArgs(1,2,3,4,5)";
      Expression e = ExpressionFactory.createExpression(jexlExp);
      JexlContext jc = JexlHelper.createContext();
      jc.getVars().put("test", new TestClass());
      Object o = e.evaluate(jc);

      Attachments

        Activity

          People

            Unassigned Unassigned
            marek.lewczuk Marek Lewczuk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: