001 /*
002 * Copyright 2005-2008 The Kuali Foundation
003 *
004 *
005 * Licensed under the Educational Community License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.opensource.org/licenses/ecl2.php
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.kuali.rice.kew.rule;
018
019
020 /**
021 * A defined role on a {@link RoleAttribute}.
022 *
023 * @author Kuali Rice Team (rice.collab@kuali.org)
024 */
025 public class Role implements java.io.Serializable {
026
027 private static final long serialVersionUID = 1211399058525182383L;
028 private String name;
029 private String baseName;
030 private String label;
031
032 private String returnUrl;;
033
034 public Role() {
035 }
036
037 public String getReturnUrl() {
038 return returnUrl;
039 }
040 public void setReturnUrl(String returnUrl) {
041 this.returnUrl = returnUrl;
042 }
043
044 public Role(Class attributeClass, String roleName, String roleLabel) {
045 this.label = roleLabel;
046 this.baseName = roleName;
047 this.name = constructRoleValue(attributeClass.getName(), roleName);
048 }
049
050 public String getLabel() {
051 return label;
052 }
053
054 public void setLabel(String roleLabel) {
055 this.label = roleLabel;
056 }
057
058 public String getName() {
059 return name;
060 }
061
062 public void setName(String roleName) {
063 this.name = roleName;
064 }
065 public String getBaseName() {
066 return baseName;
067 }
068
069 public static String constructRoleValue(String attributeClassName, String roleName) {
070 return attributeClassName + "!" + roleName;
071 }
072 }