com.opensymphony.module.sitemesh.mapper
Class ConfigDecoratorMapper

java.lang.Object
  extended by com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
      extended by 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.2 $
Author:
Joe Walnes, Mike Cannon-Brookes
See Also:
DecoratorMapper, DefaultDecorator, ConfigLoader

Field Summary
private  ConfigLoader configLoader
           
 
Fields inherited from class com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
config, parent
 
Constructor Summary
ConfigDecoratorMapper()
           
 
Method Summary
 Decorator getDecorator(HttpServletRequest request, Page page)
          Retrieve Decorator based on 'pattern' tag.
 Decorator getNamedDecorator(HttpServletRequest request, String name)
          Retrieve Decorator named in 'name' attribute.
 void init(Config config, Properties properties, DecoratorMapper parent)
          Create new ConfigLoader using '/WEB-INF/decorators.xml' file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configLoader

private ConfigLoader configLoader
Constructor Detail

ConfigDecoratorMapper

public ConfigDecoratorMapper()
Method Detail

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

www.opensymphony.com/sitemesh/