ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: need IntrosectionHelper help (was: [PATCH] comma separated PVCS projects)
Date Mon, 23 Apr 2001 09:28:04 GMT
Frank Wierzbicki <wierzbickif@yahoo.com> wrote:

> but my addPvcsProject method never gets called.  CreatePvcsproject
> does get called for each <pvcsproject> element, and addText in the
> inner class gets called with the value "/proj" (in the example
> below), so I could just use that, but I'm not sure that this would
> be the Right Thing To Do.

It would be.

Ant will use either createXYZ or addXYZ, not both.  Use addXYZ if Ant
can create the object itself (it needs no-arg constructor) and
createXYZ if only the task itself can do so (non-static inner class of
the task for example).


> Any suggestions would be appreciated,

I'd use 

    private Vector projects ...

    public void addPvcsproject(PvcsProject p) throws BuildException {
        projects.add(p);
    }

and make your PvcsProject a stand alone class or a static inner class.

Stefan

Mime
View raw message