java.lang.Object
com.sitemesh.mapper.DefaultDecoratorMapper
- All Implemented Interfaces:
- com.sitemesh.DecoratorMapper, com.sitemesh.RequestConstants
- public class DefaultDecoratorMapper
- extends java.lang.Object
- implements com.sitemesh.DecoratorMapper, com.sitemesh.RequestConstants
Default implementation of DecoratorMapper. Reads decorators and
mappings from /WEB-INF/decorators.xml.
- Version:
- $Revision: 1.5 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
decorators
private java.util.Map decorators
mappings
private java.util.Map mappings
configLastModified
private long configLastModified
configFile
private java.io.File configFile
DefaultDecoratorMapper
public DefaultDecoratorMapper()
init
public void init(Config config,
java.util.Properties properties)
throws java.lang.InstantiationException
- Description copied from interface:
com.sitemesh.DecoratorMapper
- Initialize the mapper. This is always called before the other method.
- Specified by:
init in interface com.sitemesh.DecoratorMapper
getDecorator
public com.sitemesh.Decorator getDecorator(javax.servlet.http.HttpServletRequest request,
com.sitemesh.Page page)
- Description copied from interface:
com.sitemesh.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 com.sitemesh.DecoratorMapper
findKey
private java.lang.String findKey(java.lang.String path)
findExactKey
private java.lang.String findExactKey(java.lang.String path)
findDirectoryKey
private java.lang.String findDirectoryKey(java.lang.String path)
findExtentionKey
private java.lang.String findExtentionKey(java.lang.String path)
findDefaultKey
private java.lang.String findDefaultKey(java.lang.String path)
loadConfig
private void loadConfig()
throws javax.servlet.ServletException
getContainedText
private java.lang.String getContainedText(org.w3c.dom.Node parent,
java.lang.String childTagName)
storeDecorator
private void storeDecorator(com.sitemesh.Decorator d)
storeMapping
private void storeMapping(java.lang.String name,
java.lang.String pattern)
refresh
public void refresh()
throws javax.servlet.ServletException
- Check if configuration file has been updated, and if so, reload.