ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: svn commit: r451000 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/ main/org/apache/tools/ant/taskdefs/condition/ tests/junit/org/apache/tools/ant/
Date Mon, 02 Oct 2006 07:13:52 GMT
>> void antMixin(RegexMixin x) {
>>   this.regexParams = x;
>> }
>
>That would be *fantastic* Peter!!!
>
>Overlap in attr/elem between the main type and the mixins 
>would be silently ignored (maybe a warning a warn or debug 
>level only), the main type taking precedence; but overlap in 
>attr/elem between the mixins would be an error (ambiguous).


You could also pass the value to both: the task and the mixin.


public class MyMixin /* extends PC/some baseclass? */ {
    private String foo;
    public void setFoo(String f) { foo=f; }
}

public class MyTask extends Task /* maybe each ProjectComponent */ {
    MyMixin mixin;
    public void antMixin(MyMixin in) {
        mixin = in;
    }
    String foo;
    public void setFoo(String f) { foo=f; }
}

<mytask foo="bar"/>
-->  MyTask.foo       = "bar"
-->  MyTask.mixin.foo = "bar"


Another possibility would be setting the back reference automatically

public class MyMixin {
    Task caller;
    public void setTask(Task c) { caller=c; }
}


Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message