1 16 package org.apache.cocoon.forms.binding; 17 18 import org.apache.cocoon.forms.util.DomHelper; 19 import org.w3c.dom.Element ; 20 21 35 public class NewJXPathBindingBuilder 36 extends JXPathBindingBuilderBase { 37 38 public JXPathBindingBase buildBinding(Element bindingElm, JXPathBindingManager.Assistant assistant) 39 throws BindingException { 40 try { 41 String widgetId = DomHelper.getAttribute(bindingElm, "id", null); 42 CommonAttributes commonAtts = JXPathBindingBuilderBase.getCommonAttributes(bindingElm); 43 44 JXPathBindingBase[] childBindings = new JXPathBindingBase[0]; 45 46 NewJXPathBinding otherBinding = (NewJXPathBinding)assistant.getContext().getSuperBinding(); 48 if(otherBinding!=null) { 49 childBindings = otherBinding.getChildBindings(); 50 commonAtts = JXPathBindingBuilderBase.mergeCommonAttributes(otherBinding.getCommonAtts(),commonAtts); 51 52 if(widgetId==null) 53 widgetId = otherBinding.getId(); 54 } 55 56 childBindings = assistant.makeChildBindings(bindingElm,childBindings); 57 58 NewJXPathBinding newBinding = new NewJXPathBinding(commonAtts, widgetId, childBindings); 59 return newBinding; 60 } catch (BindingException e) { 61 throw e; 62 } catch (Exception e) { 63 throw new BindingException("Error building new binding defined at " + DomHelper.getLocation(bindingElm), e); 64 } 65 } 66 } 67 | Popular Tags |