You don't do that. A listener listens to what tasks print or log, and
takes that string and meta-data about where it's coming from, to decide
what to do with it. It has no business introspecting the event's source
Task or Type for its attributes or nested elements, even if it can be
done.

Anyways... --DD

> -----Original Message-----
> From: Radha Sangal [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 27, 2005 5:07 PM
> To: Ant Users List
> Subject: retrive value in listener
> 
> This might not be specific to ant, but if someone has implemented this
,
> how do we retrieve a value from the custom task made in listener
> 
> 
> 
> Eg.
> 
> 
> 
> In xml : <newtask message="Hello World! NewTask works!"/>
> 
> 
> 
> In listener: something similar to this , this one doesn't work ...
> 
> public void messageLogged( BuildEvent event )
> 
>       {
> 
>             RuntimeConfigurable aRC =
> event.getTask().getRuntimeConfigurableWrapper();
> 
>             AttributeList hTable = aRC.getAttributes();
> 
>             String message =
>
event.getProject().replaceProperties((String)hTable.getValue("message"))
> ;
> 
>             System.out.println( "A Message: " + message );
> 
>       }
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to