1 16 package org.apache.cocoon.forms.binding; 17 18 import org.apache.cocoon.forms.formmodel.Struct; 19 import org.apache.cocoon.forms.formmodel.Widget; 20 import org.apache.commons.jxpath.JXPathContext; 21 22 33 public class StructJXPathBinding extends ContextJXPathBinding { 34 35 private final String widgetId; 36 37 43 public StructJXPathBinding(JXPathBindingBuilderBase.CommonAttributes commonAtts, String widgetId, String xpath, JXPathBindingBase[] childBindings) { 44 super(commonAtts, xpath, childBindings); 45 this.widgetId = widgetId; 46 } 47 48 public String getId() { return widgetId; } 49 50 55 public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException { 56 Struct structWidget = (Struct)selectWidget(frmModel, this.widgetId); 57 super.doLoad(structWidget, jxpc); 58 } 59 60 65 public void doSave(Widget frmModel, JXPathContext jxpc) throws BindingException { 66 Struct structWidget = (Struct)selectWidget(frmModel, this.widgetId); 67 super.doSave(structWidget, jxpc); 68 } 69 70 public String toString() { 71 return "StructJXPathBinding [widget=" + this.widgetId + ", xpath=" + getXPath() + "]"; 72 } 73 } 74 | Popular Tags |