Examples of MapListAdapter


Examples of net.sf.laja.context.MapListAdapter

    if (reference == null) {
      if (listData != null) {
        List<Object> foreachList = (List<Object>)listData.evaluate();
        return foreachList.iterator();
      } else {
        return new MapListAdapter((Map)mapDataRef.evaluate()).iterator();
      }
    }
    Object ref = reference.evaluate();
    Iterator<Object> iterator;
   
    if (ref == null) {
      iterator = Collections.emptyList().iterator();
    } else if (ref instanceof Iterator) {
      iterator = (Iterator)ref;
    } else if (ref instanceof Iterable) {
      iterator = ((Iterable)ref).iterator();
    } else if (ref.getClass().isArray()) {
      iterator = new ArrayListAdapter(ref).iterator();
    } else if (ref instanceof Map) {
      iterator = new MapListAdapter((Map)ref).iterator();
    } else {
      throw new InterpretationException(source, indexInSource, "Can not iterate over a " + ref.getClass().getCanonicalName());
    }
    return iterator;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.