1 /**
2 * Copyright 2005-2015 The Kuali Foundation
3 *
4 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 package org.kuali.rice.krad.web.controller;
17
18 import org.kuali.rice.core.api.exception.RiceRuntimeException;
19
20 /**
21 * Runtime exception thrown when a controller method is requested that is not accessible.
22 *
23 * @author Kuali Rice Team (rice.collab@kuali.org)
24 */
25 public class MethodAccessException extends RiceRuntimeException {
26 private static final long serialVersionUID = -4173237177827444387L;
27
28 private final Class<?> controllerClass;
29 private final String methodToCall;
30
31 public MethodAccessException(Class<?> controllerClass, String methodToCall) {
32 super("Access is protected for controller: " + controllerClass.getName() + " and method: " + methodToCall);
33
34 this.controllerClass = controllerClass;
35 this.methodToCall = methodToCall;
36 }
37
38 /**
39 * Class of the controller the method was requested for.
40 *
41 * @return controller class
42 */
43 public Class<?> getControllerClass() {
44 return controllerClass;
45 }
46
47 /**
48 * Name of the controller method that was requested.
49 *
50 * @return controller method name
51 */
52 public String getMethodToCall() {
53 return methodToCall;
54 }
55 }