1 9 10 package com.opensymphony.module.sitemesh.mapper; 11 12 import com.opensymphony.module.sitemesh.Decorator; 13 14 import java.util.Map ; 15 import java.util.Iterator ; 16 import java.util.Collections ; 17 18 27 public class DefaultDecorator implements Decorator { 28 29 protected String page = null; 30 31 32 protected String name = null; 33 34 35 protected String uriPath = null; 36 37 38 protected String role = null; 39 40 41 protected Map parameters = null; 42 43 44 public DefaultDecorator(String name, String page, Map parameters) { 45 this(name, page, null, null, parameters); 46 } 47 48 49 public DefaultDecorator(String name, String page, String uriPath, Map parameters) { 50 this(name, page, uriPath, null, parameters); 51 } 52 53 54 public DefaultDecorator(String name, String page, String uriPath, String role, Map parameters) { 55 this.name = name; 56 this.page = page; 57 this.uriPath = uriPath; 58 this.role = role; 59 this.parameters = parameters; 60 } 61 62 66 public String getPage() { 67 return page; 68 } 69 70 71 public String getName() { 72 return name; 73 } 74 75 76 public String getURIPath() { 77 return uriPath; 78 } 79 80 81 public String getRole() { 82 return role; 83 } 84 85 92 public String getInitParameter(String paramName) { 93 if (parameters == null || !parameters.containsKey(paramName)) { 94 return null; 95 } 96 97 return (String ) parameters.get(paramName); 98 } 99 100 104 public Iterator getInitParameterNames() { 105 if (parameters == null) { 106 return Collections.EMPTY_MAP.keySet().iterator(); 108 } 109 110 return parameters.keySet().iterator(); 111 } 112 } | Popular Tags |