Jochen Kemnade created GROOVY-7689:
--------------------------------------

             Summary: DelegatingScript should support different delegates for 
different operations
                 Key: GROOVY-7689
                 URL: https://issues.apache.org/jira/browse/GROOVY-7689
             Project: Groovy
          Issue Type: Improvement
    Affects Versions: 2.4.5
            Reporter: Jochen Kemnade


I'd like to use different "inputs" and "outputs" for a script.
For example if my input is {{[ x : 2 ]}} and my output is {{[ : ]}}, 
{code}
result = 2 * x
{code}
should lead to {{output == [ result : 4 ]}}. That means, getProperty should use 
the input and setProperty should use the output.
Currently, you can only set a single delegate for DelegatingScript, so that is 
not possible.
I suggest introducing the additional methods {{setDelegateForInvokeMethod, 
setDelegateForGetProperty, and setDelegateForSetProperty}} that set the 
delegates only for the respective methods. The existing {{setDelegate}} method 
would set all the delegates to the same object.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to