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 Wed, 14 Nov 2001 16:17:30 GMT

I would like someone to either confirm or deny some assumptions I'm makeing
on how subelements get pulled into custom tasks.

The documentation Stefan refers to below doesn't really give a lot of
informaiton on when you should use createXXX vs addXXX.  It also doesn't
give much information on how they are supposed to work, and what they are
supposed to do.  So, here are my assumptions:

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.

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.  ant
will have already called these methods for any attributes and subelements
that are present.

So, how'd I do?

Marc Robertson
DST Systems, Inc.


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




On Wed, 14 Nov 2001, Mark Claassen <mac@donnell.com> wrote:

> I am trying to write a custom task and I need to have a subelement
> in it

See <http://jakarta.apache.org/ant/manual/develop.html> list element 5
in the first section.

> like the following example.
>
> <target name = "Task">
>    <SubSection>
>         <element1/>
>         <element2/>
>         ...
>    </SubSection>
> </target>

The class corrsponding to SubSection needs methods like

public Foo createElement1()

or

public void addElement2(Bar aBar)

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