KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > module > sitemesh > mapper > NullDecoratorMapper


1 /*
2  * Title: NullDecoratorMapper
3  * Description:
4  *
5  * This software is published under the terms of the OpenSymphony Software
6  * License version 1.1, of which a copy has been included with this
7  * distribution in the LICENSE.txt file.
8  */

9
10 package com.opensymphony.module.sitemesh.mapper;
11
12 import com.opensymphony.module.sitemesh.Config;
13 import com.opensymphony.module.sitemesh.Decorator;
14 import com.opensymphony.module.sitemesh.DecoratorMapper;
15 import com.opensymphony.module.sitemesh.Page;
16
17 import javax.servlet.http.HttpServletRequest JavaDoc;
18 import java.util.Properties JavaDoc;
19
20 /**
21  * The NullDecoratorMapper represents the top-level DecoratorMapper that
22  * is finally delegated to if no other DecoratorMapper has intervened.
23  * It is used so the parent property does not have to be checked by
24  * other DecoratorMappers (null object pattern).
25  *
26  * @author <a HREF="mailto:joe@truemesh.com">Joe Walnes</a>
27  * @version $Revision: 1.1 $
28  *
29  * @see com.opensymphony.module.sitemesh.DecoratorMapper
30  */

31 public class NullDecoratorMapper implements DecoratorMapper {
32
33     /** Does nothing. */
34     public void init(Config config, Properties JavaDoc properties, DecoratorMapper parent) {
35     }
36
37     /** Returns null. */
38     public Decorator getDecorator(HttpServletRequest JavaDoc request, Page page) {
39         return null;
40     }
41
42     /** Returns null. */
43     public Decorator getNamedDecorator(HttpServletRequest JavaDoc request, String JavaDoc name) {
44         return null;
45     }
46 }
Popular Tags