1 16 package org.apache.cocoon.forms.binding; 17 18 import org.apache.cocoon.forms.formmodel.Widget; 19 import org.apache.commons.jxpath.JXPathContext; 20 21 31 public class SetAttributeJXPathBinding extends JXPathBindingBase { 32 33 private final String name; 34 private final String value; 35 36 39 public SetAttributeJXPathBinding(JXPathBindingBuilderBase.CommonAttributes commonAtts, String attName, String attValue) { 40 super(commonAtts); 41 this.name = attName; 42 this.value = attValue; 43 } 44 45 public String getId() { return name; } 46 public String getValue() { return value; } 47 48 51 public void doLoad(Widget frmModel, JXPathContext jxpc) { 52 } 54 55 58 public void doSave(Widget frmModel, JXPathContext jxpc) { 59 jxpc.setValue("@" + this.name, this.value); 60 if (getLogger().isDebugEnabled()) 61 getLogger().debug("done saving " + toString()); 62 } 63 64 public String toString() { 65 return "SetAttributeJXPathBinding [attName=" + this.name + ", attValue=" + this.value + "]"; 66 } 67 } 68 | Popular Tags |