ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
Subject [PROPOSAL] Adding extension attributes to Tasks
Date Fri, 24 Mar 2000 08:39:35 GMT
Hi,

I think we could make extensions to tasks like the proposed setif
easier if we allow for attributes without corresponding setter-methods 
in tasks.

My idea:

* add a method 

public void unknownAttribute(String attribute, String value) 
    throws BuildException {

    String msg = "Configuration property \"" + attribute +
        "\" does not have a setMethod in " + getClass();
    throw new BuildException(msg);
}

to org.apache.tools.ant.Task

* in org.apache.tools.ant.ProjectHelper try to call
  unknownAttribute(String, String) on target in configure if there is
  no setter method.

This wouldn't change the behavior for the existing tasks but
something like my proposed setif could lookup the attribute name
in a property file and find out which class to instantiate and which
setter-method to call - much lick the definition of built-in tasks.

Again I could submit code but would like to get some feedback first.

Stefan

Mime
View raw message