Package 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.2 $
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

Modifier and Type
Method
Description
`Decorator`
`getDecorator(javax.servlet.http.HttpServletRequest request, Page page)`
Retrieve `Decorator` based on 'pattern' tag.
`Decorator`
`getNamedDecorator(javax.servlet.http.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 Details

### configLoader

private ConfigLoader configLoader

## Constructor Details

### ConfigDecoratorMapper

public ConfigDecoratorMapper()

## Method Details

### 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(javax.servlet.http.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(javax.servlet.http.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`