(InstanceScope scope, Iterator<?> attr, List<ST> prototypes)
| 840 | } |
| 841 | |
| 842 | protected List<ST> rot_map_iterator(InstanceScope scope, Iterator<?> attr, List<ST> prototypes) { |
| 843 | List<ST> mapped = new ArrayList<ST>(); |
| 844 | Iterator<?> iter = attr; |
| 845 | int i0 = 0; |
| 846 | int i = 1; |
| 847 | int ti = 0; |
| 848 | while ( iter.hasNext() ) { |
| 849 | Object iterValue = iter.next(); |
| 850 | if ( iterValue==null ) { |
| 851 | mapped.add(null); |
| 852 | continue; |
| 853 | } |
| 854 | |
| 855 | int templateIndex = ti% prototypes.size(); // rotate through |
| 856 | ti++; |
| 857 | ST proto = prototypes.get(templateIndex); |
| 858 | ST st = group.createStringTemplateInternally(proto); |
| 859 | setFirstArgument(scope, st, iterValue); |
| 860 | if ( st.impl.isAnonSubtemplate) { |
| 861 | st.rawSetAttribute("i0", i0); |
| 862 | st.rawSetAttribute("i", i); |
| 863 | } |
| 864 | mapped.add(st); |
| 865 | i0++; |
| 866 | i++; |
| 867 | } |
| 868 | return mapped; |
| 869 | } |
| 870 | |
| 871 | /** |
| 872 | * Renders expressions of the form {@code <names,phones:{n,p | ...}>} or |
no test coverage detected