| Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
| MethodDefinitionSourceMapping |
|
| 1.0;1 |
| 1 | /* Copyright 2006 Acegi Technology Pty Limited |
|
| 2 | * |
|
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 | * you may not use this file except in compliance with the License. |
|
| 5 | * You may obtain a copy of the License at |
|
| 6 | * |
|
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 | * |
|
| 9 | * 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 | 64 | public class MethodDefinitionSourceMapping { |
| 33 | ||
| 34 | private String methodName; |
|
| 35 | ||
| 36 | 64 | 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 | 64 | this.methodName = methodName; |
| 46 | 64 | } |
| 47 | ||
| 48 | /** |
|
| 49 | * Name of the method to be secured. |
|
| 50 | * |
|
| 51 | * @return the name of the method |
|
| 52 | */ |
|
| 53 | public String getMethodName() { |
|
| 54 | 64 | return methodName; |
| 55 | } |
|
| 56 | ||
| 57 | /** |
|
| 58 | * |
|
| 59 | * @param roles {@link List}<{@link String}> |
|
| 60 | */ |
|
| 61 | public void setConfigAttributes(List roles) { |
|
| 62 | 0 | this.configAttributes = roles; |
| 63 | 0 | } |
| 64 | ||
| 65 | /** |
|
| 66 | * |
|
| 67 | * @return {@link List}<{@link String}> |
|
| 68 | */ |
|
| 69 | public List getConfigAttributes() { |
|
| 70 | 64 | 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 | 108 | configAttributes.add(configAttribute); |
| 80 | 108 | } |
| 81 | ||
| 82 | } |