• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Object passing to AntTask?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Does anyone know if it is possible to pass an object to a custom anttask?
example :

<login trader="Trader1" password="pswd">
<stocks name="Yahoo" value="t.yah"/>
<margin value ="10000"/>
<anything name = "any" value="thing"/>
</login>

Can i simply pass the login object to a custom ant task? How? any examples?

Thanks!

Mike
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean like



?

Yes, that's possible - see "Supporting nested elements" at http://ant.apache.org/manual/develop.html#writingowntask

The mechanism works recursively - that is, nested elements can again have nested elements etc. pp.

Does that help?
 
Mike Mass
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ilja,

This is exactly what i was looking for!
Thanks alot for your input.

Btw, can the object "login" reside in an imported file and passed by reference? or it absolutley has to be passed under <myCustomTask> with all its members?

Regards,

Mike
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic