def builder = new FixedWidthRecordSetBuilder()
builder.TestData(){
record1(){
field1(startPosition : 0, width : 5, content : short_content)
field2(startPosition : 5, width : 10, content : long_content)
}
record2(){
field1(startPosition : 0, width : 5, content : short_content.reverse())
field2(startPosition : 5, width : 10, content : long_content.reverse())
}
}
builder.records.each { record ->
println record.formattedContent //or to a file
}
You can get the goods from my svn repository:
You can log in with the user guest. The user does not have a password.
The Groovy website has more on the general topic of builders in Groovy.
Enjoy!
No comments:
Post a Comment