org.apache.cocoon.forms.formmodel.algorithms
Class AbstractBaseAlgorithm

java.lang.Object
  extended by org.apache.cocoon.forms.formmodel.algorithms.AbstractBaseAlgorithm
All Implemented Interfaces:
Contextualizable, LogEnabled, CalculatedFieldAlgorithm
Direct Known Subclasses:
SimpleFormula

public abstract class AbstractBaseAlgorithm
extends Object
implements CalculatedFieldAlgorithm, LogEnabled, Contextualizable

Abstract base class for algorithms.

This class implements the getTriggerWidgets method and holds the triggers list. It also implements Contextualizable and LogEnabled to give the algorithms access to the cocoon's ObjectModel and Loggers.

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

Field Summary
protected  List triggers
           
 
Constructor Summary
AbstractBaseAlgorithm()
           
 
Method Summary
 void addTrigger(String widget)
           
 void clearTriggers()
           
 void contextualize(Context context)
           
 void enableLogging(Logger logger)
           
protected  Context getContext()
           
protected  Logger getLogger()
           
 Iterator getTriggerWidgets()
          Returns an iterator on trigger widget paths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.forms.formmodel.CalculatedFieldAlgorithm
calculate, isSuitableFor
 

Field Detail

triggers

protected List triggers
Constructor Detail

AbstractBaseAlgorithm

public AbstractBaseAlgorithm()
Method Detail

getTriggerWidgets

public Iterator getTriggerWidgets()
Description copied from interface: CalculatedFieldAlgorithm
Returns an iterator on trigger widget paths. When the value of a trigger widget changes, then the CalculatedField value must be recalculated.

Specified by:
getTriggerWidgets in interface CalculatedFieldAlgorithm
Returns:
An iterator of Strings representing widget paths as interpreted by WidgetFinder.

addTrigger

public void addTrigger(String widget)

enableLogging

public void enableLogging(Logger logger)
Specified by:
enableLogging in interface LogEnabled

getLogger

protected Logger getLogger()

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

getContext

protected Context getContext()

clearTriggers

public void clearTriggers()


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