commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Kendall <>
Subject [betwixt] Array of objects.
Date Wed, 16 Nov 2005 23:14:15 GMT
I've been tearing my hair out on this all afternoon. I've tried
configuring Betwixt in way too many different ways to list them all
here, so instead I'll just ask: what's the best way to handle the File
object, specifically an array of file objects? I would like the
following code to print out "2 == 2".

public class FileTest {
	private File[] files;
	public File[] getFiles() {
		return files;
	public void setFiles(File[] files) {
		this.files = files;

	public static void main(String[] args) {
		FileTest test = new FileTest();

		test.setFiles(new File[] { new File("a.txt"), new File("b.txt") });

		try {
			BeanWriter writer = new BeanWriter(new FileWriter("ftout.xml"));
			BeanReader reader = new BeanReader();
			test = (FileTest) reader.parse("ftout.xml");
			System.out.println("2 == " + test.getFiles().length);
		} catch (Exception e) {



I apologize if this question is too vague, but I've created so many
mappers, converters, chains, etc. that enumerating all of them is much
more complicated than simply understanding what I want from the
following code.

Oh, and the one solution I cannot employ is to rewrite the bean that I
need to convert to XML. I didn't write it so I cannot change it.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message