KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > metadata > InterceptorMetaData


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.server.metadata;
10
11 import java.util.HashMap JavaDoc;
12 import java.util.Map JavaDoc;
13
14 import org.jboss.portal.common.metadata.MetaData;
15
16 /**
17  * Interceptor metadata.
18  *
19  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
20  * @version $Revision: 1.2 $
21  */

22 public class InterceptorMetaData implements MetaData
23 {
24
25    private String JavaDoc className;
26    private Map JavaDoc params;
27
28    public InterceptorMetaData(String JavaDoc className)
29    {
30       if (className == null)
31       {
32          throw new IllegalArgumentException JavaDoc("Interceptor class name must not be null");
33       }
34       this.className = className;
35       this.params = new HashMap JavaDoc();
36    }
37
38    public String JavaDoc getClassName()
39    {
40       return className;
41    }
42
43    public void setClassName(String JavaDoc className)
44    {
45       this.className = className;
46    }
47
48    public void setParamValue(String JavaDoc name, String JavaDoc value)
49    {
50       if (name == null)
51       {
52          throw new IllegalArgumentException JavaDoc("Param name cannot be null");
53       }
54       if (value == null)
55       {
56          throw new IllegalArgumentException JavaDoc("Param value cannot be null");
57       }
58       params.put(name, value);
59    }
60
61    public String JavaDoc getParamValue(String JavaDoc name)
62    {
63       return (String JavaDoc)params.get(name);
64    }
65 }
66
Popular Tags