Further work on making JMustache work in GWT.

I've ironed out most of the kinks, but the GWT unit test still fails because
we're forced to do some sneaky things with java.io.Reader/Writer. I think it
will all work when compiled to JavaScript, so I need to check it in a real
project.
This commit is contained in:
Michael Bayne
2011-10-29 15:31:27 -07:00
parent f9319ce911
commit 407d999836
9 changed files with 143 additions and 3 deletions
@@ -1,24 +0,0 @@
//
// $Id$
package com.samskivert.mustache;
import java.util.Arrays;
import java.util.Iterator;
/**
* A collector used when running in GWT.
*/
public class DefaultCollector extends BasicCollector
{
@Override
public Iterator<?> toIterator (final Object value) {
Iterator<?> iter = super.toIterator(value);
if (iter != null) return iter;
if (value.getClass().isArray()) {
return Arrays.asList((Object[])value);
}
return null;
}
}