ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Bergbauer" <vincent_bergba...@yahoo.com>
Subject Re: refid in property
Date Thu, 28 Sep 2000 14:51:19 GMT
Give me a couple more days.
This is what I am doing:
- Path, FileSet, and soon Arg implement the CompositeType interface:
interface CompositeType {
    /**
     * Returns a array of String, representing each element of the object
     */
    String[] list();
    /**
     * Gets the separator character used by the <code>toString()</code>
method.
     */
    char getSeparator();
    /**
     * When <code>noDuplicate</code> is set to <code>true</code>,
the list
     * returned by <code>list()</code> will not have any duplicate.
     */
    void setNoDuplicate(boolean noDuplicate);
    /**
     * Returns <code>true</code> if <code>list()</code> removes duplicates.
     */
    boolean getNoDuplicate();
    /**
     * Returns a String with the specified (instead of the default)
separator
     */
    String toString(char separator);
}

- Property will take an additional optional argument, called separator, that
will cause the referenced object to return
  a String with the specified separator. Otherwise the default separator is
used (path separator for Path, space for Arg
  and FileSet.

- I consider separator a property of the referencing object (it wants a
specific view) rather than of the referenced
  object: a FileSet could be used with space separator or path separator
depending on the context.

- I consider the fact that a CompositeType returns or does not return
duplicate a property of the object itself.
  In fact, I am not sure that setNoDuplicate() should be public.

At this point, I have two issues:
- For FileSet to return a list of file, it requires context from a project.
I have decided to add a constructor that takes
  a Project as argument like path. In fact I have made project a field of
DataType.
- I have no idea of what PatternSet should return in its toString method.

Code coming soon.
Vincent.


----- Original Message -----
From: "Stefan Bodewig" <bodewig@bost.de>
To: <ant-dev@jakarta.apache.org>
Sent: Thursday, September 28, 2000 3:40 AM
Subject: Re: refid in property


> >>>>> "JAF" == Jose Alberto Fernandez <JFernandez@viquity.com> writes:
>
>  JAF> I think there are perfectly valid String versions for these
>  JAF> things:
>
>  JAF> - FileSet.toString() should return the white space separated
>  JAF> list of files like you would use in the <arg line="..."> of
>  JAF> <exec>.
>
> I'm not sure. Maybe will won't the excluded directories instead of the
> included files. OK, that's silly, but what about included directories
> - list them or not?
>
> Then you might prefer comma as a separator - and quoting of filenames
> that contain spaces ...
>
>  JAF> - Path.toString() should return the path in the correct format
>  JAF> for the OS.
>
> it does 8^)
>
>  JAF> About AntStructure, well souldn't it generate the DTD as the
>  JAF> string?
>
> But you are holding a reference to the AntStructure task, not its
> result. So toString would need to call execute first. Could be done,
> but do you think it would be useful (to have a property holding the
> DTD)?
>
> Stefan


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message