Search code examples
templatesxtend

Generate files with multiple columns and compute spacing with Xtend


How can I generate columns with spacing using xtend? Is there a way, without computing by myself the length of the columns? Are there any utility classes for generating columns?

The generated output, that I want to achieve is:

{ AA, -1, XX, FFXXXYY, 0, 0, 0 },
{ BB,  1, FF,       1, 0, 0, "Blup" },

Solution

  • There are no Xtend specific utilities, but you may want to use Guava's Strings.padStart to prepend the spaces per column.