I am using groovy 1.8 where i want to have a list something like this List<MyQueryClass> queryl=new List<MyQueryClass>()
So that using the below loop i can add more to this list, how can I do that?
def queryxml=new XmlSlurper().parse(QueryProvider.class.getResourceAsStream( '/queries.xml' ))
queryxml.query.each { node ->
operation="${[email protected]()}"
if(operation.equals(op.create.toString()))
{
query="${node.text()}"
println "$query"
MyQueryClass myQuery=new MyQueryClass (query)
queryl.add(myQuery)
}
}
querylabove this code, when i writeList<MyQueryClass> queryl=new List<MyQueryClass>()i getGroovy:You cannot create an instance from the abstract interface 'java.util.List'error