org.barracudamvc.contrib.sam.models
Class TemplateModelDecorator
java.lang.Object
org.barracudamvc.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.5 2004/08/14 18:14:14 jkjome Exp $
- Author:
- Stefan Armbruster
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_templateModel
protected TemplateModel _templateModel
- reference to the decorated model
TemplateModelDecorator
public TemplateModelDecorator(TemplateModel tm)
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 © 2004 BarracudaMVC.org All Rights Reserved.