01: /* Copyright 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15:
16: package org.acegisecurity.intercept.method;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.acegisecurity.ConfigAttribute;
22:
23: /**
24: * Configuration entry for {@link MethodDefinitionSource}, that holds
25: * the method to be protected and the {@link ConfigAttribute}s as {@link String}
26: * that apply to that url.
27: *
28: * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
29: * @version $Id: MethodDefinitionSourceMapping.java 1595 2006-08-22 16:02:44Z carlossg $
30: * @since 1.1
31: */
32: public class MethodDefinitionSourceMapping {
33:
34: private String methodName;
35:
36: private List configAttributes = new ArrayList();
37:
38: /**
39: * Name of the method to be secured, including package and class name.
40: * eg. <code>org.mydomain.MyClass.myMethod</code>
41: *
42: * @param methodName
43: */
44: public void setMethodName(String methodName) {
45: this .methodName = methodName;
46: }
47:
48: /**
49: * Name of the method to be secured.
50: *
51: * @return the name of the method
52: */
53: public String getMethodName() {
54: return methodName;
55: }
56:
57: /**
58: *
59: * @param roles {@link List}<{@link String}>
60: */
61: public void setConfigAttributes(List roles) {
62: this .configAttributes = roles;
63: }
64:
65: /**
66: *
67: * @return {@link List}<{@link String}>
68: */
69: public List getConfigAttributes() {
70: return configAttributes;
71: }
72:
73: /**
74: * Add a {@link ConfigAttribute} as {@link String}
75: *
76: * @param configAttribute
77: */
78: public void addConfigAttribute(String configAttribute) {
79: configAttributes.add(configAttribute);
80: }
81:
82: }
|