ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Sub-element question
Date Wed, 14 Nov 2001 16:26:41 GMT
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>


Mime
View raw message