Hi,
I have been reading an article in a java magazine about how to create one's
own ant task. Since then I am trying to excercise on it.
I am defining a task, lets say "MyTask". MyTask has a sub element "Parameter"
with both "name" and "value" attribute, so I have written an
org.apache.ant.Task subclass named Parameter and in my "main" programm
containing the execute method I also have the method "public
com.myDomain.Parameter createParameter ()" and both "Parameter m_param" and
"Vector m_params" (since it should be possible to have more than one
parameter...). The following implementation:
public com.tcheer.xalANTask.Parameter createParameter () {
//System.out.println ("+ createParameter");
this.m_param = new Parameter ();
this.m_params.add (this.m_param);
//System.out.println("\tout");
return m_param;
}
seems not to create a Parameter object with both name and value, but gives me
an empty object. Actually it is obvious
Please I would appreciate any contribution from you if you think you can help.
PS: The Parameter.java
class Parameter extends org.apache.ant.Task {
Parameter () {...}
public void setName (String name) {...}
public void setValue (String value) {...}
//and the equivalent getMethods (though I think I don't need them, do I?)
private String m_pname;
private String m_pvalue;
}
--
Eric Tchepannou
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>