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