Consider these classes...
src/java/com/example/SomeClass.java
package
com.example;
public
class SomeClass {
public
SomeClass(java.util.List<SomeOtherClass> soc) {
}
}
src/java/com/example/SomeOtherClass.java
package
com.example;
public
class SomeOtherClass {
public
SomeOtherClass(java.io.File f) {
}
}
In the Spring Bean Builder you can wire those up using something like this...
grails-app/conf/resources.groovy
beans = {
xmlns util:"http://www.springframework.org/schema/util"
someotherbean(com.example.SomeOtherClass, new
File('somefile.txt'))
someotherbean2(com.example.SomeOtherClass, new
File('somefile.txt'))
util.list(id: 'mybeans'){
ref(bean:'someotherbean')
ref(bean:'someotherbean2')
}
somebean(com.example.SomeClass, ref('mybeans') )
}
It would be better if you could do something like this...
grails-app/conf/resources.groovy
beans = {
someotherbean(com.example.SomeOtherClass, new
File('somefile.txt'))
someotherbean2(com.example.SomeOtherClass, new
File('somefile.txt'))
somebean(com.example.SomeClass, [someotherbean, someotherbean2])
}