com.sitemesh.mapper
Class DefaultDecoratorMapper

java.lang.Object
  |
  +--com.sitemesh.mapper.DefaultDecoratorMapper

public class DefaultDecoratorMapper
extends java.lang.Object
implements DecoratorMapper, RequestConstants

Default implementation of DecoratorMapper. Reads decorators and mappings from /WEB-INF/decorators.xml.

Version:
$Revision: 1.5 $
Author:
Joe Walnes, Mike Cannon-Brookes
See Also:
DecoratorMapper, DefaultDecorator

Fields inherited from interface com.sitemesh.RequestConstants
DECORATOR, FILTER_APPLIED, PAGE
 
Constructor Summary
DefaultDecoratorMapper()
           
 
Method Summary
 Decorator getDecorator(javax.servlet.http.HttpServletRequest request, Page page)
          Return appropriate Decorator for a certain Page.
 void init(javax.servlet.Config config, java.util.Properties properties)
          Initialize the mapper.
 void refresh()
          Check if configuration file has been updated, and if so, reload.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDecoratorMapper

public DefaultDecoratorMapper()
Method Detail

init

public void init(javax.servlet.Config config,
                 java.util.Properties properties)
          throws java.lang.InstantiationException
Description copied from interface: DecoratorMapper
Initialize the mapper. This is always called before the other method.
Specified by:
init in interface DecoratorMapper
Tags copied from interface: DecoratorMapper
Parameters:
config - Config supplied by Servlet or Filter.
properties - Any initialization properties (specific to implementation).
Throws:
java.lang.InstantionException - should be thrown if the implementation cannot be initialized properly.

getDecorator

public Decorator getDecorator(javax.servlet.http.HttpServletRequest request,
                              Page page)
Description copied from interface: DecoratorMapper
Return appropriate Decorator for a certain Page. The implementation can determine the result based on the actual request or the data of the parsed page.
Specified by:
getDecorator in interface DecoratorMapper

refresh

public void refresh()
             throws javax.servlet.ServletException
Check if configuration file has been updated, and if so, reload.