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