com.opensymphony.module.sitemesh.mapper
Class AbstractDecoratorMapper

java.lang.Object
  extended by com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
All Implemented Interfaces:
DecoratorMapper
Direct Known Subclasses:
AgentDecoratorMapper, ConfigDecoratorMapper, CookieDecoratorMapper, FileDecoratorMapper, FrameSetDecoratorMapper, InlineDecoratorMapper, LanguageDecoratorMapper, OSDecoratorMapper, PageDecoratorMapper, ParameterDecoratorMapper, PrintableDecoratorMapper, RobotDecoratorMapper, SessionDecoratorMapper

public abstract class AbstractDecoratorMapper
extends Object
implements DecoratorMapper

Abstract DecoratorMapper implementation for easy creation of new DecoratorMappers.

Typically, an implementation would override getNamedDecorator() or getDecorator(). If a Decorator cannot be returned from either of these, then they should delegate to their superclass.

Version:
$Revision: 1.1 $
Author:
Joe Walnes
See Also:
DecoratorMapper

Field Summary
protected  Config config
           
protected  DecoratorMapper parent
          Parent DecoratorMapper.
 
Constructor Summary
AbstractDecoratorMapper()
           
 
Method Summary
 Decorator getDecorator(HttpServletRequest request, Page page)
          Delegate to parent.
 Decorator getNamedDecorator(HttpServletRequest request, String name)
          Delegate to parent.
 void init(Config config, Properties properties, DecoratorMapper parent)
          Set parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected DecoratorMapper parent
Parent DecoratorMapper.


config

protected Config config
Constructor Detail

AbstractDecoratorMapper

public AbstractDecoratorMapper()
Method Detail

init

public void init(Config config,
                 Properties properties,
                 DecoratorMapper parent)
          throws InstantiationException
Set parent.

Specified by:
init in interface DecoratorMapper
Parameters:
config - Config supplied by Servlet or Filter.
properties - Any initialization properties (specific to implementation).
Throws:
InstantiationException - should be thrown if the implementation cannot be initialized properly.

getDecorator

public Decorator getDecorator(HttpServletRequest request,
                              Page page)
Delegate to parent.

Specified by:
getDecorator in interface DecoratorMapper

getNamedDecorator

public Decorator getNamedDecorator(HttpServletRequest request,
                                   String name)
Delegate to parent.

Specified by:
getNamedDecorator in interface DecoratorMapper

www.opensymphony.com/sitemesh/