ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Curt Arnold" <carn...@houston.rr.com>
Subject Re: XDocs Proposal
Date Wed, 27 Feb 2002 15:34:05 GMT
> Some interesting issues are: How do we deal with enumerated types? (since
its
> building off the source code, I can't just instantiate and call the method
> to get the values - or, could I assume the class is available to
> instantiate?  we are running *in* Ant after all!)

Even that however won't get any descriptive text for the enumeration.

All I've seen in the Ant code base for "enumerations" are set methods with
string arguments.  For example, Available.setType(String).  Passing an value
other than file or dir to setType will cause the task to fail later.

Is there some support for the type-safe enum construct in Ant?  For example,
could you do something like:

public void setType(FileSystemObjectType type);

public class FileSystemObjectType {
     private FileSystemObjectType() { ... }
     /**
       *   description of "file" option goes here
       */
     public static final FileSystemObjectType file = new FileSystemObject();
     /**
       *   description of "dir" option goes here
       */
     public static final FileSystemObjectType dir = new FileSystemObject();
}

If not, then you could probably get away with an @enumeration tag on the set
method.

> Should we add the equivalent of the user manual's "required" column
> somewhere?

Would it be better to cover more multiplicity options than just 1..1 and
unspecified?  The most general would be a @minOccurs and @maxOccurs tag, by
@required, @optional, @zeroOrMore and @oneOrMore would probably cover the
gamut.

My interest in this is generating an XML schema from the XDoc so that you
validate an ant script before running it and have some assistance in XML
editors.  I think it would be pretty likely you could generate an reasonable
schema from the XDocs.




--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message