You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Vincent Bergbauer <vi...@yahoo.com> on 2000/09/28 16:59:23 UTC
Re: refid in property - sorry about the word wrap...
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. But FileSets that are build directly from code won't have a
meaningful toString()
method.
- I have no idea of what PatternSet should return in its toString method.
Code coming soon.
Vincent.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com