1 4 package gnu.kawa.xml; 5 import gnu.mapping.*; 6 import gnu.lists.*; 7 8 import java.util.Iterator ; 9 import java.util.List ; 10 11 12 13 14 public class ListItems extends MethodProc 15 { 16 public static ListItems listItems = new ListItems(); 17 18 public void apply (CallContext ctx) 19 { 20 Consumer out = ctx.consumer; 21 Object arg = ctx.getNextArg(); 22 ctx.lastArg(); 23 24 25 List list = (List ) arg; 26 if (arg instanceof AbstractSequence) 27 { 28 ((AbstractSequence) arg).consumePosRange(0, -1, out); 29 return; 30 } 31 Iterator iter = list.iterator(); 32 while (iter.hasNext()) 33 { 34 Object val = iter.next(); 35 Values.writeValues(val, out); 36 } 37 38 39 41 } 42 } 43 | Popular Tags |