1 5 package com.opensymphony.webwork.views.xslt; 6 7 import org.apache.commons.logging.Log; 8 import org.apache.commons.logging.LogFactory; 9 10 import java.util.ArrayList ; 11 import java.util.List ; 12 13 14 19 public class ArrayAdapter extends DefaultElementAdapter { 20 22 private Log log = LogFactory.getLog(this.getClass()); 23 24 26 public ArrayAdapter(DOMAdapter rootAdapter, AdapterNode parent, String propertyName, Object value) { 27 super(rootAdapter, parent, propertyName, value); 28 } 29 30 32 protected List buildChildrenAdapters() { 33 List children = new ArrayList (); 34 Object [] values = (Object []) getValue(); 35 36 for (int i = 0; i < values.length; i++) { 37 AdapterNode childAdapter = getRootAdapter().adapt(getRootAdapter(), this, "item", values[i]); 38 children.add(childAdapter); 39 40 if (log.isDebugEnabled()) { 41 log.debug(this + " adding adapter: " + childAdapter); 42 } 43 } 44 45 return children; 46 } 47 } 48 | Popular Tags |