org.apache.cocoon.forms.samples.bindings
Class CustomValueWrapBinding

java.lang.Object
  extended by org.apache.cocoon.forms.binding.AbstractCustomBinding
      extended by org.apache.cocoon.forms.samples.bindings.CustomValueWrapBinding
All Implemented Interfaces:
Binding

public class CustomValueWrapBinding
extends AbstractCustomBinding

CustomValueWrapBinding


Constructor Summary
CustomValueWrapBinding()
           
CustomValueWrapBinding(char delimiter)
           
CustomValueWrapBinding(char prefix, char suffix)
           
 
Method Summary
static Binding createBinding(Element config)
          Builds the actual binding class based on its XML config.
 void doLoad(Widget frmModel, org.apache.commons.jxpath.JXPathContext jxpc)
          This unwraps the value from the model by removing the 2 prefix and suffix-chars before setting it onto the model Method signature and semantics complies to AbstractCustomBinding.doLoad(Widget, JXPathContext)
 void doSave(Widget frmModel, org.apache.commons.jxpath.JXPathContext jxpc)
          This wraps the value from the form between 2 prefix and suffix-chars before saving to the model Method signature and semantics complies to AbstractCustomBinding.doSave(Widget, JXPathContext)
 
Methods inherited from class org.apache.cocoon.forms.binding.AbstractCustomBinding
getClass, getEnclosingLibrary, getId, getXpath, isValid, loadFormFromModel, saveFormToModel, setEnclosingLibrary, setParent, setXpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomValueWrapBinding

public CustomValueWrapBinding()

CustomValueWrapBinding

public CustomValueWrapBinding(char delimiter)

CustomValueWrapBinding

public CustomValueWrapBinding(char prefix,
                              char suffix)
Method Detail

doLoad

public void doLoad(Widget frmModel,
                   org.apache.commons.jxpath.JXPathContext jxpc)
            throws BindingException
This unwraps the value from the model by removing the 2 prefix and suffix-chars before setting it onto the model Method signature and semantics complies to AbstractCustomBinding.doLoad(Widget, JXPathContext)

Specified by:
doLoad in class AbstractCustomBinding
Throws:
BindingException

doSave

public void doSave(Widget frmModel,
                   org.apache.commons.jxpath.JXPathContext jxpc)
            throws BindingException
This wraps the value from the form between 2 prefix and suffix-chars before saving to the model Method signature and semantics complies to AbstractCustomBinding.doSave(Widget, JXPathContext)

Specified by:
doSave in class AbstractCustomBinding
Throws:
BindingException

createBinding

public static Binding createBinding(Element config)
                             throws BindingException
Builds the actual binding class based on its XML config.

Parameters:
config - the Element holding the config for the binding to create.
Returns:
the configured binding
Throws:
BindingException - when the creation fails


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.