ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MARobert...@dstsystems.com
Subject Re: Sub-element question
Date Thu, 15 Nov 2001 13:58:27 GMT

Thanks Stefan!  I wasn't too far off, probably would have caught my mistake
in testing.


                                                                                         
                       
                    Stefan                                                               
                       
                    Bodewig              To:     ant-user@jakarta.apache.org             
                       
                    <bodewig@apac        cc:                                          
                          
                    he.org>              Subject:     Re: Sub-element question        
                          
                                                                                         
                       
                    11/14/01                                                             
                       
                    10:26                                                                
                       
                    Please                                                               
                       
                    respond to                                                           
                       
                    "Ant Users                                                           
                       
                    List"                                                                
                       
                                                                                         
                       
                                                                                         
                       




On Wed, 14 Nov 2001, <MARobertson@dstsystems.com> wrote:

> createXXX: The object returned must be a class that has appropriate
> setXXX methods for any of the elements attributes and createXXX or
> addXXX methods for any nested subelements. ant will then call these
> methods for any attributes and subelements that are present.

correct.  Use this if it is for some reason impossible to use a class
with a public no-arg constructor.  Non-static inner classes for
example.

> addXXX; The object passed in has been instantiated by ant with a
> no-argument constructor.  It must also have setXXX methods for any
> attributes and createXXX or addXXX methods for any nested
> subelements.

correct so far.

> ant will have already called these methods for any attributes and
> subelements that are present.

No - it is the same like the createXXX case, Ant will call them after
it has called the add method.  The only difference is who is
responsible for creating the instance.

That being said, there also is the yet to be documented choice of
using addConfiguredXXX that does exactly what you assumed addXXX would
do - it will call the setter methods of the child before it calls the
addXXX method.  This one is available starting with Ant 1.4 IIRC.

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message