(InstanceScope scope, Iterator<?> attr, List<ST> prototypes)
| 789 | } |
| 790 | |
| 791 | protected List<ST> rot_map_iterator(InstanceScope scope, Iterator<?> attr, List<ST> prototypes) { |
| 792 | List<ST> mapped = new ArrayList<ST>(); |
| 793 | Iterator<?> iter = attr; |
| 794 | int i0 = 0; |
| 795 | int i = 1; |
| 796 | int ti = 0; |
| 797 | while ( iter.hasNext() ) { |
| 798 | Object iterValue = iter.next(); |
| 799 | if ( iterValue==null ) { |
| 800 | mapped.add(null); |
| 801 | continue; |
| 802 | } |
| 803 | |
| 804 | int templateIndex = ti% prototypes.size(); // rotate through |
| 805 | ti++; |
| 806 | ST proto = prototypes.get(templateIndex); |
| 807 | ST st = group.createStringTemplateInternally(proto); |
| 808 | setFirstArgument(scope, st, iterValue); |
| 809 | if ( st.impl.isAnonSubtemplate ) { |
| 810 | st.rawSetAttribute("i0", i0); |
| 811 | st.rawSetAttribute("i", i); |
| 812 | } |
| 813 | mapped.add(st); |
| 814 | i0++; |
| 815 | i++; |
| 816 | } |
| 817 | return mapped; |
| 818 | } |
| 819 | |
| 820 | /** |
| 821 | * Renders expressions of the form {@code <names,phones:{n,p | ...}>} or |
no test coverage detected