KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > directwebremoting > spring > AbstractConfig


1 /*
2  * Copyright 2005-2006 Joe Walker
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.directwebremoting.spring;
18
19 import java.util.ArrayList JavaDoc;
20 import java.util.HashMap JavaDoc;
21 import java.util.List JavaDoc;
22 import java.util.Map JavaDoc;
23
24 /**
25  * The abstract config to use to configure parts of DWR in Spring. <br>
26  *
27  * @see org.directwebremoting.extend.AccessControl#addIncludeRule(String, String)
28  * @see org.directwebremoting.extend.AccessControl#addExcludeRule(String, String)
29  *
30  * @author Bram Smeets
31  * @author Joe Walker [joe at getahead dot ltd dot uk]
32  * @author Brendan Grainger
33  */

34 abstract class AbstractConfig
35 {
36
37     /**
38      * Gets the list of method names to include for this creator.
39      * @return the list of method names to include
40      * @see org.directwebremoting.extend.AccessControl#addIncludeRule(String, String)
41      */

42     public List JavaDoc getIncludes()
43     {
44         return includes;
45     }
46
47     /**
48      * Sets the list of method names to include for this creator.
49      * @param includes the list of method names to include
50      * @see org.directwebremoting.extend.AccessControl#addIncludeRule(String, String)
51      */

52     public void setIncludes(List JavaDoc includes)
53     {
54         this.includes = includes;
55     }
56
57     /**
58      * Gets the list of method names to exclude for this creator.
59      * @return the list of method names to exclude
60      * @see org.directwebremoting.extend.AccessControl#addExcludeRule(String, String)
61      */

62     public List JavaDoc getExcludes()
63     {
64         return excludes;
65     }
66
67     /**
68      * Sets the list of method names to exclude for this creator.
69      * @param excludes the list of method names to exclude
70      * @see org.directwebremoting.extend.AccessControl#addExcludeRule(String, String)
71      */

72     public void setExcludes(List JavaDoc excludes)
73     {
74         this.excludes = excludes;
75     }
76
77     /**
78      * Convenience method for adding an include rule.
79      * @param method the method to add the include rule for
80      * @throws IllegalArgumentException in case the specified argument is null
81      */

82     public void addInclude(String JavaDoc method)
83     {
84         includes.add(method);
85     }
86
87     /**
88      * Convenience method for adding an exclude rule.
89      * @param method the method to add the exclude rule
90      * @throws IllegalArgumentException in case the specified argument is null
91      */

92     public void addExclude(String JavaDoc method)
93     {
94         excludes.add(method);
95     }
96
97     /**
98      * The set of key/value pairs to provide further configuration.<br>
99      * Note that these params are only used when setting the creator type and not when setting the
100      * creator directly.
101      * @return Returns the params.
102      */

103     public Map JavaDoc getParams()
104     {
105         return params;
106     }
107
108     /**
109      * The set of key/value pairs to provide further configuration.<br>
110      * Note that these params are only used when setting the creator type and not when setting the
111      * creator directly.
112      * @param params The params to set.
113      */

114     public void setParams(Map JavaDoc params)
115     {
116         this.params = params;
117     }
118
119     /**
120      * The list of method names to include for this creator.
121      */

122     private List JavaDoc includes = new ArrayList JavaDoc();
123
124     /**
125      * The list of method names to exclude for this creator.
126      */

127     private List JavaDoc excludes = new ArrayList JavaDoc();
128
129     /**
130      * The set of key/value pairs to provide further configuration
131      */

132     private Map JavaDoc params = new HashMap JavaDoc();
133 }
134
Popular Tags