(InstanceScope scope, Iterator<?> attr, List<ST> prototypes)
| 812 | } |
| 813 | |
| 814 | protected List<ST> rot_map_iterator(InstanceScope scope, Iterator<?> attr, List<ST> prototypes) { |
| 815 | List<ST> mapped = new ArrayList<ST>(); |
| 816 | Iterator<?> iter = attr; |
| 817 | int i0 = 0; |
| 818 | int i = 1; |
| 819 | int ti = 0; |
| 820 | while ( iter.hasNext() ) { |
| 821 | Object iterValue = iter.next(); |
| 822 | if ( iterValue==null ) { |
| 823 | mapped.add(null); |
| 824 | continue; |
| 825 | } |
| 826 | |
| 827 | int templateIndex = ti% prototypes.size(); // rotate through |
| 828 | ti++; |
| 829 | ST proto = prototypes.get(templateIndex); |
| 830 | ST st = group.createStringTemplateInternally(proto); |
| 831 | setFirstArgument(scope, st, iterValue); |
| 832 | if ( st.impl.isAnonSubtemplate ) { |
| 833 | st.rawSetAttribute("i0", i0); |
| 834 | st.rawSetAttribute("i", i); |
| 835 | } |
| 836 | mapped.add(st); |
| 837 | i0++; |
| 838 | i++; |
| 839 | } |
| 840 | return mapped; |
| 841 | } |
| 842 | |
| 843 | /** |
| 844 | * Renders expressions of the form {@code <names,phones:{n,p | ...}>} or |
no test coverage detected