com.opensymphony.module.sitemesh.mapper
Class ConfigDecoratorMapper
java.lang.Object
com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper
- All Implemented Interfaces:
- DecoratorMapper
- Direct Known Subclasses:
- EnvEntryDecoratorMapper
public class ConfigDecoratorMapper
- extends AbstractDecoratorMapper
Default implementation of DecoratorMapper. Reads decorators and
mappings from the config
property (default '/WEB-INF/decorators.xml').
- Version:
- $Revision: 1.1 $
- Author:
- Joe Walnes, Mike Cannon-Brookes
- See Also:
DecoratorMapper
,
DefaultDecorator
,
ConfigLoader
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
configLoader
private ConfigLoader configLoader
ConfigDecoratorMapper
public ConfigDecoratorMapper()
init
public void init(Config config,
Properties properties,
DecoratorMapper parent)
throws InstantiationException
- Create new ConfigLoader using '/WEB-INF/decorators.xml' file.
- Specified by:
init
in interface DecoratorMapper
- Overrides:
init
in class AbstractDecoratorMapper
- 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)
- Retrieve
Decorator
based on 'pattern' tag.
- Specified by:
getDecorator
in interface DecoratorMapper
- Overrides:
getDecorator
in class AbstractDecoratorMapper
getNamedDecorator
public Decorator getNamedDecorator(HttpServletRequest request,
String name)
- Retrieve Decorator named in 'name' attribute. Checks the role if specified.
- Specified by:
getNamedDecorator
in interface DecoratorMapper
- Overrides:
getNamedDecorator
in class AbstractDecoratorMapper