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:
-24
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user