org.apache.cocoon.woody.binding
Class JXPathBindingBase

java.lang.Object
  extended by org.apache.cocoon.woody.binding.JXPathBindingBase
All Implemented Interfaces:
LogEnabled, Binding
Direct Known Subclasses:
ComposedJXPathBindingBase, DeleteNodeJXPathBinding, InsertBeanJXPathBinding, InsertNodeJXPathBinding, JavaScriptJXPathBinding, MultiValueJXPathBinding, RepeaterJXPathBinding, SetAttributeJXPathBinding, SimpleRepeaterJXPathBinding, TempRepeaterJXPathBinding, UniqueFieldJXPathBinding, ValueJXPathBinding

public abstract class JXPathBindingBase
extends Object
implements Binding, LogEnabled

Provides a base class for hooking up Binding implementations that use the Jakarta Commons JXPath package.

Version:
CVS $Id: JXPathBindingBase.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
protected  Map classes
          Cache of class definitions
protected  Binding parent
          Parent binding of this binding.
 
Constructor Summary
protected JXPathBindingBase(org.apache.cocoon.woody.binding.JXPathBindingBuilderBase.CommonAttributes commonAtts)
           
 
Method Summary
abstract  void doLoad(Widget frmModel, org.apache.commons.jxpath.JXPathContext jxpc)
          Performs the actual load binding regardless of the configured value of the "direction" attribute.
abstract  void doSave(Widget frmModel, org.apache.commons.jxpath.JXPathContext jxpc)
          Performs the actual save binding regardless of the configured value of the "direction" attribute.
 void enableLogging(Logger logger)
          Receives the Avalon logger to use.
 Binding getClass(String id)
          Gets a binding class.
 String getId()
          Returns binding definition id.
protected  Logger getLogger()
           
protected  Widget getWidget(Widget widget, String id)
           
 void loadFormFromModel(Widget frmModel, org.apache.commons.jxpath.JXPathContext jxpc)
          Redefines the Binding action as working on a JXPathContext Type rather then on generic objects.
 void loadFormFromModel(Widget frmModel, Object objModel)
          Hooks up with the more generic Binding of any objectModel by wrapping it up in a JXPathContext object and then transfering control over to the new overloaded version of this method.
 void saveFormToModel(Widget frmModel, org.apache.commons.jxpath.JXPathContext jxpc)
          Redefines the Binding action as working on a JXPathContext Type rather then on generic objects.
 void saveFormToModel(Widget frmModel, Object objModel)
          Hooks up with the more generic Binding of any objectModel by wrapping it up in a JXPathContext object and then transfering control over to the new overloaded version of this method.
 void setParent(Binding binding)
          Sets parent binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected Binding parent
Parent binding of this binding.


classes

protected Map classes
Cache of class definitions

Constructor Detail

JXPathBindingBase

protected JXPathBindingBase(org.apache.cocoon.woody.binding.JXPathBindingBuilderBase.CommonAttributes commonAtts)
Method Detail

setParent

public void setParent(Binding binding)
Sets parent binding.

Specified by:
setParent in interface Binding
Parameters:
binding - Parent of this binding.

getId

public String getId()
Returns binding definition id.

Specified by:
getId in interface Binding

getClass

public Binding getClass(String id)
Description copied from interface: Binding
Gets a binding class.

Specified by:
getClass in interface Binding
Parameters:
id - Id of binding class to get.

getWidget

protected Widget getWidget(Widget widget,
                           String id)

doLoad

public abstract void doLoad(Widget frmModel,
                            org.apache.commons.jxpath.JXPathContext jxpc)
                     throws BindingException
Performs the actual load binding regardless of the configured value of the "direction" attribute. Abstract method that subclasses need to implement for specific activity.

Throws:
BindingException

loadFormFromModel

public final void loadFormFromModel(Widget frmModel,
                                    org.apache.commons.jxpath.JXPathContext jxpc)
                             throws BindingException
Redefines the Binding action as working on a JXPathContext Type rather then on generic objects. Executes the actual loading via doLoad(Widget, JXPathContext) depending on the configured value of the "direction" attribute.

Throws:
BindingException

loadFormFromModel

public final void loadFormFromModel(Widget frmModel,
                                    Object objModel)
                             throws BindingException
Hooks up with the more generic Binding of any objectModel by wrapping it up in a JXPathContext object and then transfering control over to the new overloaded version of this method.

Specified by:
loadFormFromModel in interface Binding
Throws:
BindingException

doSave

public abstract void doSave(Widget frmModel,
                            org.apache.commons.jxpath.JXPathContext jxpc)
                     throws BindingException
Performs the actual save binding regardless of the configured value of the "direction" attribute. Abstract method that subclasses need to implement for specific activity.

Throws:
BindingException

saveFormToModel

public final void saveFormToModel(Widget frmModel,
                                  org.apache.commons.jxpath.JXPathContext jxpc)
                           throws BindingException
Redefines the Binding action as working on a JXPathContext Type rather then on generic objects. Executes the actual saving via doSave(Widget, JXPathContext) depending on the configured value of the "direction" attribute.

Throws:
BindingException

saveFormToModel

public void saveFormToModel(Widget frmModel,
                            Object objModel)
                     throws BindingException
Hooks up with the more generic Binding of any objectModel by wrapping it up in a JXPathContext object and then transfering control over to the new overloaded version of this method.

Specified by:
saveFormToModel in interface Binding
Throws:
BindingException

enableLogging

public void enableLogging(Logger logger)
Receives the Avalon logger to use. Subclasses should always start with super.enableLogging(logger) in possible overriding versions.

Specified by:
enableLogging in interface LogEnabled

getLogger

protected Logger getLogger()


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