org.enhydra.barracuda.contrib.sam.models
Class TemplateModelDecorator

java.lang.Object
  extended byorg.enhydra.barracuda.contrib.sam.models.TemplateModelDecorator
All Implemented Interfaces:
Contextual, IterativeModel, Model, TemplateModel
Direct Known Subclasses:
MapDecorator

public abstract class TemplateModelDecorator
extends Object
implements TemplateModel, IterativeModel

Abstract Decorator class for using cascading models. It implements the well known decorator pattern. This class is subclassed by concrete Decorators, see MapDecorator.
TemplateModelDecorator is capable of handling TemplateModel as well as IterativeModel.
Implementation detail: Nearly all calls are passed directly to the decorated model. If the decorated model implements IterativeModel, also all iterative methods are passed through.
Subclasses should override getItem, in order to modify the standard behavior.

Version:
$Id: TemplateModelDecorator.java,v 1.4 2004/02/01 05:16:27 christianc Exp $
Author:
Stefan Armbruster

Field Summary
protected  TemplateModel _templateModel
          reference to the decorated model
 
Constructor Summary
TemplateModelDecorator(TemplateModel tm)
           
 
Method Summary
 void addModelListener(ModelListener ml)
           
 Object getItem(TemplateDirective td)
           
 String getName()
           
 ViewContext getViewContext()
           
 boolean hasNext()
           
 void loadNext()
           
 void postIterate()
           
 void preIterate()
           
 boolean processDirective(TemplateDirective td)
           
 void removeModelListener(ModelListener ml)
           
 void setViewContext(ViewContext vc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_templateModel

protected TemplateModel _templateModel
reference to the decorated model

Constructor Detail

TemplateModelDecorator

public TemplateModelDecorator(TemplateModel tm)
Method Detail

getName

public String getName()
Specified by:
getName in interface TemplateModel

processDirective

public boolean processDirective(TemplateDirective td)
Specified by:
processDirective in interface TemplateModel

getItem

public Object getItem(TemplateDirective td)
Specified by:
getItem in interface TemplateModel

addModelListener

public void addModelListener(ModelListener ml)
Specified by:
addModelListener in interface Model

removeModelListener

public void removeModelListener(ModelListener ml)
Specified by:
removeModelListener in interface Model

getViewContext

public ViewContext getViewContext()
Specified by:
getViewContext in interface Contextual

setViewContext

public void setViewContext(ViewContext vc)
Specified by:
setViewContext in interface Contextual

hasNext

public boolean hasNext()
Specified by:
hasNext in interface IterativeModel

loadNext

public void loadNext()
Specified by:
loadNext in interface IterativeModel

postIterate

public void postIterate()
Specified by:
postIterate in interface IterativeModel

preIterate

public void preIterate()
Specified by:
preIterate in interface IterativeModel


Copyright © 2003 BarracudaMVC.org All Rights Reserved.