You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Magesh Umasankar <um...@apache.org> on 2002/11/26 21:54:32 UTC

[PATCH] Adding Dynamic elements for the n'th time

Hi,

This is basically a modification of Conor's patch
to enhance the Introspection capabilities. See:

http://marc.theaimsgroup.com/?l=ant-dev&m=100591826612807&w=2

The difference is that my patch looks for methods whose
parameter class type is assignable from the nested element's
class type.

Let us say we have the following mappings:
TagDefA->ClassA
TagDefB->ClassB

ClassA implements Interface1
ClassB implements Interface1

Currently, if we want these as nested elements, 
we would have to define

addTagDefA(ClassA)
addTagDefB(ClassB)

With this patch, if you define, 

addInterface1(Interface1)

it would be good enough and will be called when
you have a nested element like <tagdefa .../> or 
<tagdefb.../> and no equivalent addTagDef methods.

So, Where does this apply?  It applies to
<condition>, <filterchain>, etc. and of course the
<fileset> issue that Conor originally solved.

In my patch, I have minimally shown how this
is applied to ConditionBase.

This patch depends upon my earlier patch Project.java
because when Condition is initialized, it expects
its nested elements to have been already initialized.
If they are not, then it balks.

Cheers,
Magesh


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Magesh Umasankar <um...@apache.org>.
----- Original Message -----
From: "Conor MacNeill" <co...@cortexebusiness.com.au>


> I think, perhaps, we should agree that polymorphic behaviour is a
desirable
> objective. I certainly think it is. When I define a subclass of a type I
> should not need to change all tasks that take that type.

+1

> Conor

Cheers,
Magesh


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Costin Manolache <cm...@yahoo.com>.
Magesh Umasankar wrote:

> ----- Original Message -----
> From: "Conor MacNeill" <co...@cortexebusiness.com.au>
> 
>> My original Ant 1 patch (which Magesh has cited) used a different
>> approach where it tried to guess which underlying method is to be used. I
>> haven't studied Magesh's patch in detail but for fully flexibly
>> polymorphism, you need to identify the type of the object being passed
>> and the method on the task to which you will pass it (i.e. two
>> independent things). Using only
> one
>> piece of information (the type name) has limits.
> 
> Yes.  If the method name to be used is also to be dynamic,
> we can make that happen as well - but, I think, going forward
> with baby steps will be easier.  If I start packing more and
> more into a single patch, the chances of its inner workings
> being debated in detail gets slimmer ;-)

As I said, I'm +1 on the original patch - I see it as an improvement
that can be further improved :-)

You know me - if something doesn't have a clear solution I usually
propose a hook :-)

We already have a number of hooks on element configuration, maybe the
way to go would be to extend those.

I have a use case: have introspection recognize ${dyn:properties} that
evaluate to objects, and call the right method ( instead of 
object->string->object conversion ). Another use case would be a more 
pluggable mechanism for the "property editors" ( the convertors between 
strings and real params ).

JMX introduces another set of use cases - if we want to support
JMX tasks using a task adapter, we'll need to use MBeanInfo and 
setAttribute to configure it. 

IMO it may be a good idea to find the best "extension points" and 
add hooks in the right place, and then play with different options
( some will be added to core, some may stay outside ).

Costin





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Magesh Umasankar <um...@apache.org>.
----- Original Message -----
From: "Conor MacNeill" <co...@cortexebusiness.com.au>

> My original Ant 1 patch (which Magesh has cited) used a different approach
> where it tried to guess which underlying method is to be used. I haven't
> studied Magesh's patch in detail but for fully flexibly polymorphism, you
> need to identify the type of the object being passed and the method on the
> task to which you will pass it (i.e. two independent things). Using only
one
> piece of information (the type name) has limits.

Yes.  If the method name to be used is also to be dynamic,
we can make that happen as well - but, I think, going forward
with baby steps will be easier.  If I start packing more and
more into a single patch, the chances of its inner workings
being debated in detail gets slimmer ;-)

> Conor

Cheers,
Magesh



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 28 Nov 2002, Magesh Umasankar <um...@apache.org> wrote:

> I don't see addXXXPath(...) methods in <javac>.  I only see
> createXXXPath().

My fault, sorry.

Let's step away from implementation details and assume that <javac>
used the addXXX variety of things for its <src> and <classpath>
child-elements.  Both take Path arguments as both are our usual
path-like structures.

I now invent a Path subclass with a terrific new feature (no matter
what) and call it MyPath.  I register it as a data-type with the name
mypath.  How would I write the <javac> task if I wanted to pass a
MyPath instance as <src>?  How if I wanted to pass it as <classpath>?

Conor's suggestion would be <classpath xsd:type="mypath"/> or
<src xsd:type="mypath"/>.

Dominique says you could turn that around <mypath xsd:type="classpath"/>
or <mypath xsd:type="src"/> - which I find easier to read, especially
since you could leave out the type attribute in situations that are
not ambiguous.  But then again, it is an abuse of XML Schema as I read
it the same way as Conor is using the type attribute.

IIUC your current patch wouldn't handle a situation like this at all
(no offence, I just want to get things clear), but would be like
Dominque's suggestion in cases that are not ambiguous.

Maybe we can simply agree on how to handle the more complicated case
and then extend your patch to that?  No reason to hold it back,
though.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Magesh Umasankar <um...@apache.org>.
----- Original Message ----- 
From: "Stefan Bodewig" <bo...@apache.org>


> On Wed, 27 Nov 2002, Magesh Umasankar <um...@apache.org> wrote:
> 
> > This, I think is a reasonable constraint if you plan
> > to be doing different things (obviously) in addSrc and
> > addClasspath.
> 
> I disagree.  Just look into the current implementation of <javac>,
> there are several path structures supported via nested elements.

I don't see addXXXPath(...) methods in <javac>.  I
only see createXXXPath().  There are some setters,
of course, but that is beyond the scope of this patch.

> Inventing a Path subclass for all of them seems overkill.
I can rework the patch such that:
addClassPath(ClassPath) is searched for;
Else
addClassPath(Path) is searched for;
Else
addPath(Path) is searched for.

The second step above would behave somewhat like
the setter methods which recognize setClasspath(Path)

> And even then, take MyPath extends Src extends Path and addSrc(Src) as
> well as AddPath(Path) - what should <mypath> trigger?

Well, Conor's would have triggered addSrc, but in mine, 
either may be triggered, but mine recognizes interfaces
also, FWIW.  I can rework it as a hybrid of both patches so that 
both the class hierarchy as well as interfaces are recognized.

> I think we really need a way for the user to disambiguate the
> situation.
> 
> One way is to say <path> when I want addPath and <src> when I want
> addSrc (and use an attribute to say it it a MyPath).  I think this
> might involve major changes in IntrospectionHelper.
> 
> The other way is to say <mypath> and have an attribute that says "use
> this as path" or "use this as "src".  This also means big changes to
> IntrospectionHelper, but potentially smaller ones.

If MyPath extends from Src extends from Path,
I think we don't need to disambiguate the situation.
addSrc *should* be the chosen one in the absence of addMyPath.  
For example,

If SubSub extends Sub extends Base and you have
set(Sub) and set(Base), when invoking set(SubSubObj)
set(Sub) will get invoked.

> I'm just estimating here.
> 
> Stefan

Cheers,
Magesh



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 27 Nov 2002, Magesh Umasankar <um...@apache.org> wrote:

> This, I think is a reasonable constraint if you plan
> to be doing different things (obviously) in addSrc and
> addClasspath.

I disagree.  Just look into the current implementation of <javac>,
there are several path structures supported via nested elements.
Inventing a Path subclass for all of them seems overkill.

And even then, take MyPath extends Src extends Path and addSrc(Src) as
well as AddPath(Path) - what should <mypath> trigger?

I think we really need a way for the user to disambiguate the
situation.

One way is to say <path> when I want addPath and <src> when I want
addSrc (and use an attribute to say it it a MyPath).  I think this
might involve major changes in IntrospectionHelper.

The other way is to say <mypath> and have an attribute that says "use
this as path" or "use this as "src".  This also means big changes to
IntrospectionHelper, but potentially smaller ones.

I'm just estimating here.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Magesh Umasankar <um...@apache.org>.
----- Original Message ----- 
From: "Stefan Bodewig" <bo...@apache.org>


> On Wed, 27 Nov 2002, Magesh Umasankar <um...@apache.org> wrote:
> 
> >> I think I remember it.  A problem arises when you have two
> >> different nested elements (element names) that both accept the same
> >> class.  Say you have <mypath> that is derived from Path, what would
> >> it be used for in
> >> 
> >> <javac ...>
> >>   <mypath .../>
> >> </javac>
> >> 
> >> src, classpath, sourcepath, bootclasspath and extdirs would be
> >> possible.  Has this been the reason for your choice Conor?  How
> >> would your patch deal with it Magesh?
> > 
> > If you have addMyPath(MyPath) that would be called;
> > Else
> > If you have addPath(Path), that would be called.
> 
> But I have addSrc(Path) and addClasspath(Path) - which would be
> called?

With the patch I submitted, neither!  

In the above case, you would have to have
addSrc(Src) and addClasspath(Classpath) assuming both 
Src and Classpath both extend from Path.  Of course,
the element that is being added may be a derivative
of Src or Classpath also.

This, I think is a reasonable constraint if you plan
to be doing different things (obviously) in addSrc and
addClasspath.  If you do not plan to have differeing code
in these two methods, then all you need is addPath(Path)

> Stefan

Cheers,
Magesh



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 27 Nov 2002, Magesh Umasankar <um...@apache.org> wrote:

>> I think I remember it.  A problem arises when you have two
>> different nested elements (element names) that both accept the same
>> class.  Say you have <mypath> that is derived from Path, what would
>> it be used for in
>> 
>> <javac ...>
>>   <mypath .../>
>> </javac>
>> 
>> src, classpath, sourcepath, bootclasspath and extdirs would be
>> possible.  Has this been the reason for your choice Conor?  How
>> would your patch deal with it Magesh?
> 
> If you have addMyPath(MyPath) that would be called;
> Else
> If you have addPath(Path), that would be called.

But I have addSrc(Path) and addClasspath(Path) - which would be
called?

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Magesh Umasankar <um...@apache.org>.
----- Original Message ----- 
From: "Stefan Bodewig" <bo...@apache.org>

> I think I remember it.  A problem arises when you have two different
> nested elements (element names) that both accept the same class.  Say
> you have <mypath> that is derived from Path, what would it be used for
> in
> 
> <javac ...>
>   <mypath .../>
> </javac>
> 
> src, classpath, sourcepath, bootclasspath and extdirs would be
> possible.  Has this been the reason for your choice Conor?  How would
> your patch deal with it Magesh?

If you have addMyPath(MyPath) that would be called;
Else
If you have addPath(Path), that would be called.

Do you think it would be better if the following happened 
instead?

If you have addMyPath(MyPath) that would be called;
Else
If you have addMyPath(Path), that would be called;
Else 
If you have addPath(Path), that would be called.

Basically, the motivation is to allow defining
a single addXXX(XXX) method where it makes sense
where XXX is assignable from a nested element's class.

> Stefan

Cheers,
Magesh



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 28 Nov 2002, Conor MacNeill <co...@cortexebusiness.com.au>
wrote:
> Stefan Bodewig wrote:

> Let me say at this juncture that Mutant is and will remain dead.

I didn't mean to imply anything else.

> I'm on an evolutionary tack now.

Cool.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Stefan Bodewig wrote:
> On Wed, 27 Nov 2002, Conor MacNeill <co...@cortexebusiness.com.au>
> wrote:
> 
> 
>>What comes next is the notation to express the use of derived type,
>>and the underlying implementation in the core. In Mutant I advocated
>>an explicit statement of the substitution
> 
> 
> This here?
> 
> <http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-ant/proposal/mutant/docs/Attic/features.html?rev=1.1#Extensibility>

Yes.

Let me say at this juncture that Mutant is and will remain dead. I'm on an 
evolutionary tack now. Nevertheless there are some ideas I was able to 
explore and some refactorings which can be applied to Ant1 without breaking 
things.

> 
> So the example from the link above would become
> 
>     <copy todir="dest">
>       <classfileset dir="../../bin/ant1compat/">
>         <root classname="org.apache.tools.ant.Project"/>
>       </classfileset>
>     </copy>
> 
> yes?  Sorry, haven't had the time to read the patch to know.

Yes, this is correct.

> 
> This one looks easier to write and read from a build file writer's
> perspective.  What has been the reason to use a different notation in
> Mutant?

As you state below it is when the same type is used in multiple set/add 
methods that the above breaks down. Also the XSI based file would be able to 
be validated by a schema aware parser, I think (hope), whereas the above 
cannot be validated (which may not be a big deal, although some seem to like 
having the ability to do so.)

> 
> 
>>Using only one piece of information (the type name) has limits.
> 
> 
> I think I remember it.  A problem arises when you have two different
> nested elements (element names) that both accept the same class.  Say
> you have <mypath> that is derived from Path, what would it be used for
> in
> 
> <javac ...>
>   <mypath .../>
> </javac>
> 
> src, classpath, sourcepath, bootclasspath and extdirs would be
> possible.  Has this been the reason for your choice Conor?  

Yes

Conor



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 27 Nov 2002, Conor MacNeill <co...@cortexebusiness.com.au>
wrote:

> My definition of polymorphism in Ant is that I should be able to
> extend a type and pass that new type to the task in place of the
> original. [SNIP] The current approach is not that nice (defining a
> type instance with id and then refid'ing it at point of use).
> 
> So, this we should agree on as a desirable goal.

OK, +1 from me.

> What comes next is the notation to express the use of derived type,
> and the underlying implementation in the core. In Mutant I advocated
> an explicit statement of the substitution

This here?

<http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-ant/proposal/mutant/docs/Attic/features.html?rev=1.1#Extensibility>

> My original Ant 1 patch (which Magesh has cited) used a different
> approach where it tried to guess which underlying method is to be
> used.

So the example from the link above would become

    <copy todir="dest">
      <classfileset dir="../../bin/ant1compat/">
        <root classname="org.apache.tools.ant.Project"/>
      </classfileset>
    </copy>

yes?  Sorry, haven't had the time to read the patch to know.

This one looks easier to write and read from a build file writer's
perspective.  What has been the reason to use a different notation in
Mutant?

> Using only one piece of information (the type name) has limits.

I think I remember it.  A problem arises when you have two different
nested elements (element names) that both accept the same class.  Say
you have <mypath> that is derived from Path, what would it be used for
in

<javac ...>
  <mypath .../>
</javac>

src, classpath, sourcepath, bootclasspath and extdirs would be
possible.  Has this been the reason for your choice Conor?  How would
your patch deal with it Magesh?

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Stefan Bodewig wrote:
> 
> I agree (that we should agree 8-).  Could you define what you mean
> when you say "polymorphic behaviour"?  IIRC it has been a bit
> different from the notion other people on this list had.
> 

:-). Maybe only the notation.

Good point, however. My definition of polymorphism in Ant is that I should 
be able to extend a type and pass that new type to the task in place of the 
original. I think fileset and zipfileset are somewhat of an example 
(zipfileset may not obey Liskov, can't remember). Classfileset is another. 
When I committed classfileset, I could not upgrade all tasks, especially 
those outside Ant, to accept it in place of a standard fileset. The current 
approach is not that nice (defining a type instance with id and then 
refid'ing it at point of use).

So, this we should agree on as a desirable goal.

What comes next is the notation to express the use of derived type, and the 
underlying implementation in the core. In Mutant I advocated an explicit 
statement of the substitution and later found that this approach is also 
used in XML-Schema (I know not everyone likes this).

My original Ant 1 patch (which Magesh has cited) used a different approach 
where it tried to guess which underlying method is to be used. I haven't 
studied Magesh's patch in detail but for fully flexibly polymorphism, you 
need to identify the type of the object being passed and the method on the 
task to which you will pass it (i.e. two independent things). Using only one 
piece of information (the type name) has limits.

Conor


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 27 Nov 2002, Conor MacNeill <co...@cortexebusiness.com.au>
wrote:

> I think, perhaps, we should agree that polymorphic behaviour is a
> desirable objective.

I agree (that we should agree 8-).  Could you define what you mean
when you say "polymorphic behaviour"?  IIRC it has been a bit
different from the notion other people on this list had.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Costin Manolache <cm...@yahoo.com>.
Erik Hatcher wrote:

> I was just commenting that what little I know of Avalon/Cocoon has the
> same types of features our recent discussions have touched on (make
> everything an interface, make it pluggable with outside configuration,
> etc).

I'm not sure we have an agreement on making everything an interface :-)
There are cases where an interface is needed, but I think marker interfaces
will not be easily accepted.

Making things more pluggable and configurable is something most projects
are trying to do. I'm sure you won't see enforced IoC.

Some of the hooks that are proposed would allow a lot of fancy features - 
like transforming the build tree. That doesn't mean those features will
have to be in ant core and ant will do XSLT transformations and sitemaps on 
the build tree :-)
If someone needs this, it can be done in an external antlib.


Costin


> 
> I definitely agree with the polymorphic behavior.  When/if I ever get
> time to think through it more, I want the polymorphic behavior even at
> the Project level.
> 
> Erik
> 
> 
> Conor MacNeill wrote:
>> Erik Hatcher wrote:
>> 
>>> It looks like we're getting closer and closer to the Avalon-based
>>> version of Ant, huh?
>>>
>>> All this talk of interfaces, pluggability, and conditional tasks.....
>>> :)))
>>>
>> 
>> Magesh's patch is not really anything to do with Avalon or Myrmidon.
>> 
>> I think, perhaps, we should agree that polymorphic behaviour is a
>> desirable objective. I certainly think it is. When I define a subclass
>> of a type I should not need to change all tasks that take that type.
>> 
>> Conor
>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
>> 
>> 
>>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
I was just commenting that what little I know of Avalon/Cocoon has the 
same types of features our recent discussions have touched on (make 
everything an interface, make it pluggable with outside configuration, etc).

I definitely agree with the polymorphic behavior.  When/if I ever get 
time to think through it more, I want the polymorphic behavior even at 
the Project level.

	Erik


Conor MacNeill wrote:
> Erik Hatcher wrote:
> 
>> It looks like we're getting closer and closer to the Avalon-based 
>> version of Ant, huh?
>>
>> All this talk of interfaces, pluggability, and conditional tasks.....  
>> :)))
>>
> 
> Magesh's patch is not really anything to do with Avalon or Myrmidon.
> 
> I think, perhaps, we should agree that polymorphic behaviour is a 
> desirable objective. I certainly think it is. When I define a subclass 
> of a type I should not need to change all tasks that take that type.
> 
> Conor
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Erik Hatcher wrote:
> It looks like we're getting closer and closer to the Avalon-based 
> version of Ant, huh?
> 
> All this talk of interfaces, pluggability, and conditional tasks.....  :)))
> 

Magesh's patch is not really anything to do with Avalon or Myrmidon.

I think, perhaps, we should agree that polymorphic behaviour is a desirable 
objective. I certainly think it is. When I define a subclass of a type I 
should not need to change all tasks that take that type.

Conor



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Magesh Umasankar <um...@apache.org>.
----- Original Message -----
From: "Erik Hatcher" <ja...@ehatchersolutions.com>


> It looks like we're getting closer and closer to the Avalon-based
> version of Ant, huh?
>
> All this talk of interfaces, pluggability, and conditional tasks.....
:)))

:-)

ok,
s/implements/extends/g
s/Interface1/BaseClass1/g

... and the points I make below still stand...

Cheers,
Magesh

>
> Magesh Umasankar wrote:
> > Hi,
> >
> > This is basically a modification of Conor's patch
> > to enhance the Introspection capabilities. See:
> >
> > http://marc.theaimsgroup.com/?l=ant-dev&m=100591826612807&w=2
> >
> > The difference is that my patch looks for methods whose
> > parameter class type is assignable from the nested element's
> > class type.
> >
> > Let us say we have the following mappings:
> > TagDefA->ClassA
> > TagDefB->ClassB
> >
> > ClassA implements Interface1
> > ClassB implements Interface1
> >
> > Currently, if we want these as nested elements,
> > we would have to define
> >
> > addTagDefA(ClassA)
> > addTagDefB(ClassB)
> >
> > With this patch, if you define,
> >
> > addInterface1(Interface1)
> >
> > it would be good enough and will be called when
> > you have a nested element like <tagdefa .../> or
> > <tagdefb.../> and no equivalent addTagDef methods.
> >
> > So, Where does this apply?  It applies to
> > <condition>, <filterchain>, etc. and of course the
> > <fileset> issue that Conor originally solved.
> >
> > In my patch, I have minimally shown how this
> > is applied to ConditionBase.
> >
> > This patch depends upon my earlier patch Project.java
> > because when Condition is initialized, it expects
> > its nested elements to have been already initialized.
> > If they are not, then it balks.
> >
> > Cheers,
> > Magesh
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
It looks like we're getting closer and closer to the Avalon-based 
version of Ant, huh?

All this talk of interfaces, pluggability, and conditional tasks.....  :)))

Magesh Umasankar wrote:
> Hi,
> 
> This is basically a modification of Conor's patch
> to enhance the Introspection capabilities. See:
> 
> http://marc.theaimsgroup.com/?l=ant-dev&m=100591826612807&w=2
> 
> The difference is that my patch looks for methods whose
> parameter class type is assignable from the nested element's
> class type.
> 
> Let us say we have the following mappings:
> TagDefA->ClassA
> TagDefB->ClassB
> 
> ClassA implements Interface1
> ClassB implements Interface1
> 
> Currently, if we want these as nested elements, 
> we would have to define
> 
> addTagDefA(ClassA)
> addTagDefB(ClassB)
> 
> With this patch, if you define, 
> 
> addInterface1(Interface1)
> 
> it would be good enough and will be called when
> you have a nested element like <tagdefa .../> or 
> <tagdefb.../> and no equivalent addTagDef methods.
> 
> So, Where does this apply?  It applies to
> <condition>, <filterchain>, etc. and of course the
> <fileset> issue that Conor originally solved.
> 
> In my patch, I have minimally shown how this
> is applied to ConditionBase.
> 
> This patch depends upon my earlier patch Project.java
> because when Condition is initialized, it expects
> its nested elements to have been already initialized.
> If they are not, then it balks.
> 
> Cheers,
> Magesh
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Adding Dynamic elements for the n'th time

Posted by Costin Manolache <cm...@yahoo.com>.
I'm +1 on the concept ( i.e. I think it would be usefull to add this
behavior ).

I need to better understand the patch impl, but I seems reasonable.

Costin

Magesh Umasankar wrote:

> Hi,
> 
> This is basically a modification of Conor's patch
> to enhance the Introspection capabilities. See:
> 
> http://marc.theaimsgroup.com/?l=ant-dev&m=100591826612807&w=2
> 
> The difference is that my patch looks for methods whose
> parameter class type is assignable from the nested element's
> class type.
> 
> Let us say we have the following mappings:
> TagDefA->ClassA
> TagDefB->ClassB
> 
> ClassA implements Interface1
> ClassB implements Interface1
> 
> Currently, if we want these as nested elements,
> we would have to define
> 
> addTagDefA(ClassA)
> addTagDefB(ClassB)
> 
> With this patch, if you define,
> 
> addInterface1(Interface1)
> 
> it would be good enough and will be called when
> you have a nested element like <tagdefa .../> or
> <tagdefb.../> and no equivalent addTagDef methods.
> 
> So, Where does this apply?  It applies to
> <condition>, <filterchain>, etc. and of course the
> <fileset> issue that Conor originally solved.
> 
> In my patch, I have minimally shown how this
> is applied to ConditionBase.
> 
> This patch depends upon my earlier patch Project.java
> because when Condition is initialized, it expects
> its nested elements to have been already initialized.
> If they are not, then it balks.
> 
> Cheers,
> Magesh




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>