1 16 package org.apache.cocoon.woody.binding; 17 18 import org.apache.cocoon.woody.util.DomHelper; 19 import org.w3c.dom.Element ; 20 21 35 public class SimpleRepeaterJXPathBindingBuilder 36 extends JXPathBindingBuilderBase { 37 38 public JXPathBindingBase buildBinding(Element bindingElem, 39 JXPathBindingManager.Assistant assistant) throws BindingException { 40 try { 41 CommonAttributes commonAtts = 42 JXPathBindingBuilderBase.getCommonAttributes(bindingElem); 43 44 String repeaterId = DomHelper.getAttribute(bindingElem, "id"); 45 String parentPath = DomHelper.getAttribute( 46 bindingElem, "parent-path"); 47 String rowPath = DomHelper.getAttribute(bindingElem, "row-path"); 48 boolean clearOnLoad = DomHelper.getAttributeAsBoolean( 49 bindingElem, "clear-before-load", true); 50 boolean deleteIfEmpty = DomHelper.getAttributeAsBoolean( 51 bindingElem, "delete-parent-if-empty", false); 52 53 JXPathBindingBase[] childBindings = 54 assistant.makeChildBindings(bindingElem); 55 56 return new SimpleRepeaterJXPathBinding(commonAtts, repeaterId, 57 parentPath, rowPath, clearOnLoad, deleteIfEmpty, 58 new ComposedJXPathBindingBase( 59 JXPathBindingBuilderBase.CommonAttributes.DEFAULT, 60 childBindings)); 61 } catch (BindingException e) { 62 throw e; 63 } catch (Exception e) { 64 throw new BindingException( 65 "Error building repeater binding defined at " + 66 DomHelper.getLocation(bindingElem), e); 67 } 68 } 69 } 70 | Popular Tags |