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 theconfig
property (default '/WEB-INF/decorators.xml').- Version:
- $Revision: 1.1 $
- Author:
- Joe Walnes, Mike Cannon-Brookes
- See Also:
DecoratorMapper
,DefaultDecorator
,ConfigLoader
-
-
Field Summary
Fields Modifier and Type Field Description private ConfigLoader
configLoader
-
Fields inherited from class com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
config, parent
-
-
Constructor Summary
Constructors Constructor Description ConfigDecoratorMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Decorator
getDecorator(javax.servlet.http.HttpServletRequest request, Page page)
RetrieveDecorator
based on 'pattern' tag.Decorator
getNamedDecorator(javax.servlet.http.HttpServletRequest request, java.lang.String name)
Retrieve Decorator named in 'name' attribute.void
init(Config config, java.util.Properties properties, DecoratorMapper parent)
Create new ConfigLoader using '/WEB-INF/decorators.xml' file.
-
-
-
Field Detail
-
configLoader
private ConfigLoader configLoader
-
-
Method Detail
-
init
public void init(Config config, java.util.Properties properties, DecoratorMapper parent) throws java.lang.InstantiationException
Create new ConfigLoader using '/WEB-INF/decorators.xml' file.- Specified by:
init
in interfaceDecoratorMapper
- Overrides:
init
in classAbstractDecoratorMapper
- Parameters:
config
- Config supplied by Servlet or Filter.properties
- Any initialization properties (specific to implementation).- Throws:
java.lang.InstantiationException
- should be thrown if the implementation cannot be initialized properly.
-
getDecorator
public Decorator getDecorator(javax.servlet.http.HttpServletRequest request, Page page)
RetrieveDecorator
based on 'pattern' tag.- Specified by:
getDecorator
in interfaceDecoratorMapper
- Overrides:
getDecorator
in classAbstractDecoratorMapper
-
getNamedDecorator
public Decorator getNamedDecorator(javax.servlet.http.HttpServletRequest request, java.lang.String name)
Retrieve Decorator named in 'name' attribute. Checks the role if specified.- Specified by:
getNamedDecorator
in interfaceDecoratorMapper
- Overrides:
getNamedDecorator
in classAbstractDecoratorMapper
-
-