Class AbstractDecoratorMapper
java.lang.Object
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
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.
- Author:
- Joe Walnes
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigThe config.protected DecoratorMapperParent DecoratorMapper. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDecorator(javax.servlet.http.HttpServletRequest request, Page page) Return appropriateDecoratorfor a certain Page.getNamedDecorator(javax.servlet.http.HttpServletRequest request, String name) Return aDecoratorwith given name.voidinit(Config config, Properties properties, DecoratorMapper parent) Initialize the mapper.
-
Field Details
-
parent
Parent DecoratorMapper. -
config
The config.
-
-
Constructor Details
-
AbstractDecoratorMapper
public AbstractDecoratorMapper()
-
-
Method Details
-
init
public void init(Config config, Properties properties, DecoratorMapper parent) throws InstantiationException Description copied from interface:DecoratorMapperInitialize the mapper. This is always called before the other methods.- Specified by:
initin interfaceDecoratorMapper- Parameters:
config- Config supplied by Servlet or Filter.properties- Any initialization properties (specific to implementation).parent- the parent- Throws:
InstantiationException- the instantiation exception
-
getDecorator
Description copied from interface:DecoratorMapperReturn appropriateDecoratorfor a certain Page.The implementation can determine the result based on the actual request or the data of the parsed page. Typically this would call
getNamedDecorator()which would delegate to a parent DecoratorMapper.- Specified by:
getDecoratorin interfaceDecoratorMapper- Parameters:
request- the requestpage- the page- Returns:
- the decorator
-
getNamedDecorator
Description copied from interface:DecoratorMapperReturn aDecoratorwith given name.- Specified by:
getNamedDecoratorin interfaceDecoratorMapper- Parameters:
request- the requestname- the name- Returns:
- the named decorator
-