The Schema file is there to support GUI tools for example. They
could prompt for required attributes,
This would be nice!
let you select enumerated attributes from a list,
FWIW, NetBeans would not need this - currently loads the
EnumeratedAttribute subclass on the fly and uses it for code completion.
But having this information in a static declarative format might be better.
Relying on such a format might not be a good idea unless it were widely
used and easy to create, though - I think it's pretty common to just
write a one-off task that you use in a script as needed, and it's nice
for a tool to be able to offer code completion and other structural help
with such a custom task. (E.g. NB analyzes custom tasks when you run a
script which defines them, as a heuristic.) The nice thing about apt is
that it could ensure that all the needed info is right there in the
java.lang.Class - not good for general docs but nice for finding
required attributes and that sort of thing. Not available for JDK
1.2-1.4 though.
BTW I just had a thought - should use of EnumeratedAttribute be required
for JDK 5 users? Maybe you should be able to just do something like
public enum WhenEmptyAction {fail, create, skip}
public class SomeTask {
public void setWhenempty(WhenEmptyAction action) {...}
public void execute() {...}
}
require integer attributes to really contain numbers ...
I think the signature of the task class already handles this case,
right? setSomething(int)?
[EMAIL PROTECTED] wrote:
How the IDEs solve that at the moment?
For required attributes, you can't solve it that I know of, without
hardcoding attribute names for well-known tasks (or trying to parse the
HTML tables in the docs, or something icky like that).
-J.
--
[EMAIL PROTECTED] x22801 netbeans.org ant.apache.org
if I had known it was harmless I would have killed it myself
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]