1 16 package org.apache.cocoon.forms.binding; 17 18 import org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant; 19 import org.apache.cocoon.forms.binding.library.Library; 20 import org.apache.cocoon.forms.binding.library.LibraryException; 21 import org.apache.cocoon.forms.util.DomHelper; 22 import org.w3c.dom.Element ; 23 24 27 public class ExpandJXPathBindingBuilder extends JXPathBindingBuilderBase { 28 29 32 public JXPathBindingBase buildBinding(Element bindingElm, 33 Assistant assistant) throws BindingException { 34 35 Library lib = assistant.getContext().getLocalLibrary(); 36 37 String id = DomHelper.getAttribute(bindingElm, "id", null); 38 39 if(id == null) 40 throw new BindingException("Attribute id is required! (at "+DomHelper.getLocation(bindingElm)+")"); 41 42 try { 43 return (JXPathBindingBase)lib.getBinding(id); 44 } catch(LibraryException e) { 45 throw new BindingException("Could not expand binding from library! (at "+DomHelper.getLocation(bindingElm)+")",e); 46 } 47 } 48 } 49 | Popular Tags |