1 16 package org.apache.cocoon.woody.binding; 17 18 import org.apache.cocoon.woody.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 48 public void doLoad(Widget frmModel, JXPathContext jxpc) { 49 } 51 52 55 public void doSave(Widget frmModel, JXPathContext jxpc) { 56 jxpc.setValue("@" + this.name, this.value); 57 if (getLogger().isDebugEnabled()) 58 getLogger().debug("done saving " + toString()); 59 } 60 61 public String toString() { 62 return "SetAttributeJXPathBinding [attName=" + this.name + ", attValue=" + this.value + "]"; 63 } 64 } 65 | Popular Tags |