Package com.opensymphony.module.sitemesh
Interface DecoratorMapper
- All Known Implementing Classes:
AbstractDecoratorMapper,AgentDecoratorMapper,ConfigDecoratorMapper,CookieDecoratorMapper,EnvEntryDecoratorMapper,FileDecoratorMapper,FrameSetDecoratorMapper,InlineDecoratorMapper,LanguageDecoratorMapper,NullDecoratorMapper,OSDecoratorMapper,PageDecoratorMapper,ParameterDecoratorMapper,PrintableDecoratorMapper,RobotDecoratorMapper,SessionDecoratorMapper
public interface DecoratorMapper
The DecoratorMapper is responsible for determining which
Decorator should be
used for a Page.
Implementations of this are returned by the Factory, and should be
thread-safe.
- Author:
- Joe Walnes
-
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.
-
Method Details
-
init
void init(Config config, Properties properties, DecoratorMapper parent) throws InstantiationException Initialize the mapper. This is always called before the other methods.- Parameters:
config- Config supplied by Servlet or Filter.properties- Any initialization properties (specific to implementation).parent- the parent- Throws:
InstantiationException- the instantiation exception
-
getDecorator
Return 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.- Parameters:
request- the requestpage- the page- Returns:
- the decorator
-
getNamedDecorator
Return aDecoratorwith given name.- Parameters:
request- the requestname- the name- Returns:
- the named decorator
-