1 16 package org.apache.cocoon.forms.binding; 17 18 import org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant; 19 import org.apache.cocoon.forms.util.DomHelper; 20 import org.w3c.dom.Element ; 21 22 37 public class InsertBeanJXPathBindingBuilder extends JXPathBindingBuilderBase { 38 39 43 public JXPathBindingBase buildBinding(Element bindingElm, Assistant assistant) throws BindingException { 44 45 try { 46 CommonAttributes commonAtts = JXPathBindingBuilderBase.getCommonAttributes(bindingElm); 47 48 String className = 49 DomHelper.getAttribute(bindingElm, "classname", null); 50 String addMethod = 51 DomHelper.getAttribute(bindingElm, "addmethod",null); 52 53 InsertBeanJXPathBinding otherBinding = (InsertBeanJXPathBinding)assistant.getContext().getSuperBinding(); 55 if(otherBinding!=null) { 56 commonAtts = JXPathBindingBuilderBase.mergeCommonAttributes(otherBinding.getCommonAtts(),commonAtts); 57 58 if(className==null) 59 className = otherBinding.getClassName(); 60 if(addMethod==null) 61 addMethod = otherBinding.getAddMethodName(); 62 } 63 64 return new InsertBeanJXPathBinding(commonAtts, className, addMethod); 65 } catch (BindingException e) { 66 throw e; 67 } catch (Exception e) { 68 throw new BindingException("Error building a insert-bean binding defined at " + DomHelper.getLocation(bindingElm), e); 69 } 70 } 71 } 72 | Popular Tags |