Make the code Java5 compatible.

This commit is contained in:
Serkan Kaba
2012-04-10 14:26:57 +02:00
parent 75da7d3e76
commit ffe46f5865
2 changed files with 4 additions and 6 deletions
@@ -11,7 +11,6 @@ import java.util.Map;
*/
public class BasicCollector implements Mustache.Collector
{
@Override
public Iterator<?> toIterator (final Object value) {
if (value instanceof Iterable<?>) {
return ((Iterable<?>)value).iterator();
@@ -22,7 +21,6 @@ public class BasicCollector implements Mustache.Collector
return null;
}
@Override
public Mustache.VariableFetcher createFetcher (Object ctx, String name)
{
// support both .name and this.name to fetch members
@@ -38,13 +36,13 @@ public class BasicCollector implements Mustache.Collector
}
protected static final Mustache.VariableFetcher MAP_FETCHER = new Mustache.VariableFetcher() {
@Override public Object get (Object ctx, String name) throws Exception {
public Object get (Object ctx, String name) throws Exception {
return ((Map<?,?>)ctx).get(name);
}
};
protected static final Mustache.VariableFetcher THIS_FETCHER = new Mustache.VariableFetcher() {
@Override public Object get (Object ctx, String name) throws Exception {
public Object get (Object ctx, String name) throws Exception {
return ctx;
}
};
@@ -43,7 +43,7 @@ public class DefaultCollector extends BasicCollector
final Method m = getMethod(cclass, name);
if (m != null) {
return new Mustache.VariableFetcher() {
@Override public Object get (Object ctx, String name) throws Exception {
public Object get (Object ctx, String name) throws Exception {
return m.invoke(ctx);
}
};
@@ -52,7 +52,7 @@ public class DefaultCollector extends BasicCollector
final Field f = getField(cclass, name);
if (f != null) {
return new Mustache.VariableFetcher() {
@Override public Object get (Object ctx, String name) throws Exception {
public Object get (Object ctx, String name) throws Exception {
return f.get(ctx);
}
};